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" |
11 #include "chrome/browser/sessions/session_id.h" | 11 #include "chrome/browser/sessions/session_id.h" |
12 #include "chrome/browser/ui/base_window.h" | 12 #include "chrome/browser/ui/base_window.h" |
13 #include "chrome/browser/ui/web_contents_modal_dialog_manager_delegate.h" | 13 #include "chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.h" |
14 #include "content/public/browser/notification_observer.h" | 14 #include "content/public/browser/notification_observer.h" |
15 #include "content/public/browser/notification_registrar.h" | 15 #include "content/public/browser/notification_registrar.h" |
16 #include "content/public/browser/web_contents_delegate.h" | 16 #include "content/public/browser/web_contents_delegate.h" |
17 #include "content/public/common/console_message_level.h" | 17 #include "content/public/common/console_message_level.h" |
18 #include "ui/base/ui_base_types.h" // WindowShowState | 18 #include "ui/base/ui_base_types.h" // WindowShowState |
19 #include "ui/gfx/image/image.h" | 19 #include "ui/gfx/image/image.h" |
20 #include "ui/gfx/rect.h" | 20 #include "ui/gfx/rect.h" |
21 | 21 |
22 class GURL; | 22 class GURL; |
23 class Profile; | 23 class Profile; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 private: | 61 private: |
62 DISALLOW_COPY_AND_ASSIGN(ShellWindowContents); | 62 DISALLOW_COPY_AND_ASSIGN(ShellWindowContents); |
63 }; | 63 }; |
64 | 64 |
65 // ShellWindow is the type of window used by platform apps. Shell windows | 65 // ShellWindow is the type of window used by platform apps. Shell windows |
66 // have a WebContents but none of the chrome of normal browser windows. | 66 // have a WebContents but none of the chrome of normal browser windows. |
67 class ShellWindow : public content::NotificationObserver, | 67 class ShellWindow : public content::NotificationObserver, |
68 public content::WebContentsDelegate, | 68 public content::WebContentsDelegate, |
69 public extensions::ExtensionKeybindingRegistry::Delegate, | 69 public extensions::ExtensionKeybindingRegistry::Delegate, |
70 public WebContentsModalDialogManagerDelegate { | 70 public ChromeWebModalDialogManagerDelegate { |
71 public: | 71 public: |
72 enum WindowType { | 72 enum WindowType { |
73 WINDOW_TYPE_DEFAULT = 1 << 0, // Default shell window. | 73 WINDOW_TYPE_DEFAULT = 1 << 0, // Default shell window. |
74 WINDOW_TYPE_PANEL = 1 << 1, // OS controlled panel window (Ash only). | 74 WINDOW_TYPE_PANEL = 1 << 1, // OS controlled panel window (Ash only). |
75 WINDOW_TYPE_V1_PANEL = 1 << 2, // For apps v1 support in Ash; deprecate | 75 WINDOW_TYPE_V1_PANEL = 1 << 2, // For apps v1 support in Ash; deprecate |
76 // with v1 apps. | 76 // with v1 apps. |
77 }; | 77 }; |
78 | 78 |
79 enum Frame { | 79 enum Frame { |
80 FRAME_CHROME, // Chrome-style window frame. | 80 FRAME_CHROME, // Chrome-style window frame. |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 | 253 |
254 // Load the app's image, firing a load state change when loaded. | 254 // Load the app's image, firing a load state change when loaded. |
255 void UpdateExtensionAppIcon(); | 255 void UpdateExtensionAppIcon(); |
256 | 256 |
257 void OnImageLoaded(const gfx::Image& image); | 257 void OnImageLoaded(const gfx::Image& image); |
258 | 258 |
259 // extensions::ExtensionKeybindingRegistry::Delegate implementation. | 259 // extensions::ExtensionKeybindingRegistry::Delegate implementation. |
260 virtual extensions::ActiveTabPermissionGranter* | 260 virtual extensions::ActiveTabPermissionGranter* |
261 GetActiveTabPermissionGranter() OVERRIDE; | 261 GetActiveTabPermissionGranter() OVERRIDE; |
262 | 262 |
263 // WebContentsModalDialogManagerDelegate implementation. | 263 // web_modal::WebContentsModalDialogManagerDelegate implementation. |
264 virtual void SetWebContentsBlocked(content::WebContents* web_contents, | 264 virtual web_modal::WebContentsModalDialogHost* |
265 bool blocked) OVERRIDE; | 265 GetWebContentsModalDialogHost() OVERRIDE; |
266 | |
267 virtual WebContentsModalDialogHost* GetWebContentsModalDialogHost() OVERRIDE; | |
268 | 266 |
269 // Callback from web_contents()->DownloadFavicon. | 267 // Callback from web_contents()->DownloadFavicon. |
270 void DidDownloadFavicon(int id, | 268 void DidDownloadFavicon(int id, |
271 int http_status_code, | 269 int http_status_code, |
272 const GURL& image_url, | 270 const GURL& image_url, |
273 int requested_size, | 271 int requested_size, |
274 const std::vector<SkBitmap>& bitmaps); | 272 const std::vector<SkBitmap>& bitmaps); |
275 | 273 |
276 Profile* profile_; // weak pointer - owned by ProfileManager. | 274 Profile* profile_; // weak pointer - owned by ProfileManager. |
277 // weak pointer - owned by ExtensionService. | 275 // weak pointer - owned by ExtensionService. |
(...skipping 21 matching lines...) Expand all Loading... |
299 | 297 |
300 // Fullscreen entered by app.window api. | 298 // Fullscreen entered by app.window api. |
301 bool fullscreen_for_window_api_; | 299 bool fullscreen_for_window_api_; |
302 // Fullscreen entered by HTML requestFullscreen. | 300 // Fullscreen entered by HTML requestFullscreen. |
303 bool fullscreen_for_tab_; | 301 bool fullscreen_for_tab_; |
304 | 302 |
305 DISALLOW_COPY_AND_ASSIGN(ShellWindow); | 303 DISALLOW_COPY_AND_ASSIGN(ShellWindow); |
306 }; | 304 }; |
307 | 305 |
308 #endif // CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ | 306 #endif // CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ |
OLD | NEW |