| 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 APPS_UI_NATIVE_APP_WINDOW_H_ |
| 6 #define APPS_UI_NATIVE_APP_WINDOW_H_ | 6 #define APPS_UI_NATIVE_APP_WINDOW_H_ |
| 7 | 7 |
| 8 #include "apps/app_window.h" | 8 #include "apps/app_window.h" |
| 9 #include "components/web_modal/web_contents_modal_dialog_host.h" | 9 #include "components/web_modal/web_contents_modal_dialog_host.h" |
| 10 #include "third_party/skia/include/core/SkColor.h" |
| 10 #include "ui/base/base_window.h" | 11 #include "ui/base/base_window.h" |
| 11 #include "ui/gfx/insets.h" | 12 #include "ui/gfx/insets.h" |
| 12 | 13 |
| 13 namespace apps { | 14 namespace apps { |
| 14 | 15 |
| 15 // This is an interface to a native implementation of a app window, used for | 16 // This is an interface to a native implementation of a app window, used for |
| 16 // new-style packaged apps. App windows contain a web contents, but no tabs | 17 // new-style packaged apps. App windows contain a web contents, but no tabs |
| 17 // or URL bar. | 18 // or URL bar. |
| 18 class NativeAppWindow : public ui::BaseWindow, | 19 class NativeAppWindow : public ui::BaseWindow, |
| 19 public web_modal::WebContentsModalDialogHost { | 20 public web_modal::WebContentsModalDialogHost { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 50 | 51 |
| 51 // Allows the window to handle unhandled keyboard messages coming back from | 52 // Allows the window to handle unhandled keyboard messages coming back from |
| 52 // the renderer. | 53 // the renderer. |
| 53 virtual void HandleKeyboardEvent( | 54 virtual void HandleKeyboardEvent( |
| 54 const content::NativeWebKeyboardEvent& event) = 0; | 55 const content::NativeWebKeyboardEvent& event) = 0; |
| 55 | 56 |
| 56 // Returns true if the window has no frame, as for a window opened by | 57 // Returns true if the window has no frame, as for a window opened by |
| 57 // chrome.app.window.create with the option 'frame' set to 'none'. | 58 // chrome.app.window.create with the option 'frame' set to 'none'. |
| 58 virtual bool IsFrameless() const = 0; | 59 virtual bool IsFrameless() const = 0; |
| 59 | 60 |
| 61 // Returns information about the window's frame. |
| 62 virtual bool HasFrameColor() const = 0; |
| 63 virtual SkColor FrameColor() const = 0; |
| 64 |
| 60 // Returns the difference between the window bounds (including titlebar and | 65 // Returns the difference between the window bounds (including titlebar and |
| 61 // borders) and the content bounds, if any. | 66 // borders) and the content bounds, if any. |
| 62 virtual gfx::Insets GetFrameInsets() const = 0; | 67 virtual gfx::Insets GetFrameInsets() const = 0; |
| 63 | 68 |
| 64 // Hide or show this window as part of hiding or showing the app. | 69 // Hide or show this window as part of hiding or showing the app. |
| 65 // This may have different logic to Hide, Show, and ShowInactive as those are | 70 // This may have different logic to Hide, Show, and ShowInactive as those are |
| 66 // called via the AppWindow javascript API. | 71 // called via the AppWindow javascript API. |
| 67 virtual void ShowWithApp() = 0; | 72 virtual void ShowWithApp() = 0; |
| 68 virtual void HideWithApp() = 0; | 73 virtual void HideWithApp() = 0; |
| 69 | 74 |
| 70 // Updates the minimum and maximum size of the native window with the current | 75 // Updates the minimum and maximum size of the native window with the current |
| 71 // size constraints. | 76 // size constraints. |
| 72 virtual void UpdateWindowMinMaxSize() = 0; | 77 virtual void UpdateWindowMinMaxSize() = 0; |
| 73 | 78 |
| 74 virtual ~NativeAppWindow() {} | 79 virtual ~NativeAppWindow() {} |
| 75 }; | 80 }; |
| 76 | 81 |
| 77 } // namespace apps | 82 } // namespace apps |
| 78 | 83 |
| 79 #endif // APPS_UI_NATIVE_APP_WINDOW_H_ | 84 #endif // APPS_UI_NATIVE_APP_WINDOW_H_ |
| OLD | NEW |