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

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

Issue 10407035: Extension/Platform App window isolation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add "ForFunction" Created 8 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
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());
« no previous file with comments | « chrome/browser/extensions/extension_function.cc ('k') | chrome/browser/extensions/extension_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698