| 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_GLASS_BROWSER_FRAME_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/win/scoped_gdi_object.h" | 10 #include "base/win/scoped_gdi_object.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 "ui/views/controls/button/button.h" | |
| 13 #include "ui/views/window/non_client_view.h" | 12 #include "ui/views/window/non_client_view.h" |
| 14 | 13 |
| 15 class BrowserView; | 14 class BrowserView; |
| 16 | 15 |
| 17 class GlassBrowserFrameView : public BrowserNonClientFrameView, | 16 class GlassBrowserFrameView : public BrowserNonClientFrameView { |
| 18 public views::ButtonListener { | |
| 19 public: | 17 public: |
| 20 // Constructs a non-client view for an BrowserFrame. | 18 // Constructs a non-client view for an BrowserFrame. |
| 21 GlassBrowserFrameView(BrowserFrame* frame, BrowserView* browser_view); | 19 GlassBrowserFrameView(BrowserFrame* frame, BrowserView* browser_view); |
| 22 ~GlassBrowserFrameView() override; | 20 ~GlassBrowserFrameView() override; |
| 23 | 21 |
| 24 // BrowserNonClientFrameView: | 22 // BrowserNonClientFrameView: |
| 25 gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const override; | 23 gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const override; |
| 26 int GetTopInset(bool restored) const override; | 24 int GetTopInset(bool restored) const override; |
| 27 int GetThemeBackgroundXInset() const override; | 25 int GetThemeBackgroundXInset() const override; |
| 28 void UpdateThrobber(bool running) override; | 26 void UpdateThrobber(bool running) override; |
| 29 gfx::Size GetMinimumSize() const override; | 27 gfx::Size GetMinimumSize() const override; |
| 30 | 28 |
| 31 // views::NonClientFrameView: | 29 // views::NonClientFrameView: |
| 32 gfx::Rect GetBoundsForClientView() const override; | 30 gfx::Rect GetBoundsForClientView() const override; |
| 33 gfx::Rect GetWindowBoundsForClientBounds( | 31 gfx::Rect GetWindowBoundsForClientBounds( |
| 34 const gfx::Rect& client_bounds) const override; | 32 const gfx::Rect& client_bounds) const override; |
| 35 int NonClientHitTest(const gfx::Point& point) override; | 33 int NonClientHitTest(const gfx::Point& point) override; |
| 36 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override {} | 34 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override {} |
| 37 void ResetWindowControls() override {} | 35 void ResetWindowControls() override {} |
| 38 void UpdateWindowIcon() override {} | 36 void UpdateWindowIcon() override {} |
| 39 void UpdateWindowTitle() override {} | 37 void UpdateWindowTitle() override {} |
| 40 void SizeConstraintsChanged() override {} | 38 void SizeConstraintsChanged() override {} |
| 41 | 39 |
| 42 protected: | 40 protected: |
| 43 // views::View: | 41 // views::View: |
| 44 void OnPaint(gfx::Canvas* canvas) override; | 42 void OnPaint(gfx::Canvas* canvas) override; |
| 45 void Layout() override; | 43 void Layout() override; |
| 46 | 44 |
| 47 // views::ButtonListener: | |
| 48 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | |
| 49 | |
| 50 // BrowserNonClientFrameView: | 45 // BrowserNonClientFrameView: |
| 51 void UpdateNewAvatarButtonImpl() override; | 46 void UpdateNewAvatarButtonImpl() override; |
| 52 | 47 |
| 53 private: | 48 private: |
| 54 // views::NonClientFrameView: | 49 // views::NonClientFrameView: |
| 55 bool DoesIntersectRect(const views::View* target, | 50 bool DoesIntersectRect(const views::View* target, |
| 56 const gfx::Rect& rect) const override; | 51 const gfx::Rect& rect) const override; |
| 57 | 52 |
| 58 // Returns the thickness of the border that makes up the window left, right, | 53 // Returns the thickness of the border that makes up the window left, right, |
| 59 // and bottom frame edges. This does not include any client edge. | 54 // and bottom frame edges. This does not include any client edge. |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 int throbber_frame_; | 116 int throbber_frame_; |
| 122 | 117 |
| 123 static const int kThrobberIconCount = 24; | 118 static const int kThrobberIconCount = 24; |
| 124 static HICON throbber_icons_[kThrobberIconCount]; | 119 static HICON throbber_icons_[kThrobberIconCount]; |
| 125 static void InitThrobberIcons(); | 120 static void InitThrobberIcons(); |
| 126 | 121 |
| 127 DISALLOW_COPY_AND_ASSIGN(GlassBrowserFrameView); | 122 DISALLOW_COPY_AND_ASSIGN(GlassBrowserFrameView); |
| 128 }; | 123 }; |
| 129 | 124 |
| 130 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_ | 125 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_ |
| OLD | NEW |