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

Unified Diff: chrome/browser/extensions/window_controller.h

Issue 1099553002: extensions: windows: list all windows from the current profile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move filters into window_controller.cc/h Created 5 years, 4 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/window_controller.h
diff --git a/chrome/browser/extensions/window_controller.h b/chrome/browser/extensions/window_controller.h
index f21a0fa83086e54d5c13b7a1531b0c2dfdb55b40..036bf3a8e966f00134530a80b8327d2718860553 100644
--- a/chrome/browser/extensions/window_controller.h
+++ b/chrome/browser/extensions/window_controller.h
@@ -30,6 +30,9 @@ class BaseWindow;
namespace extensions {
class Extension;
+// A bitmaks used as filter on window types.
+typedef uint32 WindowTypeFilter;
not at google - send to devlin 2015/08/05 17:33:25 We're supposed to use "using" these days. I'd also
llandwerlin-old 2015/08/05 18:12:02 Done.
+
// This API needs to be implemented by any window that might be accessed
// through chrome.windows or chrome.tabs (e.g. browser windows and panels).
// Subclasses must add/remove themselves from the WindowControllerList
@@ -41,6 +44,14 @@ class WindowController {
REASON_NOT_EDITABLE,
};
+ // Returns a filter allowing all window types to be manipulated
+ // through the chrome.windows APIs.
+ static WindowTypeFilter GetAllWindowFilter();
+
+ // Returns the default filter to be used when operating on the windows
+ // from WindowControllerList when using the chrome.windows APIs.
+ static WindowTypeFilter GetDefaultWindowFilter();
+
WindowController(ui::BaseWindow* window, Profile* profile);
virtual ~WindowController();
@@ -83,6 +94,9 @@ class WindowController {
// need to define this behavior.
virtual bool IsVisibleToExtension(const Extension* extension) const = 0;
+ // Returns true if the window type of |controller| matches the |filter|.
+ bool MatchesFilter(WindowTypeFilter filter) const;
+
private:
ui::BaseWindow* window_;
Profile* profile_;

Powered by Google App Engine
This is Rietveld 408576698