Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(743)

Unified Diff: chrome/browser/extensions/signin/gaia_auth_extension_loader.h

Issue 902493003: cros: Pass gaia_auth init params via postMessage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nits Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/signin/gaia_auth_extension_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/signin/gaia_auth_extension_loader.h
diff --git a/chrome/browser/extensions/signin/gaia_auth_extension_loader.h b/chrome/browser/extensions/signin/gaia_auth_extension_loader.h
index 20fd46482a3e8fc338f7868e1ef895e6b42f409c..146596e11691145ac9532c4686a9fcd85bdb4c43 100644
--- a/chrome/browser/extensions/signin/gaia_auth_extension_loader.h
+++ b/chrome/browser/extensions/signin/gaia_auth_extension_loader.h
@@ -5,7 +5,10 @@
#ifndef CHROME_BROWSER_EXTENSIONS_SIGNIN_GAIA_AUTH_EXTENSION_LOADER_H_
#define CHROME_BROWSER_EXTENSIONS_SIGNIN_GAIA_AUTH_EXTENSION_LOADER_H_
-#include "base/memory/scoped_ptr.h"
+#include <map>
+#include <string>
+
+#include "base/macros.h"
#include "extensions/browser/browser_context_keyed_api_factory.h"
namespace content {
@@ -29,6 +32,15 @@ class GaiaAuthExtensionLoader : public BrowserContextKeyedAPI {
// Unload the gaia auth extension if no pending reference.
void UnloadIfNeeded();
+ // Add a string data for gaia auth extension. Returns an ID that
+ // could be used to get the data. All strings are cleared when gaia auth
+ // is unloaded.
+ int AddData(const std::string& data);
+
+ // Get data for the given ID. Returns true if the data is found and
+ // its value is copied to |data|. Otherwise, returns false.
+ bool GetData(int data_id, std::string* data);
+
static GaiaAuthExtensionLoader* Get(content::BrowserContext* context);
// BrowserContextKeyedAPI implementation.
@@ -50,6 +62,9 @@ class GaiaAuthExtensionLoader : public BrowserContextKeyedAPI {
content::BrowserContext* browser_context_;
int load_count_;
+ int last_data_id_;
+ std::map<int, std::string> data_;
+
DISALLOW_COPY_AND_ASSIGN(GaiaAuthExtensionLoader);
};
« no previous file with comments | « no previous file | chrome/browser/extensions/signin/gaia_auth_extension_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698