Chromium Code Reviews| 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_); |