| OLD | NEW | 
|    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 "chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.h" |    5 #include "chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.h" | 
|    6  |    6  | 
|    7 #include <algorithm> |    7 #include <algorithm> | 
|    8  |    8  | 
|    9 #include "ash/wm/window_util.h" |    9 #include "ash/wm/window_util.h" | 
|   10 #include "base/memory/ptr_util.h" |   10 #include "base/memory/ptr_util.h" | 
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|   89   if (windows_.size() >= 1 && window_to_show->IsActive() && |   89   if (windows_.size() >= 1 && window_to_show->IsActive() && | 
|   90       event_type == ui::ET_KEY_RELEASED) { |   90       event_type == ui::ET_KEY_RELEASED) { | 
|   91     return ActivateOrAdvanceToNextAppWindow(window_to_show); |   91     return ActivateOrAdvanceToNextAppWindow(window_to_show); | 
|   92   } |   92   } | 
|   93  |   93  | 
|   94   return ShowAndActivateOrMinimize(window_to_show); |   94   return ShowAndActivateOrMinimize(window_to_show); | 
|   95 } |   95 } | 
|   96  |   96  | 
|   97 ash::ShelfAppMenuItemList AppWindowLauncherItemController::GetAppMenuItems( |   97 ash::ShelfAppMenuItemList AppWindowLauncherItemController::GetAppMenuItems( | 
|   98     int event_flags) { |   98     int event_flags) { | 
 |   99   // Return an empty item list to avoid showing an application menu. | 
|   99   return ash::ShelfAppMenuItemList(); |  100   return ash::ShelfAppMenuItemList(); | 
|  100 } |  101 } | 
|  101  |  102  | 
 |  103 void AppWindowLauncherItemController::ExecuteCommand(uint32_t command_id, | 
 |  104                                                      int event_flags) { | 
 |  105   // This delegate does not support showing an application menu. | 
 |  106   NOTIMPLEMENTED(); | 
 |  107 } | 
 |  108  | 
|  102 void AppWindowLauncherItemController::Close() { |  109 void AppWindowLauncherItemController::Close() { | 
|  103   // Note: Closing windows may affect the contents of app_windows_. |  110   // Note: Closing windows may affect the contents of app_windows_. | 
|  104   WindowList windows_to_close = windows_; |  111   WindowList windows_to_close = windows_; | 
|  105   for (auto* window : windows_) |  112   for (auto* window : windows_) | 
|  106     window->Close(); |  113     window->Close(); | 
|  107 } |  114 } | 
|  108  |  115  | 
|  109 void AppWindowLauncherItemController::ActivateIndexedApp(size_t index) { |  116 void AppWindowLauncherItemController::ActivateIndexedApp(size_t index) { | 
|  110   if (index >= windows_.size()) |  117   if (index >= windows_.size()) | 
|  111     return; |  118     return; | 
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  152   if (window_to_show->IsActive()) { |  159   if (window_to_show->IsActive()) { | 
|  153     // Coming here, only a single window is active. For keyboard activations |  160     // Coming here, only a single window is active. For keyboard activations | 
|  154     // the window gets animated. |  161     // the window gets animated. | 
|  155     AnimateWindow(window_to_show->GetNativeWindow(), |  162     AnimateWindow(window_to_show->GetNativeWindow(), | 
|  156                   wm::WINDOW_ANIMATION_TYPE_BOUNCE); |  163                   wm::WINDOW_ANIMATION_TYPE_BOUNCE); | 
|  157   } else { |  164   } else { | 
|  158     return ShowAndActivateOrMinimize(window_to_show); |  165     return ShowAndActivateOrMinimize(window_to_show); | 
|  159   } |  166   } | 
|  160   return ash::SHELF_ACTION_NONE; |  167   return ash::SHELF_ACTION_NONE; | 
|  161 } |  168 } | 
| OLD | NEW |