OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/prefs/pref_member.h" | 10 #include "chrome/browser/prefs/pref_member.h" |
11 #include "chrome/browser/ui/views/frame/browser_frame_win.h" | 11 #include "chrome/browser/ui/views/frame/browser_frame_win.h" |
12 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" | 12 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" |
13 #include "views/controls/button/button.h" | 13 #include "views/controls/button/button.h" |
14 #include "views/controls/menu/view_menu_delegate.h" | |
15 #include "views/window/non_client_view.h" | 14 #include "views/window/non_client_view.h" |
16 | 15 |
17 class BrowserView; | 16 class BrowserView; |
18 class ProfileMenuButton; | 17 class ProfileMenuButton; |
19 class ProfileMenuModel; | 18 class ProfileMenuModel; |
20 class ProfileTagView; | 19 class ProfileTagView; |
21 class SkBitmap; | 20 class SkBitmap; |
22 | 21 |
23 class GlassBrowserFrameView : public BrowserNonClientFrameView, | 22 class GlassBrowserFrameView : public BrowserNonClientFrameView, |
24 public NotificationObserver, | 23 public NotificationObserver { |
25 public views::ViewMenuDelegate { | |
26 public: | 24 public: |
27 // Constructs a non-client view for an BrowserFrame. | 25 // Constructs a non-client view for an BrowserFrame. |
28 GlassBrowserFrameView(BrowserFrame* frame, BrowserView* browser_view); | 26 GlassBrowserFrameView(BrowserFrame* frame, BrowserView* browser_view); |
29 virtual ~GlassBrowserFrameView(); | 27 virtual ~GlassBrowserFrameView(); |
30 | 28 |
31 // Overridden from BrowserNonClientFrameView: | 29 // Overridden from BrowserNonClientFrameView: |
32 virtual gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const OVERRIDE; | 30 virtual gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const OVERRIDE; |
33 virtual int GetHorizontalTabStripVerticalOffset(bool restored) const OVERRIDE; | 31 virtual int GetHorizontalTabStripVerticalOffset(bool restored) const OVERRIDE; |
34 virtual void UpdateThrobber(bool running) OVERRIDE; | 32 virtual void UpdateThrobber(bool running) OVERRIDE; |
35 | 33 |
36 // Overridden from views::NonClientFrameView: | 34 // Overridden from views::NonClientFrameView: |
37 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; | 35 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; |
38 virtual gfx::Rect GetWindowBoundsForClientBounds( | 36 virtual gfx::Rect GetWindowBoundsForClientBounds( |
39 const gfx::Rect& client_bounds) const OVERRIDE; | 37 const gfx::Rect& client_bounds) const OVERRIDE; |
40 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; | 38 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; |
41 virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) | 39 virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) |
42 OVERRIDE { } | 40 OVERRIDE { } |
43 virtual void EnableClose(bool enable) OVERRIDE { } | 41 virtual void EnableClose(bool enable) OVERRIDE { } |
44 virtual void ResetWindowControls() OVERRIDE { } | 42 virtual void ResetWindowControls() OVERRIDE { } |
45 virtual void UpdateWindowIcon() OVERRIDE { } | 43 virtual void UpdateWindowIcon() OVERRIDE { } |
46 | 44 |
47 // views::ViewMenuDelegate implementation: | |
48 virtual void RunMenu(views::View* source, const gfx::Point& pt) OVERRIDE; | |
49 | |
50 protected: | 45 protected: |
51 // Overridden from views::View: | 46 // Overridden from views::View: |
52 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 47 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
53 virtual void Layout() OVERRIDE; | 48 virtual void Layout() OVERRIDE; |
54 virtual bool HitTest(const gfx::Point& l) const OVERRIDE; | 49 virtual bool HitTest(const gfx::Point& l) const OVERRIDE; |
55 | 50 |
56 private: | 51 private: |
57 // Returns the thickness of the border that makes up the window frame edges. | 52 // Returns the thickness of the border that makes up the window frame edges. |
58 // This does not include any client edge. | 53 // This does not include any client edge. |
59 int FrameBorderThickness() const; | 54 int FrameBorderThickness() const; |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 StringPrefMember username_pref_; | 123 StringPrefMember username_pref_; |
129 | 124 |
130 static const int kThrobberIconCount = 24; | 125 static const int kThrobberIconCount = 24; |
131 static HICON throbber_icons_[kThrobberIconCount]; | 126 static HICON throbber_icons_[kThrobberIconCount]; |
132 static void InitThrobberIcons(); | 127 static void InitThrobberIcons(); |
133 | 128 |
134 DISALLOW_COPY_AND_ASSIGN(GlassBrowserFrameView); | 129 DISALLOW_COPY_AND_ASSIGN(GlassBrowserFrameView); |
135 }; | 130 }; |
136 | 131 |
137 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_ | 132 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_ |
OLD | NEW |