| 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/frame/caption_buttons/frame_caption_button.h" | 10 #include "ash/frame/caption_buttons/frame_caption_button.h" |
| 11 #include "ash/frame/caption_buttons/frame_size_button.h" | 11 #include "ash/frame/caption_buttons/frame_size_button.h" |
| 12 #include "ash/shell.h" | 12 #include "ash/shell.h" |
| 13 #include "ash/shell_port.h" |
| 13 #include "ash/wm/maximize_mode/maximize_mode_controller.h" | 14 #include "ash/wm/maximize_mode/maximize_mode_controller.h" |
| 14 #include "ash/wm_shell.h" | |
| 15 #include "ui/base/hit_test.h" | 15 #include "ui/base/hit_test.h" |
| 16 #include "ui/base/l10n/l10n_util.h" | 16 #include "ui/base/l10n/l10n_util.h" |
| 17 #include "ui/compositor/scoped_animation_duration_scale_mode.h" | 17 #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
| 18 #include "ui/gfx/animation/slide_animation.h" | 18 #include "ui/gfx/animation/slide_animation.h" |
| 19 #include "ui/gfx/animation/tween.h" | 19 #include "ui/gfx/animation/tween.h" |
| 20 #include "ui/gfx/canvas.h" | 20 #include "ui/gfx/canvas.h" |
| 21 #include "ui/gfx/geometry/insets.h" | 21 #include "ui/gfx/geometry/insets.h" |
| 22 #include "ui/gfx/geometry/point.h" | 22 #include "ui/gfx/geometry/point.h" |
| 23 #include "ui/gfx/vector_icon_types.h" | 23 #include "ui/gfx/vector_icon_types.h" |
| 24 #include "ui/strings/grit/ui_strings.h" // Accessibility names | 24 #include "ui/strings/grit/ui_strings.h" // Accessibility names |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 action = UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_EXIT_FULLSCREEN; | 327 action = UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_EXIT_FULLSCREEN; |
| 328 } else if (frame_->IsMaximized()) { | 328 } else if (frame_->IsMaximized()) { |
| 329 frame_->Restore(); | 329 frame_->Restore(); |
| 330 action = UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_RESTORE; | 330 action = UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_RESTORE; |
| 331 } else { | 331 } else { |
| 332 frame_->Maximize(); | 332 frame_->Maximize(); |
| 333 action = UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MAXIMIZE; | 333 action = UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_MAXIMIZE; |
| 334 } | 334 } |
| 335 | 335 |
| 336 if (event.IsGestureEvent()) | 336 if (event.IsGestureEvent()) |
| 337 WmShell::Get()->RecordGestureAction(GESTURE_FRAMEMAXIMIZE_TAP); | 337 ShellPort::Get()->RecordGestureAction(GESTURE_FRAMEMAXIMIZE_TAP); |
| 338 } else if (sender == close_button_) { | 338 } else if (sender == close_button_) { |
| 339 frame_->Close(); | 339 frame_->Close(); |
| 340 action = UMA_WINDOW_CLOSE_BUTTON_CLICK; | 340 action = UMA_WINDOW_CLOSE_BUTTON_CLICK; |
| 341 } else { | 341 } else { |
| 342 return; | 342 return; |
| 343 } | 343 } |
| 344 WmShell::Get()->RecordUserMetricsAction(action); | 344 ShellPort::Get()->RecordUserMetricsAction(action); |
| 345 } | 345 } |
| 346 | 346 |
| 347 bool FrameCaptionButtonContainerView::IsMinimizeButtonVisible() const { | 347 bool FrameCaptionButtonContainerView::IsMinimizeButtonVisible() const { |
| 348 return minimize_button_->visible(); | 348 return minimize_button_->visible(); |
| 349 } | 349 } |
| 350 | 350 |
| 351 void FrameCaptionButtonContainerView::SetButtonsToNormal(Animate animate) { | 351 void FrameCaptionButtonContainerView::SetButtonsToNormal(Animate animate) { |
| 352 SetButtonIcons(CAPTION_BUTTON_ICON_MINIMIZE, CAPTION_BUTTON_ICON_CLOSE, | 352 SetButtonIcons(CAPTION_BUTTON_ICON_MINIMIZE, CAPTION_BUTTON_ICON_CLOSE, |
| 353 animate); | 353 animate); |
| 354 minimize_button_->SetState(views::Button::STATE_NORMAL); | 354 minimize_button_->SetState(views::Button::STATE_NORMAL); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 views::Button::ButtonState new_state = views::Button::STATE_NORMAL; | 404 views::Button::ButtonState new_state = views::Button::STATE_NORMAL; |
| 405 if (button == to_hover) | 405 if (button == to_hover) |
| 406 new_state = views::Button::STATE_HOVERED; | 406 new_state = views::Button::STATE_HOVERED; |
| 407 else if (button == to_press) | 407 else if (button == to_press) |
| 408 new_state = views::Button::STATE_PRESSED; | 408 new_state = views::Button::STATE_PRESSED; |
| 409 button->SetState(new_state); | 409 button->SetState(new_state); |
| 410 } | 410 } |
| 411 } | 411 } |
| 412 | 412 |
| 413 } // namespace ash | 413 } // namespace ash |
| OLD | NEW |