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

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: Fix Aura build 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..832efc448aacaa03628f3dfd5dc0d5b62aa19610 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"
@@ -37,27 +38,23 @@ void ExtensionWindowList::RemoveExtensionWindow(
}
ExtensionWindowController* ExtensionWindowList::FindWindowById(
- Profile* profile,
- ProfileMatchType match_type,
+ const UIThreadExtensionFunction* function,
stevenjb 2012/05/21 21:55:42 nit: Maybe we should rename this something like Fi
Mihai Parparita -not on Chrome 2012/05/21 22:05:29 Done.
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 {
+ const UIThreadExtensionFunction* function) const {
stevenjb 2012/05/21 21:55:42 nit: Maybe CurrentWindowForFunction?
Mihai Parparita -not on Chrome 2012/05/21 22:05:29 Done.
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