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_UI_EXTENSIONS_SHELL_WINDOW_H_ | 5 #ifndef CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ |
6 #define CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ | 6 #define CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "chrome/browser/extensions/extension_keybinding_registry.h" | 10 #include "chrome/browser/extensions/extension_keybinding_registry.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 // ShellWindow is the type of window used by platform apps. Shell windows | 63 // ShellWindow is the type of window used by platform apps. Shell windows |
64 // have a WebContents but none of the chrome of normal browser windows. | 64 // have a WebContents but none of the chrome of normal browser windows. |
65 class ShellWindow : public content::NotificationObserver, | 65 class ShellWindow : public content::NotificationObserver, |
66 public content::WebContentsDelegate, | 66 public content::WebContentsDelegate, |
67 public extensions::ExtensionKeybindingRegistry::Delegate { | 67 public extensions::ExtensionKeybindingRegistry::Delegate { |
68 public: | 68 public: |
69 enum WindowType { | 69 enum WindowType { |
70 WINDOW_TYPE_DEFAULT, // Default shell window | 70 WINDOW_TYPE_DEFAULT, // Default shell window |
71 WINDOW_TYPE_PANEL, // OS controlled panel window (Ash only) | 71 WINDOW_TYPE_PANEL, // OS controlled panel window (Ash only) |
| 72 WINDOW_TYPE_V1_PANEL, // For apps v1 support in Ash; deprecate with v1 apps |
72 }; | 73 }; |
73 | 74 |
74 enum Frame { | 75 enum Frame { |
75 FRAME_CHROME, // Chrome-style window frame. | 76 FRAME_CHROME, // Chrome-style window frame. |
76 FRAME_NONE, // Frameless window. | 77 FRAME_NONE, // Frameless window. |
77 }; | 78 }; |
78 | 79 |
79 struct CreateParams { | 80 struct CreateParams { |
80 CreateParams(); | 81 CreateParams(); |
81 ~CreateParams(); | 82 ~CreateParams(); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 void Init(const GURL& url, | 124 void Init(const GURL& url, |
124 ShellWindowContents* shell_window_contents, | 125 ShellWindowContents* shell_window_contents, |
125 const CreateParams& params); | 126 const CreateParams& params); |
126 | 127 |
127 | 128 |
128 const std::string& window_key() const { return window_key_; } | 129 const std::string& window_key() const { return window_key_; } |
129 const SessionID& session_id() const { return session_id_; } | 130 const SessionID& session_id() const { return session_id_; } |
130 const extensions::Extension* extension() const { return extension_; } | 131 const extensions::Extension* extension() const { return extension_; } |
131 content::WebContents* web_contents() const; | 132 content::WebContents* web_contents() const; |
132 WindowType window_type() const { return window_type_; } | 133 WindowType window_type() const { return window_type_; } |
| 134 bool window_type_is_panel() const { |
| 135 return (window_type_ == WINDOW_TYPE_PANEL || |
| 136 window_type_ == WINDOW_TYPE_V1_PANEL); |
| 137 } |
133 Profile* profile() const { return profile_; } | 138 Profile* profile() const { return profile_; } |
134 const gfx::Image& app_icon() const { return app_icon_; } | 139 const gfx::Image& app_icon() const { return app_icon_; } |
135 const GURL& app_icon_url() { return app_icon_url_; } | 140 const GURL& app_icon_url() { return app_icon_url_; } |
136 | 141 |
137 NativeAppWindow* GetBaseWindow(); | 142 NativeAppWindow* GetBaseWindow(); |
138 gfx::NativeWindow GetNativeWindow(); | 143 gfx::NativeWindow GetNativeWindow(); |
139 | 144 |
140 // This will return a slightly smaller icon then the app_icon to be used in | 145 // This will return a slightly smaller icon then the app_icon to be used in |
141 // application lists. It is the responsibility of the caller to delete the | 146 // application lists. It is the responsibility of the caller to delete the |
142 // returned image after use. | 147 // returned image after use. |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 scoped_ptr<ShellWindowContents> shell_window_contents_; | 262 scoped_ptr<ShellWindowContents> shell_window_contents_; |
258 | 263 |
259 base::WeakPtrFactory<ShellWindow> weak_ptr_factory_; | 264 base::WeakPtrFactory<ShellWindow> weak_ptr_factory_; |
260 | 265 |
261 base::WeakPtrFactory<ShellWindow> image_loader_ptr_factory_; | 266 base::WeakPtrFactory<ShellWindow> image_loader_ptr_factory_; |
262 | 267 |
263 DISALLOW_COPY_AND_ASSIGN(ShellWindow); | 268 DISALLOW_COPY_AND_ASSIGN(ShellWindow); |
264 }; | 269 }; |
265 | 270 |
266 #endif // CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ | 271 #endif // CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ |
OLD | NEW |