| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/launcher_item_controller.h" | 5 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 7 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| 8 #include "chrome/common/extensions/extension_constants.h" |
| 8 | 9 |
| 9 LauncherItemController::LauncherItemController( | 10 LauncherItemController::LauncherItemController( |
| 10 Type type, | 11 Type type, |
| 11 const std::string& app_id, | 12 const std::string& app_id, |
| 12 ChromeLauncherController* launcher_controller) | 13 ChromeLauncherController* launcher_controller) |
| 13 : type_(type), | 14 : type_(type), |
| 14 app_id_(app_id), | 15 app_id_(app_id), |
| 15 shelf_id_(0), | 16 shelf_id_(0), |
| 16 launcher_controller_(launcher_controller), | 17 launcher_controller_(launcher_controller), |
| 17 locked_(0), | 18 locked_(0), |
| 18 image_set_by_controller_(false) {} | 19 image_set_by_controller_(false) {} |
| 19 | 20 |
| 20 LauncherItemController::~LauncherItemController() {} | 21 LauncherItemController::~LauncherItemController() {} |
| 21 | 22 |
| 22 ash::ShelfItemType LauncherItemController::GetShelfItemType() const { | 23 ash::ShelfItemType LauncherItemController::GetShelfItemType() const { |
| 24 if (extension_misc::IsImeMenuExtensionId(app_id_)) |
| 25 return ash::TYPE_IME_MENU; |
| 26 |
| 23 switch (type_) { | 27 switch (type_) { |
| 24 case LauncherItemController::TYPE_SHORTCUT: | 28 case LauncherItemController::TYPE_SHORTCUT: |
| 25 case LauncherItemController::TYPE_WINDOWED_APP: | 29 case LauncherItemController::TYPE_WINDOWED_APP: |
| 26 return ash::TYPE_APP_SHORTCUT; | 30 return ash::TYPE_APP_SHORTCUT; |
| 27 case LauncherItemController::TYPE_APP: | 31 case LauncherItemController::TYPE_APP: |
| 28 return ash::TYPE_PLATFORM_APP; | 32 return ash::TYPE_PLATFORM_APP; |
| 29 case LauncherItemController::TYPE_APP_PANEL: | 33 case LauncherItemController::TYPE_APP_PANEL: |
| 30 return ash::TYPE_APP_PANEL; | 34 return ash::TYPE_APP_PANEL; |
| 31 } | 35 } |
| 32 NOTREACHED(); | 36 NOTREACHED(); |
| 33 return ash::TYPE_APP_SHORTCUT; | 37 return ash::TYPE_APP_SHORTCUT; |
| 34 } | 38 } |
| OLD | NEW |