summaryrefslogtreecommitdiffstats
path: root/cloud_print/service/win/service_state.h
diff options
context:
space:
mode:
authorloislo@chromium.org <loislo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-06 10:30:50 +0000
committerloislo@chromium.org <loislo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-06 10:30:50 +0000
commit4ecd467fcfb7de5369c05c480e6a68c0984b7df5 (patch)
tree7406db94e780cd52df00371eb611794c9aa9ae93 /cloud_print/service/win/service_state.h
parentd27b2f905be9538f966c513146407dc0ab7ead36 (diff)
downloadchromium_src-4ecd467fcfb7de5369c05c480e6a68c0984b7df5.zip
chromium_src-4ecd467fcfb7de5369c05c480e6a68c0984b7df5.tar.gz
chromium_src-4ecd467fcfb7de5369c05c480e6a68c0984b7df5.tar.bz2
Not all the files were added
Revert "Apply early reverted r140703." This reverts commit d27b2f905be9538f966c513146407dc0ab7ead36. BUG=none TEST=none TBR=vitalybuka Review URL: https://chromiumcodereview.appspot.com/10543021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140736 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cloud_print/service/win/service_state.h')
-rw-r--r--cloud_print/service/win/service_state.h103
1 files changed, 103 insertions, 0 deletions
diff --git a/cloud_print/service/win/service_state.h b/cloud_print/service/win/service_state.h
new file mode 100644
index 0000000..ef037bb
--- /dev/null
+++ b/cloud_print/service/win/service_state.h
@@ -0,0 +1,103 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CLOUD_PRINT_SERVICE_SERVICE_STATE_H_
+#define CLOUD_PRINT_SERVICE_SERVICE_STATE_H_
+
+#include <string>
+
+#include "base/file_path.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/values.h"
+
+class FilePath;
+
+// Manages Cloud Print part of Service State.
+class ServiceState {
+ public:
+ ServiceState();
+ virtual ~ServiceState();
+
+ void Reset();
+
+ // Initialize object from json.
+ bool FromString(const std::string& json);
+
+ // Returns object state as json.
+ std::string ToString();
+
+ // Setups object using data provided by delegate.
+ bool Configure(const std::string& email,
+ const std::string& password,
+ const std::string& proxy_id);
+
+ // Returns authentication token provided by Google server.
+ virtual std::string LoginToGoogle(const std::string& service,
+ const std::string& email,
+ const std::string& password);
+
+ // Returns true of object state is valid.
+ bool IsValid() const;
+
+ std::string email() const {
+ return email_;
+ };
+
+ std::string proxy_id() const {
+ return proxy_id_;
+ };
+
+ std::string robot_email() const {
+ return robot_email_;
+ };
+
+ std::string robot_token() const {
+ return robot_token_;
+ };
+
+ std::string auth_token() const {
+ return auth_token_;
+ };
+
+ std::string xmpp_auth_token() const {
+ return xmpp_auth_token_;
+ };
+
+ void set_email(const std::string& value) {
+ email_ = value;
+ };
+
+ void set_proxy_id(const std::string& value) {
+ proxy_id_ = value;
+ };
+
+ void set_robot_email(const std::string& value) {
+ robot_email_ = value;
+ };
+
+ void set_robot_token(const std::string& value) {
+ robot_token_ = value;
+ };
+
+ void set_auth_token(const std::string& value) {
+ auth_token_ = value;
+ };
+
+ void set_xmpp_auth_token(const std::string& value) {
+ xmpp_auth_token_ = value;
+ };
+
+ private:
+ std::string email_;
+ std::string proxy_id_;
+ std::string robot_email_;
+ std::string robot_token_;
+ std::string auth_token_;
+ std::string xmpp_auth_token_;
+
+ DISALLOW_COPY_AND_ASSIGN(ServiceState);
+};
+
+#endif // CLOUD_PRINT_SERVICE_SERVICE_STATE_H_
+