Chromium Code Reviews| 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 "chrome/browser/extensions/extension_function_dispatcher.h" | 9 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
| 10 #include "chrome/browser/sessions/session_id.h" | 10 #include "chrome/browser/sessions/session_id.h" |
| 11 #include "chrome/browser/ui/base_window.h" | 11 #include "chrome/browser/ui/base_window.h" |
| 12 #include "content/public/browser/notification_observer.h" | 12 #include "content/public/browser/notification_observer.h" |
| 13 #include "content/public/browser/notification_registrar.h" | 13 #include "content/public/browser/notification_registrar.h" |
| 14 #include "content/public/browser/web_contents_delegate.h" | 14 #include "content/public/browser/web_contents_delegate.h" |
| 15 #include "content/public/browser/web_contents_observer.h" | 15 #include "content/public/browser/web_contents_observer.h" |
| 16 #include "content/public/common/console_message_level.h" | 16 #include "content/public/common/console_message_level.h" |
| 17 #include "ui/gfx/rect.h" | 17 #include "ui/gfx/rect.h" |
| 18 | 18 |
| 19 class GURL; | 19 class GURL; |
| 20 class Profile; | 20 class Profile; |
| 21 class TabContents; | 21 class TabContents; |
| 22 | 22 |
| 23 namespace content { | 23 namespace content { |
| 24 class WebContents; | 24 class WebContents; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace extensions { | 27 namespace extensions { |
| 28 class Extension; | 28 class Extension; |
| 29 class WindowController; | 29 class WindowController; |
| 30 struct DraggableRegion; | |
|
Ben Goodger (Google)
2012/08/07 20:45:27
Is there an apps namespace that this can go into?
jianli
2012/08/07 20:48:15
Unfortunately there is not an apps or related name
| |
| 30 } | 31 } |
| 31 | 32 |
| 32 // ShellWindow is the type of window used by platform apps. Shell windows | 33 // ShellWindow is the type of window used by platform apps. Shell windows |
| 33 // have a WebContents but none of the chrome of normal browser windows. | 34 // have a WebContents but none of the chrome of normal browser windows. |
| 34 class ShellWindow : public content::NotificationObserver, | 35 class ShellWindow : public content::NotificationObserver, |
| 35 public content::WebContentsDelegate, | 36 public content::WebContentsDelegate, |
| 36 public content::WebContentsObserver, | 37 public content::WebContentsObserver, |
| 37 public ExtensionFunctionDispatcher::Delegate, | 38 public ExtensionFunctionDispatcher::Delegate, |
| 38 public BaseWindow { | 39 public BaseWindow { |
| 39 public: | 40 public: |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 | 72 |
| 72 // Called when the title of the window changes. | 73 // Called when the title of the window changes. |
| 73 virtual void UpdateWindowTitle() {} | 74 virtual void UpdateWindowTitle() {} |
| 74 // Sub-classes should call this to determine what the window's title is on | 75 // Sub-classes should call this to determine what the window's title is on |
| 75 // startup and from within UpdateWindowTitle(). | 76 // startup and from within UpdateWindowTitle(). |
| 76 virtual string16 GetTitle() const; | 77 virtual string16 GetTitle() const; |
| 77 | 78 |
| 78 virtual void SetFullscreen(bool fullscreen) {} | 79 virtual void SetFullscreen(bool fullscreen) {} |
| 79 virtual bool IsFullscreenOrPending() const; | 80 virtual bool IsFullscreenOrPending() const; |
| 80 | 81 |
| 82 // Called when the draggable regions are changed. | |
| 83 virtual void UpdateDraggableRegions( | |
| 84 const std::vector<extensions::DraggableRegion>& regions) {} | |
| 85 | |
| 81 // Call to notify ShellRegistry and delete the window. Subclasses should | 86 // Call to notify ShellRegistry and delete the window. Subclasses should |
| 82 // invoke this method instead of using "delete this". | 87 // invoke this method instead of using "delete this". |
| 83 void OnNativeClose(); | 88 void OnNativeClose(); |
| 84 | 89 |
| 85 private: | 90 private: |
| 86 // PlatformAppBrowserTest needs access to web_contents() | 91 // PlatformAppBrowserTest needs access to web_contents() |
| 87 friend class PlatformAppBrowserTest; | 92 friend class PlatformAppBrowserTest; |
| 88 | 93 |
| 89 // Instantiates a platform-specific ShellWindow subclass (one implementation | 94 // Instantiates a platform-specific ShellWindow subclass (one implementation |
| 90 // per platform). Public users of ShellWindow should use ShellWindow::Create. | 95 // per platform). Public users of ShellWindow should use ShellWindow::Create. |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 152 scoped_ptr<TabContents> contents_; | 157 scoped_ptr<TabContents> contents_; |
| 153 // web_contents_ is owned by contents_. | 158 // web_contents_ is owned by contents_. |
| 154 content::WebContents* web_contents_; | 159 content::WebContents* web_contents_; |
| 155 content::NotificationRegistrar registrar_; | 160 content::NotificationRegistrar registrar_; |
| 156 ExtensionFunctionDispatcher extension_function_dispatcher_; | 161 ExtensionFunctionDispatcher extension_function_dispatcher_; |
| 157 | 162 |
| 158 DISALLOW_COPY_AND_ASSIGN(ShellWindow); | 163 DISALLOW_COPY_AND_ASSIGN(ShellWindow); |
| 159 }; | 164 }; |
| 160 | 165 |
| 161 #endif // CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ | 166 #endif // CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_ |
| OLD | NEW |