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

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: nit 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
« no previous file with comments | « chrome/browser/extensions/extension_tab_util.cc ('k') | chrome/browser/extensions/window_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..73d3907b55a23502dd27eee130695bb0d6ea7a05 100644
--- a/chrome/browser/extensions/window_controller.h
+++ b/chrome/browser/extensions/window_controller.h
@@ -9,6 +9,7 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "chrome/common/extensions/api/windows.h"
class Browser; // TODO(stevenjb) eliminate this dependency.
class GURL;
@@ -41,6 +42,21 @@ class WindowController {
REASON_NOT_EDITABLE,
};
+ // A bitmaks used as filter on window types.
+ using TypeFilter = uint32_t;
+
+ // Returns a filter allowing all window types to be manipulated
+ // through the chrome.windows APIs.
+ static TypeFilter GetAllWindowFilter();
+
+ // Returns the default filter to be used when operating on the windows
+ // from WindowControllerList when using the chrome.windows APIs.
+ static TypeFilter GetDefaultWindowFilter();
+
+ // Builds a filter out of a vector of window types.
+ static TypeFilter GetFilterFromWindowTypes(
+ const std::vector<api::windows::WindowType>& types);
+
WindowController(ui::BaseWindow* window, Profile* profile);
virtual ~WindowController();
@@ -83,6 +99,9 @@ class WindowController {
// need to define this behavior.
virtual bool IsVisibleToExtension(const Extension* extension) const = 0;
+ // Returns true if the window type of the controller matches the |filter|.
+ bool MatchesFilter(TypeFilter filter) const;
+
private:
ui::BaseWindow* window_;
Profile* profile_;
« no previous file with comments | « chrome/browser/extensions/extension_tab_util.cc ('k') | chrome/browser/extensions/window_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698