| 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_VIEWS_FRAME_NATIVE_BROWSER_FRAME_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_NATIVE_BROWSER_FRAME_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_NATIVE_BROWSER_FRAME_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_NATIVE_BROWSER_FRAME_H_ |
| 7 | 7 |
| 8 #include "ui/base/ui_base_types.h" | 8 #include "ui/base/ui_base_types.h" |
| 9 #include "ui/gfx/geometry/rect.h" | 9 #include "ui/gfx/geometry/rect.h" |
| 10 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
| 11 | 11 |
| 12 class BrowserFrame; | 12 class BrowserFrame; |
| 13 class BrowserView; | 13 class BrowserView; |
| 14 | 14 |
| 15 namespace content { |
| 16 struct NativeWebKeyboardEvent; |
| 17 } |
| 18 |
| 15 namespace views { | 19 namespace views { |
| 16 class NativeWidget; | 20 class NativeWidget; |
| 17 } | 21 } |
| 18 | 22 |
| 19 class NativeBrowserFrame { | 23 class NativeBrowserFrame { |
| 20 public: | 24 public: |
| 21 virtual ~NativeBrowserFrame() {} | 25 virtual ~NativeBrowserFrame() {} |
| 22 | 26 |
| 23 // Returns the platform specific InitParams for initializing our widget. | 27 // Returns the platform specific InitParams for initializing our widget. |
| 24 virtual views::Widget::InitParams GetWidgetParams() = 0; | 28 virtual views::Widget::InitParams GetWidgetParams() = 0; |
| 25 | 29 |
| 26 // Returns |true| if we should use the custom frame. | 30 // Returns |true| if we should use the custom frame. |
| 27 virtual bool UseCustomFrame() const = 0; | 31 virtual bool UseCustomFrame() const = 0; |
| 28 | 32 |
| 29 // Returns true if the OS takes care of showing the system menu. Returning | 33 // Returns true if the OS takes care of showing the system menu. Returning |
| 30 // false means BrowserFrame handles showing the system menu. | 34 // false means BrowserFrame handles showing the system menu. |
| 31 virtual bool UsesNativeSystemMenu() const = 0; | 35 virtual bool UsesNativeSystemMenu() const = 0; |
| 32 | 36 |
| 33 // Returns true when the window placement should be stored. | 37 // Returns true when the window placement should be stored. |
| 34 virtual bool ShouldSaveWindowPlacement() const = 0; | 38 virtual bool ShouldSaveWindowPlacement() const = 0; |
| 35 | 39 |
| 36 // Retrieves the window placement (show state and bounds) for restoring. | 40 // Retrieves the window placement (show state and bounds) for restoring. |
| 37 virtual void GetWindowPlacement(gfx::Rect* bounds, | 41 virtual void GetWindowPlacement(gfx::Rect* bounds, |
| 38 ui::WindowShowState* show_state) const = 0; | 42 ui::WindowShowState* show_state) const = 0; |
| 39 | 43 |
| 44 // Returns true if the |event| was handled by the platform implementation. |
| 45 virtual bool PreHandleKeyboardEvent( |
| 46 const content::NativeWebKeyboardEvent& event) = 0; |
| 47 |
| 48 // Returns true if the |event| was handled by the platform implementation. |
| 49 virtual bool HandleKeyboardEvent( |
| 50 const content::NativeWebKeyboardEvent& event) = 0; |
| 51 |
| 40 protected: | 52 protected: |
| 41 friend class BrowserFrame; | 53 friend class BrowserFrame; |
| 42 | 54 |
| 43 // BrowserFrame pass-thrus --------------------------------------------------- | 55 // BrowserFrame pass-thrus --------------------------------------------------- |
| 44 // See browser_frame.h for documentation: | 56 // See browser_frame.h for documentation: |
| 45 virtual int GetMinimizeButtonOffset() const = 0; | 57 virtual int GetMinimizeButtonOffset() const = 0; |
| 46 }; | 58 }; |
| 47 | 59 |
| 48 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_NATIVE_BROWSER_FRAME_H_ | 60 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_NATIVE_BROWSER_FRAME_H_ |
| OLD | NEW |