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_WINDOW_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_WINDOW_CONTROLLER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_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" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 | 50 |
51 // Return the type name for the window. | 51 // Return the type name for the window. |
52 virtual std::string GetWindowTypeText() const = 0; | 52 virtual std::string GetWindowTypeText() const = 0; |
53 | 53 |
54 // Populates a dictionary for the Window object. Override this to set | 54 // Populates a dictionary for the Window object. Override this to set |
55 // implementation specific properties (call the base implementation first to | 55 // implementation specific properties (call the base implementation first to |
56 // set common properties). | 56 // set common properties). |
57 virtual base::DictionaryValue* CreateWindowValue() const; | 57 virtual base::DictionaryValue* CreateWindowValue() const; |
58 | 58 |
59 // Populates a dictionary for the Window object, including a list of tabs. | 59 // Populates a dictionary for the Window object, including a list of tabs. |
60 virtual base::DictionaryValue* CreateWindowValueWithTabs() const = 0; | 60 virtual base::DictionaryValue* CreateWindowValueWithTabs( |
| 61 const extensions::Extension* extension) const = 0; |
61 | 62 |
62 // Returns false if the window is in a state where closing the window is not | 63 // Returns false if the window is in a state where closing the window is not |
63 // permitted and sets |reason| if not NULL. | 64 // permitted and sets |reason| if not NULL. |
64 virtual bool CanClose(Reason* reason) const = 0; | 65 virtual bool CanClose(Reason* reason) const = 0; |
65 | 66 |
66 // Set the window's fullscreen state. |extension_url| provides the url | 67 // Set the window's fullscreen state. |extension_url| provides the url |
67 // associated with the extension (used by FullscreenController). | 68 // associated with the extension (used by FullscreenController). |
68 virtual void SetFullscreenMode(bool is_fullscreen, | 69 virtual void SetFullscreenMode(bool is_fullscreen, |
69 const GURL& extension_url) const = 0; | 70 const GURL& extension_url) const = 0; |
70 | 71 |
71 // Returns a Browser if available. Defaults to returning NULL. | 72 // Returns a Browser if available. Defaults to returning NULL. |
72 // TODO(stevenjb): Temporary workaround. Eliminate this. | 73 // TODO(stevenjb): Temporary workaround. Eliminate this. |
73 virtual Browser* GetBrowser() const; | 74 virtual Browser* GetBrowser() const; |
74 | 75 |
75 // Extension/window visibility and ownership is window-specific, subclasses | 76 // Extension/window visibility and ownership is window-specific, subclasses |
76 // need to define this behavior. | 77 // need to define this behavior. |
77 virtual bool IsVisibleToExtension(const Extension* extension) const = 0; | 78 virtual bool IsVisibleToExtension(const Extension* extension) const = 0; |
78 | 79 |
79 private: | 80 private: |
80 BaseWindow* window_; | 81 BaseWindow* window_; |
81 Profile* profile_; | 82 Profile* profile_; |
82 | 83 |
83 DISALLOW_COPY_AND_ASSIGN(WindowController); | 84 DISALLOW_COPY_AND_ASSIGN(WindowController); |
84 }; | 85 }; |
85 | 86 |
86 } // namespace extensions | 87 } // namespace extensions |
87 | 88 |
88 #endif // CHROME_BROWSER_EXTENSIONS_WINDOW_CONTROLLER_H_ | 89 #endif // CHROME_BROWSER_EXTENSIONS_WINDOW_CONTROLLER_H_ |
OLD | NEW |