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

Unified Diff: chrome/browser/extensions/extension_tabs_module.cc

Issue 10021071: Remove Browser dependency in ExtensionFunctionDispatcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 8 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/extensions/extension_tabs_module.cc
diff --git a/chrome/browser/extensions/extension_tabs_module.cc b/chrome/browser/extensions/extension_tabs_module.cc
index 054c58e8c36eb20be6150066abf8bcb835bbcc2e..a9ae4a35b60830c2cb7c65f71b00a2590d38c7e6 100644
--- a/chrome/browser/extensions/extension_tabs_module.cc
+++ b/chrome/browser/extensions/extension_tabs_module.cc
@@ -147,10 +147,11 @@ bool GetWindowFromWindowID(UIThreadExtensionFunction* function,
int window_id,
ExtensionWindowController** controller) {
if (window_id == extension_misc::kCurrentWindowId) {
- Browser* browser = function->dispatcher()->delegate()->GetBrowser();
- // If there is a windowed browser associated with this extension, use that.
- if (browser && browser->extension_window_controller()) {
- *controller = browser->extension_window_controller();
+ ExtensionWindowController* extension_window_controller =
+ function->dispatcher()->delegate()->GetExtensionWindowController();
+ // If there is a window controller associated with this extension, use that.
+ if (extension_window_controller) {
+ *controller = extension_window_controller;
} else {
// Otherwise get the focused or most recently added window.
*controller = ExtensionWindowList::GetInstance()->CurrentWindow(
@@ -795,7 +796,7 @@ bool RemoveWindowFunction::RunImpl() {
ExtensionWindowController::Reason reason;
if (!controller->CanClose(&reason)) {
- if (reason == ExtensionWindowController::REASON_TAB_STRIP_NOT_EDITABLE)
+ if (reason == ExtensionWindowController::REASON_NOT_EDITABLE)
error_ = keys::kTabStripNotEditableError;
return false;
}

Powered by Google App Engine
This is Rietveld 408576698