| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 APPS_UI_NATIVE_APP_WINDOW_H_ | 5 #ifndef EXTENSIONS_BROWSER_APP_WINDOW_NATIVE_APP_WINDOW_H_ |
| 6 #define APPS_UI_NATIVE_APP_WINDOW_H_ | 6 #define EXTENSIONS_BROWSER_APP_WINDOW_NATIVE_APP_WINDOW_H_ |
| 7 | 7 |
| 8 #include "apps/app_window.h" | 8 #include <vector> |
| 9 |
| 10 #include "base/memory/scoped_ptr.h" |
| 9 #include "components/web_modal/web_contents_modal_dialog_host.h" | 11 #include "components/web_modal/web_contents_modal_dialog_host.h" |
| 10 #include "third_party/skia/include/core/SkColor.h" | 12 #include "third_party/skia/include/core/SkColor.h" |
| 11 #include "ui/base/base_window.h" | 13 #include "ui/base/base_window.h" |
| 12 #include "ui/gfx/insets.h" | 14 #include "ui/gfx/insets.h" |
| 13 | 15 |
| 14 namespace apps { | 16 namespace content { |
| 17 struct NativeWebKeyboardEvent; |
| 18 } |
| 19 |
| 20 namespace extensions { |
| 21 |
| 22 struct DraggableRegion; |
| 15 | 23 |
| 16 // This is an interface to a native implementation of a app window, used for | 24 // This is an interface to a native implementation of a app window, used for |
| 17 // new-style packaged apps. App windows contain a web contents, but no tabs | 25 // new-style packaged apps. App windows contain a web contents, but no tabs |
| 18 // or URL bar. | 26 // or URL bar. |
| 19 class NativeAppWindow : public ui::BaseWindow, | 27 class NativeAppWindow : public ui::BaseWindow, |
| 20 public web_modal::WebContentsModalDialogHost { | 28 public web_modal::WebContentsModalDialogHost { |
| 21 public: | 29 public: |
| 22 // Sets whether the window is fullscreen and the type of fullscreen. | 30 // Sets whether the window is fullscreen and the type of fullscreen. |
| 23 // |fullscreen_types| is a bit field of AppWindow::FullscreenType. | 31 // |fullscreen_types| is a bit field of AppWindow::FullscreenType. |
| 24 virtual void SetFullscreen(int fullscreen_types) = 0; | 32 virtual void SetFullscreen(int fullscreen_types) = 0; |
| 25 | 33 |
| 26 // Returns whether the window is fullscreen or about to enter fullscreen. | 34 // Returns whether the window is fullscreen or about to enter fullscreen. |
| 27 virtual bool IsFullscreenOrPending() const = 0; | 35 virtual bool IsFullscreenOrPending() const = 0; |
| 28 | 36 |
| 29 // Returns true if the window is a panel that has been detached. | 37 // Returns true if the window is a panel that has been detached. |
| 30 virtual bool IsDetached() const = 0; | 38 virtual bool IsDetached() const = 0; |
| 31 | 39 |
| 32 // Called when the icon of the window changes. | 40 // Called when the icon of the window changes. |
| 33 virtual void UpdateWindowIcon() = 0; | 41 virtual void UpdateWindowIcon() = 0; |
| 34 | 42 |
| 35 // Called when the title of the window changes. | 43 // Called when the title of the window changes. |
| 36 virtual void UpdateWindowTitle() = 0; | 44 virtual void UpdateWindowTitle() = 0; |
| 37 | 45 |
| 38 // Called to update the badge icon. | 46 // Called to update the badge icon. |
| 39 virtual void UpdateBadgeIcon() = 0; | 47 virtual void UpdateBadgeIcon() = 0; |
| 40 | 48 |
| 41 // Called when the draggable regions are changed. | 49 // Called when the draggable regions are changed. |
| 42 virtual void UpdateDraggableRegions( | 50 virtual void UpdateDraggableRegions( |
| 43 const std::vector<extensions::DraggableRegion>& regions) = 0; | 51 const std::vector<DraggableRegion>& regions) = 0; |
| 44 | 52 |
| 45 // Returns the region used by frameless windows for dragging. May return NULL. | 53 // Returns the region used by frameless windows for dragging. May return NULL. |
| 46 virtual SkRegion* GetDraggableRegion() = 0; | 54 virtual SkRegion* GetDraggableRegion() = 0; |
| 47 | 55 |
| 48 // Called when the window shape is changed. If |region| is NULL then the | 56 // Called when the window shape is changed. If |region| is NULL then the |
| 49 // window is restored to the default shape. | 57 // window is restored to the default shape. |
| 50 virtual void UpdateShape(scoped_ptr<SkRegion> region) = 0; | 58 virtual void UpdateShape(scoped_ptr<SkRegion> region) = 0; |
| 51 | 59 |
| 52 // Allows the window to handle unhandled keyboard messages coming back from | 60 // Allows the window to handle unhandled keyboard messages coming back from |
| 53 // the renderer. | 61 // the renderer. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 virtual void SetContentSizeConstraints(const gfx::Size& min_size, | 95 virtual void SetContentSizeConstraints(const gfx::Size& min_size, |
| 88 const gfx::Size& max_size) = 0; | 96 const gfx::Size& max_size) = 0; |
| 89 | 97 |
| 90 // Returns false if the underlying native window ignores alpha transparency | 98 // Returns false if the underlying native window ignores alpha transparency |
| 91 // when compositing. | 99 // when compositing. |
| 92 virtual bool CanHaveAlphaEnabled() const = 0; | 100 virtual bool CanHaveAlphaEnabled() const = 0; |
| 93 | 101 |
| 94 virtual ~NativeAppWindow() {} | 102 virtual ~NativeAppWindow() {} |
| 95 }; | 103 }; |
| 96 | 104 |
| 97 } // namespace apps | 105 } // namespace extensions |
| 98 | 106 |
| 99 #endif // APPS_UI_NATIVE_APP_WINDOW_H_ | 107 #endif // EXTENSIONS_BROWSER_APP_WINDOW_NATIVE_APP_WINDOW_H_ |
| OLD | NEW |