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 a325e44debe3f76df6b67fb8459e658d42c7c67a..732ebee670144aa9a798edf664d56d212cb3db60 100644 |
--- a/chrome/browser/extensions/extension_tabs_module.cc |
+++ b/chrome/browser/extensions/extension_tabs_module.cc |
@@ -142,13 +142,6 @@ bool GetBrowserFromWindowID( |
return true; |
} |
-ExtensionWindowController::ProfileMatchType ProfileMatchType( |
- bool include_incognito) { |
- return include_incognito ? |
- ExtensionWindowController::MATCH_INCOGNITO |
- : ExtensionWindowController::MATCH_NORMAL_ONLY; |
-} |
- |
bool GetWindowFromWindowID(UIThreadExtensionFunction* function, |
int window_id, |
ExtensionWindowController** controller) { |
@@ -160,19 +153,16 @@ bool GetWindowFromWindowID(UIThreadExtensionFunction* function, |
*controller = extension_window_controller; |
} else { |
// Otherwise get the focused or most recently added window. |
- *controller = ExtensionWindowList::GetInstance()->CurrentWindow( |
- function->profile(), |
- ProfileMatchType(function->include_incognito())); |
+ *controller = ExtensionWindowList::GetInstance()-> |
+ CurrentWindowForFunction(function); |
} |
if (!(*controller)) { |
function->SetError(keys::kNoCurrentWindowError); |
return false; |
} |
} else { |
- *controller = ExtensionWindowList::GetInstance()->FindWindowById( |
- function->profile(), |
- ProfileMatchType(function->include_incognito()), |
- window_id); |
+ *controller = ExtensionWindowList::GetInstance()->FindWindowForFunctionById( |
+ function, window_id); |
if (!(*controller)) { |
function->SetError(ExtensionErrorUtils::FormatErrorMessage( |
keys::kWindowNotFoundError, base::IntToString(window_id))); |
@@ -311,8 +301,7 @@ bool GetAllWindowsFunction::RunImpl() { |
for (ExtensionWindowList::WindowList::const_iterator iter = |
windows.begin(); |
iter != windows.end(); ++iter) { |
- if (!(*iter)->MatchesProfile( |
- profile(), ProfileMatchType(include_incognito()))) |
+ if (!this->CanOperateOnWindow(*iter)) |
continue; |
if (populate_tabs) |
window_list->Append((*iter)->CreateWindowValueWithTabs()); |