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_CHROMEOS_FRAME_BUBBLE_FRAME_VIEW_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FRAME_BUBBLE_FRAME_VIEW_H_ |
6 #define CHROME_BROWSER_CHROMEOS_FRAME_BUBBLE_FRAME_VIEW_H_ | 6 #define CHROME_BROWSER_CHROMEOS_FRAME_BUBBLE_FRAME_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/chromeos/frame/bubble_window.h" | 9 #include "chrome/browser/chromeos/frame/bubble_window.h" |
10 #include "ui/views/controls/button/button.h" | 10 #include "ui/views/controls/button/button.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 class Throbber; | 24 class Throbber; |
25 class Widget; | 25 class Widget; |
26 } | 26 } |
27 | 27 |
28 namespace chromeos { | 28 namespace chromeos { |
29 | 29 |
30 // BubbleFrameView implements a BubbleBorder based window frame. | 30 // BubbleFrameView implements a BubbleBorder based window frame. |
31 class BubbleFrameView : public views::NonClientFrameView, | 31 class BubbleFrameView : public views::NonClientFrameView, |
32 public views::ButtonListener { | 32 public views::ButtonListener { |
33 public: | 33 public: |
34 BubbleFrameView(views::Widget* frame, | 34 BubbleFrameView(views::WidgetDelegate* widget_delegate, |
35 views::WidgetDelegate* widget_delegate, | |
36 DialogStyle style); | 35 DialogStyle style); |
37 virtual ~BubbleFrameView(); | 36 virtual ~BubbleFrameView(); |
38 | 37 |
39 // Overridden from views::NonClientFrameView: | 38 // Overridden from views::NonClientFrameView: |
40 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; | 39 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; |
41 virtual gfx::Rect GetWindowBoundsForClientBounds( | 40 virtual gfx::Rect GetWindowBoundsForClientBounds( |
42 const gfx::Rect& client_bounds) const OVERRIDE; | 41 const gfx::Rect& client_bounds) const OVERRIDE; |
43 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; | 42 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; |
44 virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) | 43 virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) |
45 OVERRIDE; | 44 OVERRIDE; |
46 virtual void ResetWindowControls() OVERRIDE; | 45 virtual void ResetWindowControls() OVERRIDE; |
47 virtual void UpdateWindowIcon() OVERRIDE; | 46 virtual void UpdateWindowIcon() OVERRIDE; |
48 | 47 |
49 // View overrides: | 48 // View overrides: |
50 virtual gfx::Insets GetInsets() const OVERRIDE; | 49 virtual gfx::Insets GetInsets() const OVERRIDE; |
51 virtual gfx::Size GetPreferredSize() OVERRIDE; | 50 virtual gfx::Size GetPreferredSize() OVERRIDE; |
52 virtual void Layout() OVERRIDE; | 51 virtual void Layout() OVERRIDE; |
53 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 52 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
54 | 53 |
55 // Overridden from views::ButtonListener: | 54 // Overridden from views::ButtonListener: |
56 virtual void ButtonPressed(views::Button* sender, const views::Event& event) | 55 virtual void ButtonPressed(views::Button* sender, const views::Event& event) |
57 OVERRIDE; | 56 OVERRIDE; |
58 | 57 |
59 void StartThrobber(); | 58 void StartThrobber(); |
60 void StopThrobber(); | 59 void StopThrobber(); |
61 | 60 |
62 private: | 61 private: |
63 // The window that owns this view. | |
64 views::Widget* frame_; | |
65 | |
66 // Allows to tweak appearance of the view. | 62 // Allows to tweak appearance of the view. |
67 DialogStyle style_; | 63 DialogStyle style_; |
68 | 64 |
69 // Title label | 65 // Title label |
70 views::Label* title_; | 66 views::Label* title_; |
71 | 67 |
72 // The bounds of the client view, in this view's coordinates. | 68 // The bounds of the client view, in this view's coordinates. |
73 gfx::Rect client_view_bounds_; | 69 gfx::Rect client_view_bounds_; |
74 | 70 |
75 // Close button for STYLE_XBAR case. | 71 // Close button for STYLE_XBAR case. |
76 views::ImageButton* close_button_; | 72 views::ImageButton* close_button_; |
77 | 73 |
78 // Throbber is optional. Employed by STYLE_THROBBER. | 74 // Throbber is optional. Employed by STYLE_THROBBER. |
79 views::Throbber* throbber_; | 75 views::Throbber* throbber_; |
80 | 76 |
81 DISALLOW_COPY_AND_ASSIGN(BubbleFrameView); | 77 DISALLOW_COPY_AND_ASSIGN(BubbleFrameView); |
82 }; | 78 }; |
83 | 79 |
84 } // namespace chromeos | 80 } // namespace chromeos |
85 | 81 |
86 #endif // CHROME_BROWSER_CHROMEOS_FRAME_BUBBLE_FRAME_VIEW_H_ | 82 #endif // CHROME_BROWSER_CHROMEOS_FRAME_BUBBLE_FRAME_VIEW_H_ |
OLD | NEW |