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_PANELS_PANEL_BROWSER_FRAME_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_FRAME_VIEW_H_ |
6 #define CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_FRAME_VIEW_H_ | 6 #define CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_FRAME_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.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 "chrome/browser/ui/views/tab_icon_view.h" | 13 #include "chrome/browser/ui/views/tab_icon_view.h" |
14 #include "ui/base/animation/animation_delegate.h" | 14 #include "ui/base/animation/animation_delegate.h" |
15 #include "views/controls/button/button.h" | 15 #include "views/controls/button/button.h" |
16 #include "views/controls/menu/view_menu_delegate.h" | 16 #include "views/controls/menu/view_menu_delegate.h" |
17 | 17 |
18 class Extension; | 18 class Extension; |
19 class PanelBrowserView; | 19 class PanelBrowserView; |
20 class PanelSettingsMenuModel; | 20 class PanelSettingsMenuModel; |
| 21 class SkPaint; |
21 namespace gfx { | 22 namespace gfx { |
22 class Font; | 23 class Font; |
23 } | 24 } |
24 namespace ui { | 25 namespace ui { |
25 class SlideAnimation; | 26 class SlideAnimation; |
26 } | 27 } |
27 namespace views { | 28 namespace views { |
28 class ImageButton; | 29 class ImageButton; |
29 class Label; | 30 class Label; |
30 class MenuButton; | 31 class MenuButton; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 135 |
135 // Returns the thickness of the entire nonclient left, right, and bottom | 136 // Returns the thickness of the entire nonclient left, right, and bottom |
136 // borders, including both the window frame and any client edge. | 137 // borders, including both the window frame and any client edge. |
137 int NonClientBorderThickness() const; | 138 int NonClientBorderThickness() const; |
138 | 139 |
139 // Update control styles to indicate if the titlebar is active or not. | 140 // Update control styles to indicate if the titlebar is active or not. |
140 void UpdateControlStyles(PaintState paint_state); | 141 void UpdateControlStyles(PaintState paint_state); |
141 | 142 |
142 // Custom draw the frame. | 143 // Custom draw the frame. |
143 void PaintFrameBorder(gfx::Canvas* canvas); | 144 void PaintFrameBorder(gfx::Canvas* canvas); |
144 void PaintClientEdge(gfx::Canvas* canvas); | |
145 | 145 |
146 // Called by MouseWatcher to notify if the mouse enters or leaves the window. | 146 // Called by MouseWatcher to notify if the mouse enters or leaves the window. |
147 void OnMouseEnterOrLeaveWindow(bool mouse_entered); | 147 void OnMouseEnterOrLeaveWindow(bool mouse_entered); |
148 | 148 |
149 // Retrieves the drawing metrics based on the current painting state. | 149 // Retrieves the drawing metrics based on the current painting state. |
| 150 SkColor GetDefaultTitleColor(PaintState paint_state) const; |
150 SkColor GetTitleColor(PaintState paint_state) const; | 151 SkColor GetTitleColor(PaintState paint_state) const; |
151 gfx::Font* GetTitleFont() const; | 152 gfx::Font* GetTitleFont() const; |
| 153 SkPaint* GetDefaultFrameTheme(PaintState paint_state) const; |
152 SkBitmap* GetFrameTheme(PaintState paint_state) const; | 154 SkBitmap* GetFrameTheme(PaintState paint_state) const; |
153 | 155 |
154 // Make settings button visible if either of the conditions is met: | 156 // Make settings button visible if either of the conditions is met: |
155 // 1) The panel is active, i.e. having focus. | 157 // 1) The panel is active, i.e. having focus. |
156 // 2) The mouse is over the panel. | 158 // 2) The mouse is over the panel. |
157 void UpdateSettingsButtonVisibility(bool active, bool cursor_in_view); | 159 void UpdateSettingsButtonVisibility(bool active, bool cursor_in_view); |
158 | 160 |
| 161 bool UsingDefaultTheme() const; |
| 162 |
159 const Extension* GetExtension() const; | 163 const Extension* GetExtension() const; |
160 | 164 |
161 bool EnsureSettingsMenuCreated(); | 165 bool EnsureSettingsMenuCreated(); |
162 | 166 |
163 string16 GetTitleText() const; | 167 string16 GetTitleText() const; |
164 | 168 |
165 #ifdef UNIT_TEST | 169 #ifdef UNIT_TEST |
166 PanelSettingsMenuModel* settings_menu_model() const { | 170 PanelSettingsMenuModel* settings_menu_model() const { |
167 return settings_menu_model_.get(); | 171 return settings_menu_model_.get(); |
168 } | 172 } |
(...skipping 23 matching lines...) Expand all Loading... |
192 // Used to animate the visibility change of settings button. | 196 // Used to animate the visibility change of settings button. |
193 scoped_ptr<ui::SlideAnimation> settings_button_animator_; | 197 scoped_ptr<ui::SlideAnimation> settings_button_animator_; |
194 gfx::Rect settings_button_full_bounds_; | 198 gfx::Rect settings_button_full_bounds_; |
195 gfx::Rect settings_button_zero_bounds_; | 199 gfx::Rect settings_button_zero_bounds_; |
196 bool is_settings_button_visible_; | 200 bool is_settings_button_visible_; |
197 | 201 |
198 DISALLOW_COPY_AND_ASSIGN(PanelBrowserFrameView); | 202 DISALLOW_COPY_AND_ASSIGN(PanelBrowserFrameView); |
199 }; | 203 }; |
200 | 204 |
201 #endif // CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_FRAME_VIEW_H_ | 205 #endif // CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_FRAME_VIEW_H_ |
OLD | NEW |