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 |