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

Unified Diff: chrome/browser/extensions/extension_window_list.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_window_list.cc
diff --git a/chrome/browser/extensions/extension_window_list.cc b/chrome/browser/extensions/extension_window_list.cc
index 73aaab862bd247f7537d72e45be55e2f16df1047..ba4522397ed9011e8b4a035b8b55593c9d8f0982 100644
--- a/chrome/browser/extensions/extension_window_list.cc
+++ b/chrome/browser/extensions/extension_window_list.cc
@@ -6,6 +6,7 @@
#include <algorithm>
+#include "chrome/browser/extensions/extension_function.h"
#include "chrome/browser/sessions/session_id.h"
#include "chrome/browser/ui/base_window.h"
@@ -36,28 +37,24 @@ void ExtensionWindowList::RemoveExtensionWindow(
windows_.erase(iter);
}
-ExtensionWindowController* ExtensionWindowList::FindWindowById(
- Profile* profile,
- ProfileMatchType match_type,
+ExtensionWindowController* ExtensionWindowList::FindWindowForFunctionById(
+ const UIThreadExtensionFunction* function,
int id) const {
for (WindowList::const_iterator iter = windows().begin();
iter != windows().end(); ++iter) {
- if ((*iter)->MatchesProfile(profile, match_type)) {
- if ((*iter)->GetWindowId() == id)
- return *iter;
- }
+ if (function->CanOperateOnWindow(*iter) && (*iter)->GetWindowId() == id)
+ return *iter;
}
return NULL;
}
-ExtensionWindowController* ExtensionWindowList::CurrentWindow(
- Profile* profile,
- ProfileMatchType match_type) const {
+ExtensionWindowController* ExtensionWindowList::CurrentWindowForFunction(
+ const UIThreadExtensionFunction* function) const {
ExtensionWindowController* result = NULL;
// Returns either the focused window (if any), or the last window in the list.
for (WindowList::const_iterator iter = windows().begin();
iter != windows().end(); ++iter) {
- if ((*iter)->MatchesProfile(profile, match_type)) {
+ if (function->CanOperateOnWindow(*iter)) {
result = *iter;
if (result->window()->IsActive())
break; // use focused window
« no previous file with comments | « chrome/browser/extensions/extension_window_list.h ('k') | chrome/browser/extensions/platform_app_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698