OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_EXTENSION_WINDOW_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_WINDOW_CONTROLLER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WINDOW_CONTROLLER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_WINDOW_CONTROLLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 | 12 |
13 class BaseWindow; | 13 class BaseWindow; |
14 class Browser; // TODO(stevenjb) eliminate this dependency. | 14 class Browser; // TODO(stevenjb) eliminate this dependency. |
15 class GURL; | 15 class GURL; |
16 class Profile; | 16 class Profile; |
17 class SessionID; | 17 class SessionID; |
18 | 18 |
19 namespace base { | 19 namespace base { |
20 class DictionaryValue; | 20 class DictionaryValue; |
21 } | 21 } |
22 | 22 |
23 namespace extensions { | |
24 class Extension; | |
25 } | |
26 | |
27 namespace gfx { | 23 namespace gfx { |
28 class Rect; | 24 class Rect; |
29 } | 25 } |
30 | 26 |
| 27 namespace extensions { |
| 28 class Extension; |
| 29 |
31 // This API needs to be implemented by any window that might be accessed | 30 // This API needs to be implemented by any window that might be accessed |
32 // through chrome.windows or chrome.tabs (e.g. browser windows and panels). | 31 // through chrome.windows or chrome.tabs (e.g. browser windows and panels). |
33 class ExtensionWindowController { | 32 class WindowController { |
34 public: | 33 public: |
35 enum Reason { | 34 enum Reason { |
36 REASON_NONE, | 35 REASON_NONE, |
37 REASON_NOT_EDITABLE, | 36 REASON_NOT_EDITABLE, |
38 }; | 37 }; |
39 | 38 |
40 ExtensionWindowController(BaseWindow* window, Profile* profile); | 39 WindowController(BaseWindow* window, Profile* profile); |
41 virtual ~ExtensionWindowController(); | 40 virtual ~WindowController(); |
42 | 41 |
43 BaseWindow* window() const { return window_; } | 42 BaseWindow* window() const { return window_; } |
44 | 43 |
45 Profile* profile() const { return profile_; } | 44 Profile* profile() const { return profile_; } |
46 | 45 |
47 // Return an id uniquely identifying the window. | 46 // Return an id uniquely identifying the window. |
48 virtual int GetWindowId() const = 0; | 47 virtual int GetWindowId() const = 0; |
49 | 48 |
50 // Return the type name for the window. | 49 // Return the type name for the window. |
51 virtual std::string GetWindowTypeText() const = 0; | 50 virtual std::string GetWindowTypeText() const = 0; |
(...skipping 14 matching lines...) Expand all Loading... |
66 // associated with the extension (used by FullscreenController). | 65 // associated with the extension (used by FullscreenController). |
67 virtual void SetFullscreenMode(bool is_fullscreen, | 66 virtual void SetFullscreenMode(bool is_fullscreen, |
68 const GURL& extension_url) const = 0; | 67 const GURL& extension_url) const = 0; |
69 | 68 |
70 // Returns a Browser if available. Defaults to returning NULL. | 69 // Returns a Browser if available. Defaults to returning NULL. |
71 // TODO(stevenjb): Temporary workaround. Eliminate this. | 70 // TODO(stevenjb): Temporary workaround. Eliminate this. |
72 virtual Browser* GetBrowser() const; | 71 virtual Browser* GetBrowser() const; |
73 | 72 |
74 // Extension/window visibility and ownership is window-specific, subclasses | 73 // Extension/window visibility and ownership is window-specific, subclasses |
75 // need to define this behavior. | 74 // need to define this behavior. |
76 virtual bool IsVisibleToExtension( | 75 virtual bool IsVisibleToExtension(const Extension* extension) const = 0; |
77 const extensions::Extension* extension) const = 0; | |
78 | 76 |
79 private: | 77 private: |
80 BaseWindow* window_; | 78 BaseWindow* window_; |
81 Profile* profile_; | 79 Profile* profile_; |
82 | 80 |
83 DISALLOW_COPY_AND_ASSIGN(ExtensionWindowController); | 81 DISALLOW_COPY_AND_ASSIGN(WindowController); |
84 }; | 82 }; |
85 | 83 |
86 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WINDOW_CONTROLLER_H_ | 84 } // namespace extensions |
| 85 |
| 86 #endif // CHROME_BROWSER_EXTENSIONS_WINDOW_CONTROLLER_H_ |
OLD | NEW |