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

Unified Diff: chrome/browser/extensions/api/identity/web_auth_flow.cc

Issue 15892012: Identity API: defer loading component app (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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/component_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/identity/web_auth_flow.cc
diff --git a/chrome/browser/extensions/api/identity/web_auth_flow.cc b/chrome/browser/extensions/api/identity/web_auth_flow.cc
index d4347d445f2a7cce584c07b5b8ee571676888c9c..0621e65c27ab66aa718758a2d2947c8c3d53bf65 100644
--- a/chrome/browser/extensions/api/identity/web_auth_flow.cc
+++ b/chrome/browser/extensions/api/identity/web_auth_flow.cc
@@ -7,6 +7,9 @@
#include "base/location.h"
#include "base/message_loop.h"
#include "base/utf_string_conversions.h"
+#include "chrome/browser/extensions/component_loader.h"
+#include "chrome/browser/extensions/extension_service.h"
+#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_navigator.h"
@@ -20,6 +23,7 @@
#include "content/public/browser/web_contents.h"
#include "content/public/common/page_transition_types.h"
#include "googleurl/src/gurl.h"
+#include "grit/browser_resources.h"
#include "ui/base/window_open_disposition.h"
using content::LoadNotificationDetails;
@@ -66,6 +70,17 @@ WebAuthFlow::~WebAuthFlow() {
}
void WebAuthFlow::Start() {
+ static bool is_component_loaded = false;
Matt Perry 2013/05/29 00:39:28 This isn't multi-profile safe.
Michael Courage 2013/05/29 00:49:37 Good point. Is it reasonable/cheap to just do this
Matt Perry 2013/05/29 00:53:38 This will actually cause the app to reload, which
Michael Courage 2013/05/29 01:49:53 ComponentLoader::Exists will do the trick, thanks.
+ if (!is_component_loaded) {
+ extensions::ExtensionSystem* extension_system =
+ extensions::ExtensionSystem::Get(profile_);
+ ExtensionService* extension_service = extension_system->extension_service();
+ extension_service->component_loader()->Add(
+ IDR_IDENTITY_API_SCOPE_APPROVAL_MANIFEST,
+ base::FilePath(FILE_PATH_LITERAL("identity_scope_approval_dialog")));
+ is_component_loaded = true;
+ }
+
contents_ = CreateWebContents();
WebContentsObserver::Observe(contents_);
« no previous file with comments | « no previous file | chrome/browser/extensions/component_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698