| 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_OPAQUE_BROWSER_FRAME_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "chrome/browser/ui/view_ids.h" | 9 #include "chrome/browser/ui/view_ids.h" |
| 10 #include "chrome/browser/ui/views/frame/browser_frame.h" | 10 #include "chrome/browser/ui/views/frame/browser_frame.h" |
| 11 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" | 11 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" |
| 12 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view_layout_delegat
e.h" | 12 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view_layout_delegat
e.h" |
| 13 #include "chrome/browser/ui/views/tab_icon_view_model.h" | 13 #include "chrome/browser/ui/views/tab_icon_view_model.h" |
| 14 #include "content/public/browser/notification_observer.h" | |
| 15 #include "content/public/browser/notification_registrar.h" | |
| 16 #include "ui/views/controls/button/button.h" | 14 #include "ui/views/controls/button/button.h" |
| 17 #include "ui/views/controls/button/menu_button_listener.h" | 15 #include "ui/views/controls/button/menu_button_listener.h" |
| 18 #include "ui/views/window/non_client_view.h" | 16 #include "ui/views/window/non_client_view.h" |
| 19 | 17 |
| 20 class BrowserView; | 18 class BrowserView; |
| 21 class OpaqueBrowserFrameViewLayout; | 19 class OpaqueBrowserFrameViewLayout; |
| 22 class OpaqueBrowserFrameViewPlatformSpecific; | 20 class OpaqueBrowserFrameViewPlatformSpecific; |
| 23 class TabIconView; | 21 class TabIconView; |
| 24 class NewAvatarButton; | 22 class NewAvatarButton; |
| 25 | 23 |
| 26 namespace views { | 24 namespace views { |
| 27 class ImageButton; | 25 class ImageButton; |
| 28 class FrameBackground; | 26 class FrameBackground; |
| 29 class Label; | 27 class Label; |
| 30 } | 28 } |
| 31 | 29 |
| 32 class OpaqueBrowserFrameView : public BrowserNonClientFrameView, | 30 class OpaqueBrowserFrameView : public BrowserNonClientFrameView, |
| 33 public content::NotificationObserver, | |
| 34 public views::ButtonListener, | 31 public views::ButtonListener, |
| 35 public views::MenuButtonListener, | 32 public views::MenuButtonListener, |
| 36 public chrome::TabIconViewModel, | 33 public chrome::TabIconViewModel, |
| 37 public OpaqueBrowserFrameViewLayoutDelegate { | 34 public OpaqueBrowserFrameViewLayoutDelegate { |
| 38 public: | 35 public: |
| 39 // Constructs a non-client view for an BrowserFrame. | 36 // Constructs a non-client view for an BrowserFrame. |
| 40 OpaqueBrowserFrameView(BrowserFrame* frame, BrowserView* browser_view); | 37 OpaqueBrowserFrameView(BrowserFrame* frame, BrowserView* browser_view); |
| 41 ~OpaqueBrowserFrameView() override; | 38 ~OpaqueBrowserFrameView() override; |
| 42 | 39 |
| 43 // BrowserNonClientFrameView: | 40 // BrowserNonClientFrameView: |
| 44 gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const override; | 41 gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const override; |
| 45 int GetTopInset() const override; | 42 int GetTopInset() const override; |
| 46 int GetThemeBackgroundXInset() const override; | 43 int GetThemeBackgroundXInset() const override; |
| 47 void UpdateThrobber(bool running) override; | 44 void UpdateThrobber(bool running) override; |
| 48 gfx::Size GetMinimumSize() const override; | 45 gfx::Size GetMinimumSize() const override; |
| 46 void UpdateNewStyleAvatar() override; |
| 49 | 47 |
| 50 // views::NonClientFrameView: | 48 // views::NonClientFrameView: |
| 51 gfx::Rect GetBoundsForClientView() const override; | 49 gfx::Rect GetBoundsForClientView() const override; |
| 52 gfx::Rect GetWindowBoundsForClientBounds( | 50 gfx::Rect GetWindowBoundsForClientBounds( |
| 53 const gfx::Rect& client_bounds) const override; | 51 const gfx::Rect& client_bounds) const override; |
| 54 int NonClientHitTest(const gfx::Point& point) override; | 52 int NonClientHitTest(const gfx::Point& point) override; |
| 55 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override; | 53 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override; |
| 56 void ResetWindowControls() override; | 54 void ResetWindowControls() override; |
| 57 void UpdateWindowIcon() override; | 55 void UpdateWindowIcon() override; |
| 58 void UpdateWindowTitle() override; | 56 void UpdateWindowTitle() override; |
| 59 void SizeConstraintsChanged() override; | 57 void SizeConstraintsChanged() override; |
| 60 | 58 |
| 61 // views::View: | 59 // views::View: |
| 62 void GetAccessibleState(ui::AXViewState* state) override; | 60 void GetAccessibleState(ui::AXViewState* state) override; |
| 63 | 61 |
| 64 // views::ButtonListener: | 62 // views::ButtonListener: |
| 65 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | 63 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
| 66 | 64 |
| 67 // views::MenuButtonListener: | 65 // views::MenuButtonListener: |
| 68 void OnMenuButtonClicked(views::View* source, | 66 void OnMenuButtonClicked(views::View* source, |
| 69 const gfx::Point& point) override; | 67 const gfx::Point& point) override; |
| 70 | 68 |
| 71 // chrome::TabIconViewModel: | 69 // chrome::TabIconViewModel: |
| 72 bool ShouldTabIconViewAnimate() const override; | 70 bool ShouldTabIconViewAnimate() const override; |
| 73 gfx::ImageSkia GetFaviconForTabIconView() override; | 71 gfx::ImageSkia GetFaviconForTabIconView() override; |
| 74 | 72 |
| 75 // content::NotificationObserver implementation: | |
| 76 void Observe(int type, | |
| 77 const content::NotificationSource& source, | |
| 78 const content::NotificationDetails& details) override; | |
| 79 | |
| 80 // OpaqueBrowserFrameViewLayoutDelegate implementation: | 73 // OpaqueBrowserFrameViewLayoutDelegate implementation: |
| 81 bool ShouldShowWindowIcon() const override; | 74 bool ShouldShowWindowIcon() const override; |
| 82 bool ShouldShowWindowTitle() const override; | 75 bool ShouldShowWindowTitle() const override; |
| 83 base::string16 GetWindowTitle() const override; | 76 base::string16 GetWindowTitle() const override; |
| 84 int GetIconSize() const override; | 77 int GetIconSize() const override; |
| 85 bool ShouldLeaveOffsetNearTopBorder() const override; | 78 bool ShouldLeaveOffsetNearTopBorder() const override; |
| 86 gfx::Size GetBrowserViewMinimumSize() const override; | 79 gfx::Size GetBrowserViewMinimumSize() const override; |
| 87 bool ShouldShowCaptionButtons() const override; | 80 bool ShouldShowCaptionButtons() const override; |
| 88 bool ShouldShowAvatar() const override; | 81 bool ShouldShowAvatar() const override; |
| 89 bool IsRegularOrGuestSession() const override; | 82 bool IsRegularOrGuestSession() const override; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 // Window controls. | 157 // Window controls. |
| 165 views::ImageButton* minimize_button_; | 158 views::ImageButton* minimize_button_; |
| 166 views::ImageButton* maximize_button_; | 159 views::ImageButton* maximize_button_; |
| 167 views::ImageButton* restore_button_; | 160 views::ImageButton* restore_button_; |
| 168 views::ImageButton* close_button_; | 161 views::ImageButton* close_button_; |
| 169 | 162 |
| 170 // The window icon and title. | 163 // The window icon and title. |
| 171 TabIconView* window_icon_; | 164 TabIconView* window_icon_; |
| 172 views::Label* window_title_; | 165 views::Label* window_title_; |
| 173 | 166 |
| 174 content::NotificationRegistrar registrar_; | |
| 175 | |
| 176 // Background painter for the window frame. | 167 // Background painter for the window frame. |
| 177 scoped_ptr<views::FrameBackground> frame_background_; | 168 scoped_ptr<views::FrameBackground> frame_background_; |
| 178 | 169 |
| 179 // Observer that handles platform dependent configuration. | 170 // Observer that handles platform dependent configuration. |
| 180 scoped_ptr<OpaqueBrowserFrameViewPlatformSpecific> platform_observer_; | 171 scoped_ptr<OpaqueBrowserFrameViewPlatformSpecific> platform_observer_; |
| 181 | 172 |
| 182 DISALLOW_COPY_AND_ASSIGN(OpaqueBrowserFrameView); | 173 DISALLOW_COPY_AND_ASSIGN(OpaqueBrowserFrameView); |
| 183 }; | 174 }; |
| 184 | 175 |
| 185 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_H_ | 176 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_H_ |
| OLD | NEW |