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 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h" | 5 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h" |
6 | 6 |
7 #include "ash/wm/frame_painter.h" | 7 #include "ash/wm/frame_painter.h" |
8 #include "ash/wm/workspace/frame_maximize_button.h" | 8 #include "ash/wm/workspace/frame_maximize_button.h" |
9 #include "chrome/browser/themes/theme_service.h" | 9 #include "chrome/browser/themes/theme_service.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 } | 190 } |
191 return hit_test; | 191 return hit_test; |
192 } | 192 } |
193 | 193 |
194 void BrowserNonClientFrameViewAsh::GetWindowMask(const gfx::Size& size, | 194 void BrowserNonClientFrameViewAsh::GetWindowMask(const gfx::Size& size, |
195 gfx::Path* window_mask) { | 195 gfx::Path* window_mask) { |
196 // Aura does not use window masks. | 196 // Aura does not use window masks. |
197 } | 197 } |
198 | 198 |
199 void BrowserNonClientFrameViewAsh::ResetWindowControls() { | 199 void BrowserNonClientFrameViewAsh::ResetWindowControls() { |
| 200 // Hide the caption buttons in immersive mode because it's confusing when |
| 201 // the user hovers or clicks in the top-right of the screen and hits one. |
| 202 // Only show them during a reveal. |
| 203 ImmersiveModeController* controller = |
| 204 browser_view()->immersive_mode_controller(); |
| 205 bool show_buttons = !controller->enabled() || controller->IsRevealed(); |
| 206 immersive_button_->SetVisible(show_buttons); |
| 207 size_button_->SetVisible(show_buttons); |
| 208 close_button_->SetVisible(show_buttons); |
| 209 |
200 size_button_->SetState(views::CustomButton::STATE_NORMAL); | 210 size_button_->SetState(views::CustomButton::STATE_NORMAL); |
201 // The close button isn't affected by this constraint. | 211 // The close button isn't affected by this constraint. |
202 } | 212 } |
203 | 213 |
204 void BrowserNonClientFrameViewAsh::UpdateWindowIcon() { | 214 void BrowserNonClientFrameViewAsh::UpdateWindowIcon() { |
205 if (window_icon_) | 215 if (window_icon_) |
206 window_icon_->SchedulePaint(); | 216 window_icon_->SchedulePaint(); |
207 } | 217 } |
208 | 218 |
209 void BrowserNonClientFrameViewAsh::UpdateWindowTitle() { | 219 void BrowserNonClientFrameViewAsh::UpdateWindowTitle() { |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 BrowserNonClientFrameViewAsh::GetThemeFrameOverlayImage() const { | 505 BrowserNonClientFrameViewAsh::GetThemeFrameOverlayImage() const { |
496 ui::ThemeProvider* tp = GetThemeProvider(); | 506 ui::ThemeProvider* tp = GetThemeProvider(); |
497 if (tp->HasCustomImage(IDR_THEME_FRAME_OVERLAY) && | 507 if (tp->HasCustomImage(IDR_THEME_FRAME_OVERLAY) && |
498 browser_view()->IsBrowserTypeNormal() && | 508 browser_view()->IsBrowserTypeNormal() && |
499 !browser_view()->IsOffTheRecord()) { | 509 !browser_view()->IsOffTheRecord()) { |
500 return tp->GetImageSkiaNamed(ShouldPaintAsActive() ? | 510 return tp->GetImageSkiaNamed(ShouldPaintAsActive() ? |
501 IDR_THEME_FRAME_OVERLAY : IDR_THEME_FRAME_OVERLAY_INACTIVE); | 511 IDR_THEME_FRAME_OVERLAY : IDR_THEME_FRAME_OVERLAY_INACTIVE); |
502 } | 512 } |
503 return NULL; | 513 return NULL; |
504 } | 514 } |
OLD | NEW |