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

Side by Side Diff: apps/ui/views/app_window_frame_view.cc

Issue 169463008: Fix the "Minimize" button of app windows remaining hovered after restore. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "apps/ui/views/app_window_frame_view.h" 5 #include "apps/ui/views/app_window_frame_view.h"
6 6
7 #include "apps/ui/native_app_window.h" 7 #include "apps/ui/native_app_window.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "extensions/common/draggable_region.h" 9 #include "extensions/common/draggable_region.h"
10 #include "grit/theme_resources.h" 10 #include "grit/theme_resources.h"
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 274
275 bool maximized = frame_->IsMaximized(); 275 bool maximized = frame_->IsMaximized();
276 maximize_button_->SetVisible(!maximized); 276 maximize_button_->SetVisible(!maximized);
277 restore_button_->SetVisible(maximized); 277 restore_button_->SetVisible(maximized);
278 if (maximized) 278 if (maximized)
279 maximize_button_->SetState(views::CustomButton::STATE_NORMAL); 279 maximize_button_->SetState(views::CustomButton::STATE_NORMAL);
280 else 280 else
281 restore_button_->SetState(views::CustomButton::STATE_NORMAL); 281 restore_button_->SetState(views::CustomButton::STATE_NORMAL);
282 282
283 gfx::Size minimize_size = minimize_button_->GetPreferredSize(); 283 gfx::Size minimize_size = minimize_button_->GetPreferredSize();
284 minimize_button_->SetState(views::CustomButton::STATE_NORMAL);
284 minimize_button_->SetBounds( 285 minimize_button_->SetBounds(
285 maximize_button_->x() - kButtonSpacing - minimize_size.width(), 286 maximize_button_->x() - kButtonSpacing - minimize_size.width(),
286 kButtonOffsetY, 287 kButtonOffsetY,
287 minimize_size.width(), 288 minimize_size.width(),
288 minimize_size.height()); 289 minimize_size.height());
289 } 290 }
290 291
291 void AppWindowFrameView::OnPaint(gfx::Canvas* canvas) { 292 void AppWindowFrameView::OnPaint(gfx::Canvas* canvas) {
292 if (window_->IsFrameless()) 293 if (window_->IsFrameless())
293 return; 294 return;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 frame_->Close(); 359 frame_->Close();
359 else if (sender == maximize_button_) 360 else if (sender == maximize_button_)
360 frame_->Maximize(); 361 frame_->Maximize();
361 else if (sender == restore_button_) 362 else if (sender == restore_button_)
362 frame_->Restore(); 363 frame_->Restore();
363 else if (sender == minimize_button_) 364 else if (sender == minimize_button_)
364 frame_->Minimize(); 365 frame_->Minimize();
365 } 366 }
366 367
367 } // namespace apps 368 } // namespace apps
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698