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

Unified Diff: chrome/browser/ui/browser.cc

Issue 9428018: Create BaseWindow and ExtensionWindowWrapper for extension API access to Panels (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index dfb836f77854e5647dd398b982345a351cf1a592..9a918ed13a800b214aa60ad0b7fbd747d762b91f 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -49,6 +49,7 @@
#include "chrome/browser/download/download_util.h"
#include "chrome/browser/extensions/crx_installer.h"
#include "chrome/browser/extensions/default_apps_trial.h"
+#include "chrome/browser/extensions/browser_extension_window_wrapper.h"
#include "chrome/browser/extensions/extension_browser_event_router.h"
#include "chrome/browser/extensions/extension_disabled_infobar_delegate.h"
#include "chrome/browser/extensions/extension_prefs.h"
@@ -426,6 +427,10 @@ Browser::~Browser() {
service->RemoveObserver(this);
BrowserList::RemoveBrowser(this);
+ if (extension_window_wrapper_.get()) {
+ ExtensionWindowWrapperList::GetInstance()->RemoveExtensionWindow(
+ extension_window_wrapper_.get());
+ }
#if !defined(OS_MACOSX)
if (!BrowserList::HasBrowserWithProfile(profile_)) {
@@ -567,6 +572,12 @@ void Browser::InitBrowserWindow() {
}
#endif
+ // Add the browser to the list of windows available to the extension API.
+ // (Before sending notifications).
+ extension_window_wrapper_.reset(new BrowserExtensionWindowWrapper(this));
+ ExtensionWindowWrapperList::GetInstance()->AddExtensionWindow(
+ extension_window_wrapper_.get());
+
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_BROWSER_WINDOW_READY,
content::Source<Browser>(this),

Powered by Google App Engine
This is Rietveld 408576698