| 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/shelf/shelf_window_watcher_item_delegate.h" | 5 #include "ash/shelf/shelf_window_watcher_item_delegate.h" |
| 6 | 6 |
| 7 #include "ash/shelf/shelf_model.h" | 7 #include "ash/shelf/shelf_model.h" |
| 8 #include "ash/shelf/shelf_util.h" | 8 #include "ash/shelf/shelf_util.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_delegate.h" | 10 #include "ash/shell_delegate.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 } | 26 } |
| 27 | 27 |
| 28 void ShelfWindowWatcherItemDelegate::Close() { | 28 void ShelfWindowWatcherItemDelegate::Close() { |
| 29 views::Widget::GetWidgetForNativeWindow(window_)->Close(); | 29 views::Widget::GetWidgetForNativeWindow(window_)->Close(); |
| 30 } | 30 } |
| 31 | 31 |
| 32 bool ShelfWindowWatcherItemDelegate::ItemSelected(const ui::Event& event) { | 32 bool ShelfWindowWatcherItemDelegate::ItemSelected(const ui::Event& event) { |
| 33 wm::WindowState* window_state = wm::GetWindowState(window_); | 33 wm::WindowState* window_state = wm::GetWindowState(window_); |
| 34 if (window_state->IsActive()) { | 34 if (window_state->IsActive()) { |
| 35 if (event.type() & ui::ET_KEY_RELEASED) { | 35 if (event.type() & ui::ET_KEY_RELEASED) { |
| 36 views::corewm::AnimateWindow(window_, | 36 ::wm::AnimateWindow(window_, ::wm::WINDOW_ANIMATION_TYPE_BOUNCE); |
| 37 views::corewm::WINDOW_ANIMATION_TYPE_BOUNCE); | |
| 38 } else { | 37 } else { |
| 39 window_state->Minimize(); | 38 window_state->Minimize(); |
| 40 } | 39 } |
| 41 } else { | 40 } else { |
| 42 window_state->Activate(); | 41 window_state->Activate(); |
| 43 } | 42 } |
| 44 | 43 |
| 45 return false; | 44 return false; |
| 46 } | 45 } |
| 47 | 46 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 65 bool ShelfWindowWatcherItemDelegate::IsDraggable() { | 64 bool ShelfWindowWatcherItemDelegate::IsDraggable() { |
| 66 return true; | 65 return true; |
| 67 } | 66 } |
| 68 | 67 |
| 69 bool ShelfWindowWatcherItemDelegate::ShouldShowTooltip() { | 68 bool ShelfWindowWatcherItemDelegate::ShouldShowTooltip() { |
| 70 return true; | 69 return true; |
| 71 } | 70 } |
| 72 | 71 |
| 73 } // namespace internal | 72 } // namespace internal |
| 74 } // namespace ash | 73 } // namespace ash |
| OLD | NEW |