Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(892)

Side by Side Diff: chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc

Issue 11969006: cros: Trigger immersive mode with F4 maximize key (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 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. 201 // the user hovers or clicks in the top-right of the screen and hits one.
202 // Only show them during a reveal. 202 // Only show them during a reveal.
203 ImmersiveModeController* controller = 203 ImmersiveModeController* controller =
204 browser_view()->immersive_mode_controller(); 204 browser_view()->immersive_mode_controller();
205 bool show_buttons = !controller->enabled() || controller->IsRevealed(); 205 if (controller->enabled()) {
206 immersive_button_->SetVisible(show_buttons); 206 bool revealed = controller->IsRevealed();
207 size_button_->SetVisible(show_buttons); 207 immersive_button_->SetVisible(revealed);
208 close_button_->SetVisible(show_buttons); 208 size_button_->SetVisible(revealed);
209 close_button_->SetVisible(revealed);
210 } else {
211 // Only show immersive button for maximized windows.
212 immersive_button_->SetVisible(frame()->IsMaximized());
James Cook 2013/01/16 01:00:26 This is the core change, but I thought it was clea
213 size_button_->SetVisible(true);
214 close_button_->SetVisible(true);
215 }
209 216
210 size_button_->SetState(views::CustomButton::STATE_NORMAL); 217 size_button_->SetState(views::CustomButton::STATE_NORMAL);
211 // The close button isn't affected by this constraint. 218 // The close button isn't affected by this constraint.
212 } 219 }
213 220
214 void BrowserNonClientFrameViewAsh::UpdateWindowIcon() { 221 void BrowserNonClientFrameViewAsh::UpdateWindowIcon() {
215 if (window_icon_) 222 if (window_icon_)
216 window_icon_->SchedulePaint(); 223 window_icon_->SchedulePaint();
217 } 224 }
218 225
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 BrowserNonClientFrameViewAsh::GetThemeFrameOverlayImage() const { 512 BrowserNonClientFrameViewAsh::GetThemeFrameOverlayImage() const {
506 ui::ThemeProvider* tp = GetThemeProvider(); 513 ui::ThemeProvider* tp = GetThemeProvider();
507 if (tp->HasCustomImage(IDR_THEME_FRAME_OVERLAY) && 514 if (tp->HasCustomImage(IDR_THEME_FRAME_OVERLAY) &&
508 browser_view()->IsBrowserTypeNormal() && 515 browser_view()->IsBrowserTypeNormal() &&
509 !browser_view()->IsOffTheRecord()) { 516 !browser_view()->IsOffTheRecord()) {
510 return tp->GetImageSkiaNamed(ShouldPaintAsActive() ? 517 return tp->GetImageSkiaNamed(ShouldPaintAsActive() ?
511 IDR_THEME_FRAME_OVERLAY : IDR_THEME_FRAME_OVERLAY_INACTIVE); 518 IDR_THEME_FRAME_OVERLAY : IDR_THEME_FRAME_OVERLAY_INACTIVE);
512 } 519 }
513 return NULL; 520 return NULL;
514 } 521 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/chrome_shell_delegate.cc ('k') | chrome/browser/ui/views/immersive_mode_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698