| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/extension_app_window_launcher_item_cont
roller.h" | 5 #include "chrome/browser/ui/ash/launcher/extension_app_window_launcher_item_cont
roller.h" |
| 6 | 6 |
| 7 #include "ash/common/wm/window_state.h" | 7 #include "ash/common/wm/window_state.h" |
| 8 #include "ash/wm/window_state_aura.h" | 8 #include "ash/wm/window_state_aura.h" |
| 9 #include "ash/wm/window_util.h" | 9 #include "ash/wm/window_util.h" |
| 10 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h" | 10 #include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 SkBitmap bmp = skia::ImageOperations::Resize( | 43 SkBitmap bmp = skia::ImageOperations::Resize( |
| 44 *app_window->app_icon().ToSkBitmap(), skia::ImageOperations::RESIZE_BEST, | 44 *app_window->app_icon().ToSkBitmap(), skia::ImageOperations::RESIZE_BEST, |
| 45 kAppListIconSize, kAppListIconSize); | 45 kAppListIconSize, kAppListIconSize); |
| 46 return gfx::Image(gfx::ImageSkia::CreateFrom1xBitmap(bmp)); | 46 return gfx::Image(gfx::ImageSkia::CreateFrom1xBitmap(bmp)); |
| 47 } | 47 } |
| 48 | 48 |
| 49 } // namespace | 49 } // namespace |
| 50 | 50 |
| 51 ExtensionAppWindowLauncherItemController:: | 51 ExtensionAppWindowLauncherItemController:: |
| 52 ExtensionAppWindowLauncherItemController( | 52 ExtensionAppWindowLauncherItemController( |
| 53 Type type, | |
| 54 const std::string& app_id, | 53 const std::string& app_id, |
| 55 const std::string& launch_id, | 54 const std::string& launch_id, |
| 56 ChromeLauncherController* controller) | 55 ChromeLauncherController* controller) |
| 57 : AppWindowLauncherItemController(type, app_id, launch_id, controller) { | 56 : AppWindowLauncherItemController(app_id, launch_id, controller) {} |
| 58 DCHECK_NE(TYPE_APP_PANEL, type); | |
| 59 } | |
| 60 | 57 |
| 61 ExtensionAppWindowLauncherItemController:: | 58 ExtensionAppWindowLauncherItemController:: |
| 62 ~ExtensionAppWindowLauncherItemController() {} | 59 ~ExtensionAppWindowLauncherItemController() {} |
| 63 | 60 |
| 64 void ExtensionAppWindowLauncherItemController::AddAppWindow( | 61 void ExtensionAppWindowLauncherItemController::AddAppWindow( |
| 65 extensions::AppWindow* app_window) { | 62 extensions::AppWindow* app_window) { |
| 66 DCHECK(!app_window->window_type_is_panel()); | 63 DCHECK(!app_window->window_type_is_panel()); |
| 67 DCHECK(window_to_app_window_.find(app_window->GetBaseWindow()) == | 64 DCHECK(window_to_app_window_.find(app_window->GetBaseWindow()) == |
| 68 window_to_app_window_.end()); | 65 window_to_app_window_.end()); |
| 69 AddWindow(app_window->GetBaseWindow()); | 66 AddWindow(app_window->GetBaseWindow()); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 if (windows().empty()) | 111 if (windows().empty()) |
| 115 return kNoAction; | 112 return kNoAction; |
| 116 return AppWindowLauncherItemController::ItemSelected(event); | 113 return AppWindowLauncherItemController::ItemSelected(event); |
| 117 } | 114 } |
| 118 | 115 |
| 119 ash::ShelfMenuModel* | 116 ash::ShelfMenuModel* |
| 120 ExtensionAppWindowLauncherItemController::CreateApplicationMenu( | 117 ExtensionAppWindowLauncherItemController::CreateApplicationMenu( |
| 121 int event_flags) { | 118 int event_flags) { |
| 122 return new LauncherApplicationMenuItemModel(GetApplicationList(event_flags)); | 119 return new LauncherApplicationMenuItemModel(GetApplicationList(event_flags)); |
| 123 } | 120 } |
| OLD | NEW |