| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ash/frame/caption_buttons/frame_caption_button_container_view.h" | 5 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 } | 315 } |
| 316 | 316 |
| 317 bool FrameCaptionButtonContainerView::ShouldSizeButtonBeVisible() const { | 317 bool FrameCaptionButtonContainerView::ShouldSizeButtonBeVisible() const { |
| 318 return !Shell::GetInstance()->maximize_mode_controller()-> | 318 return !Shell::GetInstance()->maximize_mode_controller()-> |
| 319 IsMaximizeModeWindowManagerEnabled() && | 319 IsMaximizeModeWindowManagerEnabled() && |
| 320 frame_->widget_delegate()->CanMaximize(); | 320 frame_->widget_delegate()->CanMaximize(); |
| 321 } | 321 } |
| 322 | 322 |
| 323 void FrameCaptionButtonContainerView::ButtonPressed(views::Button* sender, | 323 void FrameCaptionButtonContainerView::ButtonPressed(views::Button* sender, |
| 324 const ui::Event& event) { | 324 const ui::Event& event) { |
| 325 // When shift-clicking, slow down animations for visual debugging. | |
| 326 // We used to do this via an event filter that looked for the shift key being | |
| 327 // pressed but this interfered with several normal keyboard shortcuts. | |
| 328 scoped_ptr<ui::ScopedAnimationDurationScaleMode> slow_duration_mode; | |
| 329 if (event.IsShiftDown()) { | |
| 330 slow_duration_mode.reset(new ui::ScopedAnimationDurationScaleMode( | |
| 331 ui::ScopedAnimationDurationScaleMode::SLOW_DURATION)); | |
| 332 } | |
| 333 | |
| 334 // Abort any animations of the button icons. | 325 // Abort any animations of the button icons. |
| 335 SetButtonsToNormal(ANIMATE_NO); | 326 SetButtonsToNormal(ANIMATE_NO); |
| 336 | 327 |
| 337 ash::UserMetricsAction action = | 328 ash::UserMetricsAction action = |
| 338 ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MINIMIZE; | 329 ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MINIMIZE; |
| 339 if (sender == minimize_button_) { | 330 if (sender == minimize_button_) { |
| 340 frame_->Minimize(); | 331 frame_->Minimize(); |
| 341 } else if (sender == size_button_) { | 332 } else if (sender == size_button_) { |
| 342 if (frame_->IsFullscreen()) { // Can be clicked in immersive fullscreen. | 333 if (frame_->IsFullscreen()) { // Can be clicked in immersive fullscreen. |
| 343 frame_->Restore(); | 334 frame_->Restore(); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 : icon_image_id(icon_id), | 432 : icon_image_id(icon_id), |
| 442 inactive_icon_image_id(inactive_icon_id), | 433 inactive_icon_image_id(inactive_icon_id), |
| 443 hovered_background_image_id(hovered_background_id), | 434 hovered_background_image_id(hovered_background_id), |
| 444 pressed_background_image_id(pressed_background_id) { | 435 pressed_background_image_id(pressed_background_id) { |
| 445 } | 436 } |
| 446 | 437 |
| 447 FrameCaptionButtonContainerView::ButtonIconIds::~ButtonIconIds() { | 438 FrameCaptionButtonContainerView::ButtonIconIds::~ButtonIconIds() { |
| 448 } | 439 } |
| 449 | 440 |
| 450 } // namespace ash | 441 } // namespace ash |
| OLD | NEW |