| 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_NATIVE_APP_WINDOW_H_ | 5 #ifndef CHROME_BROWSER_UI_EXTENSIONS_NATIVE_APP_WINDOW_H_ |
| 6 #define CHROME_BROWSER_UI_EXTENSIONS_NATIVE_APP_WINDOW_H_ | 6 #define CHROME_BROWSER_UI_EXTENSIONS_NATIVE_APP_WINDOW_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/ui/base_window.h" | 8 #include "chrome/browser/ui/base_window.h" |
| 9 #include "chrome/browser/ui/extensions/shell_window.h" | 9 #include "chrome/browser/ui/extensions/shell_window.h" |
| 10 #include "chrome/browser/ui/web_contents_modal_dialog_host.h" | 10 #include "chrome/browser/ui/web_contents_modal_dialog_host.h" |
| 11 #include "ui/gfx/insets.h" | 11 #include "ui/gfx/insets.h" |
| 12 | 12 |
| 13 // This is an interface to a native implementation of a shell window, used for | 13 // This is an interface to a native implementation of a shell window, used for |
| 14 // new-style packaged apps. Shell windows contain a web contents, but no tabs | 14 // new-style packaged apps. Shell windows contain a web contents, but no tabs |
| 15 // or URL bar. | 15 // or URL bar. |
| 16 class NativeAppWindow : public BaseWindow, public WebContentsModalDialogHost { | 16 class NativeAppWindow : public BaseWindow, public WebContentsModalDialogHost { |
| 17 public: | 17 public: |
| 18 // Used by ShellWindow to instantiate the platform-specific ShellWindow code. | 18 // Used by ShellWindow to instantiate the platform-specific ShellWindow code. |
| 19 static NativeAppWindow* Create(ShellWindow* window, | 19 static NativeAppWindow* Create(ShellWindow* window, |
| 20 const ShellWindow::CreateParams& params); | 20 const ShellWindow::CreateParams& params); |
| 21 | 21 |
| 22 // Called when the draggable regions are changed. | 22 // Called when the draggable regions are changed. |
| 23 virtual void UpdateDraggableRegions( | 23 virtual void UpdateDraggableRegions( |
| 24 const std::vector<extensions::DraggableRegion>& regions) = 0; | 24 const std::vector<extensions::DraggableRegion>& regions) = 0; |
| 25 | 25 |
| 26 virtual void SetFullscreen(bool fullscreen) = 0; | 26 virtual void SetFullscreen(bool fullscreen) = 0; |
| 27 virtual bool IsFullscreenOrPending() const = 0; | 27 virtual bool IsFullscreenOrPending() const = 0; |
| 28 | 28 |
| 29 // Returns true if the window is a panel that has been detached. |
| 30 virtual bool IsDetached() const = 0; |
| 31 |
| 29 // Called when the icon of the window changes. | 32 // Called when the icon of the window changes. |
| 30 virtual void UpdateWindowIcon() = 0; | 33 virtual void UpdateWindowIcon() = 0; |
| 31 | 34 |
| 32 // Called when the title of the window changes. | 35 // Called when the title of the window changes. |
| 33 virtual void UpdateWindowTitle() = 0; | 36 virtual void UpdateWindowTitle() = 0; |
| 34 | 37 |
| 35 // Allows the window to handle unhandled keyboard messages coming back from | 38 // Allows the window to handle unhandled keyboard messages coming back from |
| 36 // the renderer. | 39 // the renderer. |
| 37 virtual void HandleKeyboardEvent( | 40 virtual void HandleKeyboardEvent( |
| 38 const content::NativeWebKeyboardEvent& event) = 0; | 41 const content::NativeWebKeyboardEvent& event) = 0; |
| 39 | 42 |
| 40 // TODO(jianli): once http://crbug.com/123007 is fixed, we'll no longer need | 43 // TODO(jianli): once http://crbug.com/123007 is fixed, we'll no longer need |
| 41 // this. | 44 // this. |
| 42 virtual void RenderViewHostChanged() = 0; | 45 virtual void RenderViewHostChanged() = 0; |
| 43 | 46 |
| 44 // Returns the difference between the window bounds (including titlebar and | 47 // Returns the difference between the window bounds (including titlebar and |
| 45 // borders) and the content bounds, if any. | 48 // borders) and the content bounds, if any. |
| 46 virtual gfx::Insets GetFrameInsets() const = 0; | 49 virtual gfx::Insets GetFrameInsets() const = 0; |
| 47 | 50 |
| 48 virtual ~NativeAppWindow() {} | 51 virtual ~NativeAppWindow() {} |
| 49 }; | 52 }; |
| 50 | 53 |
| 51 #endif // CHROME_BROWSER_UI_EXTENSIONS_NATIVE_APP_WINDOW_H_ | 54 #endif // CHROME_BROWSER_UI_EXTENSIONS_NATIVE_APP_WINDOW_H_ |
| OLD | NEW |