1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CLOUD_PRINT_SERVICE_SERVICE_STATE_H_
6 #define CLOUD_PRINT_SERVICE_SERVICE_STATE_H_
10 #include "base/memory/scoped_ptr.h"
11 #include "base/values.h"
13 // Manages Cloud Print part of Service State.
17 virtual ~ServiceState();
21 // Initialize object from json.
22 bool FromString(const std::string
& json
);
24 // Returns object state as json.
25 std::string
ToString();
27 // Setups object using data provided by delegate.
28 bool Configure(const std::string
& email
,
29 const std::string
& password
,
30 const std::string
& proxy_id
);
32 // Returns authentication token provided by Google server.
33 virtual std::string
LoginToGoogle(const std::string
& service
,
34 const std::string
& email
,
35 const std::string
& password
);
37 // Returns true of object state is valid.
40 std::string
email() const {
44 std::string
proxy_id() const {
48 std::string
robot_email() const {
52 std::string
robot_token() const {
56 std::string
auth_token() const {
60 std::string
xmpp_auth_token() const {
61 return xmpp_auth_token_
;
64 void set_email(const std::string
& value
) {
68 void set_proxy_id(const std::string
& value
) {
72 void set_robot_email(const std::string
& value
) {
76 void set_robot_token(const std::string
& value
) {
80 void set_auth_token(const std::string
& value
) {
84 void set_xmpp_auth_token(const std::string
& value
) {
85 xmpp_auth_token_
= value
;
90 std::string proxy_id_
;
91 std::string robot_email_
;
92 std::string robot_token_
;
93 std::string auth_token_
;
94 std::string xmpp_auth_token_
;
96 DISALLOW_COPY_AND_ASSIGN(ServiceState
);
99 #endif // CLOUD_PRINT_SERVICE_SERVICE_STATE_H_