| 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_BROWSER_FRAME_WIN_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_WIN_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_WIN_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_WIN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "chrome/browser/ui/views/frame/browser_frame.h" | 11 #include "chrome/browser/ui/views/frame/browser_frame.h" |
| 12 #include "chrome/browser/ui/views/frame/native_browser_frame.h" | 12 #include "chrome/browser/ui/views/frame/native_browser_frame.h" |
| 13 #include "ui/views/controls/button/image_button.h" |
| 13 #include "ui/views/widget/native_widget_win.h" | 14 #include "ui/views/widget/native_widget_win.h" |
| 14 | 15 |
| 15 class BrowserView; | 16 class BrowserView; |
| 16 class EncodingMenuModel; | 17 class EncodingMenuModel; |
| 17 class SystemMenuModel; | 18 class SystemMenuModel; |
| 18 class SystemMenuModelDelegate; | 19 class SystemMenuModelDelegate; |
| 19 class ZoomMenuModel; | 20 class ZoomMenuModel; |
| 20 | 21 |
| 21 namespace views { | 22 namespace views { |
| 22 class NativeMenuWin; | 23 class NativeMenuWin; |
| 23 } | 24 } |
| 24 | 25 |
| 25 //////////////////////////////////////////////////////////////////////////////// | 26 //////////////////////////////////////////////////////////////////////////////// |
| 26 // BrowserFrameWin | 27 // BrowserFrameWin |
| 27 // | 28 // |
| 28 // BrowserFrameWin is a NativeWidgetWin subclass that provides the window frame | 29 // BrowserFrameWin is a NativeWidgetWin subclass that provides the window frame |
| 29 // for the Chrome browser window. | 30 // for the Chrome browser window. |
| 30 // | 31 // |
| 31 class BrowserFrameWin : public views::NativeWidgetWin, | 32 class BrowserFrameWin : public views::NativeWidgetWin, |
| 32 public NativeBrowserFrame { | 33 public NativeBrowserFrame, |
| 34 public views::ButtonListener { |
| 33 public: | 35 public: |
| 34 BrowserFrameWin(BrowserFrame* browser_frame, BrowserView* browser_view); | 36 BrowserFrameWin(BrowserFrame* browser_frame, BrowserView* browser_view); |
| 35 virtual ~BrowserFrameWin(); | 37 virtual ~BrowserFrameWin(); |
| 36 | 38 |
| 37 BrowserView* browser_view() const { return browser_view_; } | 39 BrowserView* browser_view() const { return browser_view_; } |
| 38 | 40 |
| 39 // Explicitly sets how windows are shown. Use a value of -1 to give the | 41 // Explicitly sets how windows are shown. Use a value of -1 to give the |
| 40 // default behavior. This is used during testing and not generally useful | 42 // default behavior. This is used during testing and not generally useful |
| 41 // otherwise. | 43 // otherwise. |
| 42 static void SetShowState(int state); | 44 static void SetShowState(int state); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 59 virtual void ShowWithWindowState(ui::WindowShowState show_state) OVERRIDE; | 61 virtual void ShowWithWindowState(ui::WindowShowState show_state) OVERRIDE; |
| 60 virtual void Close() OVERRIDE; | 62 virtual void Close() OVERRIDE; |
| 61 | 63 |
| 62 // Overridden from NativeBrowserFrame: | 64 // Overridden from NativeBrowserFrame: |
| 63 virtual views::NativeWidget* AsNativeWidget() OVERRIDE; | 65 virtual views::NativeWidget* AsNativeWidget() OVERRIDE; |
| 64 virtual const views::NativeWidget* AsNativeWidget() const OVERRIDE; | 66 virtual const views::NativeWidget* AsNativeWidget() const OVERRIDE; |
| 65 virtual void InitSystemContextMenu() OVERRIDE; | 67 virtual void InitSystemContextMenu() OVERRIDE; |
| 66 virtual int GetMinimizeButtonOffset() const OVERRIDE; | 68 virtual int GetMinimizeButtonOffset() const OVERRIDE; |
| 67 virtual void TabStripDisplayModeChanged() OVERRIDE; | 69 virtual void TabStripDisplayModeChanged() OVERRIDE; |
| 68 | 70 |
| 71 // Overriden from views::ImageButton override: |
| 72 virtual void ButtonPressed(views::Button* sender, |
| 73 const views::Event& event) OVERRIDE; |
| 74 |
| 69 // Overridden from WindowImpl: | 75 // Overridden from WindowImpl: |
| 70 virtual LRESULT OnWndProc(UINT message, | 76 virtual LRESULT OnWndProc(UINT message, |
| 71 WPARAM w_param, | 77 WPARAM w_param, |
| 72 LPARAM l_param) OVERRIDE; | 78 LPARAM l_param) OVERRIDE; |
| 73 | 79 |
| 74 private: | 80 private: |
| 75 // Updates the DWM with the frame bounds. | 81 // Updates the DWM with the frame bounds. |
| 76 void UpdateDWMFrame(); | 82 void UpdateDWMFrame(); |
| 77 | 83 |
| 78 // Builds the correct menu for when we have minimal chrome. | 84 // Builds the correct menu for when we have minimal chrome. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 105 scoped_ptr<SystemMenuModel> system_menu_contents_; | 111 scoped_ptr<SystemMenuModel> system_menu_contents_; |
| 106 scoped_ptr<ZoomMenuModel> zoom_menu_contents_; | 112 scoped_ptr<ZoomMenuModel> zoom_menu_contents_; |
| 107 scoped_ptr<EncodingMenuModel> encoding_menu_contents_; | 113 scoped_ptr<EncodingMenuModel> encoding_menu_contents_; |
| 108 // The wrapped system menu itself. | 114 // The wrapped system menu itself. |
| 109 scoped_ptr<views::NativeMenuWin> system_menu_; | 115 scoped_ptr<views::NativeMenuWin> system_menu_; |
| 110 | 116 |
| 111 DISALLOW_COPY_AND_ASSIGN(BrowserFrameWin); | 117 DISALLOW_COPY_AND_ASSIGN(BrowserFrameWin); |
| 112 }; | 118 }; |
| 113 | 119 |
| 114 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_WIN_H_ | 120 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_WIN_H_ |
| OLD | NEW |