OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_TABS_WINDOWS_UTIL_H__ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_TABS_WINDOWS_UTIL_H__ |
6 #define CHROME_BROWSER_EXTENSIONS_API_TABS_WINDOWS_UTIL_H__ | 6 #define CHROME_BROWSER_EXTENSIONS_API_TABS_WINDOWS_UTIL_H__ |
7 | 7 |
8 #include "chrome/browser/extensions/window_controller_list.h" | 8 #include "chrome/browser/extensions/window_controller_list.h" |
9 | 9 |
10 class UIThreadExtensionFunction; | 10 class UIThreadExtensionFunction; |
11 | 11 |
12 namespace content { | |
13 class BrowserContext; | |
14 } | |
15 | |
16 namespace extensions { | 12 namespace extensions { |
17 class Extension; | |
18 class WindowController; | 13 class WindowController; |
19 } | 14 } |
20 | 15 |
21 namespace windows_util { | 16 namespace windows_util { |
22 | 17 |
23 // Populates |controller| for given |window_id|. If the window is not found, | 18 // Populates |controller| for given |window_id|. If the window is not found, |
24 // returns false and sets |error|. | 19 // returns false and sets |error|. |
25 bool GetWindowFromWindowID(UIThreadExtensionFunction* function, | 20 bool GetWindowFromWindowID(UIThreadExtensionFunction* function, |
26 int window_id, | 21 int window_id, |
27 extensions::WindowController::TypeFilter filter, | 22 extensions::WindowController::TypeFilter filter, |
28 extensions::WindowController** controller, | 23 extensions::WindowController** controller, |
29 std::string* error); | 24 std::string* error); |
30 | 25 |
31 // Returns true if |function| (and the profile and extension that it was | 26 // Returns true if |function| (and the profile and extension that it was |
32 // invoked from) can operate on the window wrapped by |window_controller|. | 27 // invoked from) can operate on the window wrapped by |window_controller|. |
33 // If |all_window_types| is set this function will return true for any | 28 // If |all_window_types| is set this function will return true for any |
34 // kind of window (including app and devtools), otherwise it will | 29 // kind of window (including app and devtools), otherwise it will |
35 // return true only for normal browser windows as well as windows | 30 // return true only for normal browser windows as well as windows |
36 // created by the extension. | 31 // created by the extension. |
37 bool CanOperateOnWindow(const UIThreadExtensionFunction* function, | 32 bool CanOperateOnWindow(const UIThreadExtensionFunction* function, |
38 const extensions::WindowController* controller, | 33 const extensions::WindowController* controller, |
39 extensions::WindowController::TypeFilter filter); | 34 extensions::WindowController::TypeFilter filter); |
40 | 35 |
41 } // namespace windows_util | 36 } // namespace windows_util |
42 | 37 |
43 #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_WINDOWS_UTIL_H__ | 38 #endif // CHROME_BROWSER_EXTENSIONS_API_TABS_WINDOWS_UTIL_H__ |
OLD | NEW |