| 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_controller_helper.h" | 5 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 LauncherControllerHelper::~LauncherControllerHelper() {} | 103 LauncherControllerHelper::~LauncherControllerHelper() {} |
| 104 | 104 |
| 105 // static | 105 // static |
| 106 base::string16 LauncherControllerHelper::GetAppTitle( | 106 base::string16 LauncherControllerHelper::GetAppTitle( |
| 107 Profile* profile, | 107 Profile* profile, |
| 108 const std::string& app_id) { | 108 const std::string& app_id) { |
| 109 if (app_id.empty()) | 109 if (app_id.empty()) |
| 110 return base::string16(); | 110 return base::string16(); |
| 111 | 111 |
| 112 // Get the title if the app is an Arc app. | 112 // Get the title if the app is an ARC app. |
| 113 ArcAppListPrefs* arc_prefs = ArcAppListPrefs::Get(profile); | 113 ArcAppListPrefs* arc_prefs = ArcAppListPrefs::Get(profile); |
| 114 const std::string arc_app_id = | 114 const std::string arc_app_id = |
| 115 ArcAppWindowLauncherController::GetArcAppIdFromShelfAppId(app_id); | 115 ArcAppWindowLauncherController::GetArcAppIdFromShelfAppId(app_id); |
| 116 if (arc_prefs && arc_prefs->IsRegistered(arc_app_id)) { | 116 if (arc_prefs && arc_prefs->IsRegistered(arc_app_id)) { |
| 117 std::unique_ptr<ArcAppListPrefs::AppInfo> app_info = | 117 std::unique_ptr<ArcAppListPrefs::AppInfo> app_info = |
| 118 arc_prefs->GetApp(arc_app_id); | 118 arc_prefs->GetApp(arc_app_id); |
| 119 DCHECK(app_info.get()); | 119 DCHECK(app_info.get()); |
| 120 if (app_info) | 120 if (app_info) |
| 121 return base::UTF8ToUTF16(app_info->name); | 121 return base::UTF8ToUTF16(app_info->name); |
| 122 } | 122 } |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 | 219 |
| 220 void LauncherControllerHelper::ExtensionEnableFlowFinished() { | 220 void LauncherControllerHelper::ExtensionEnableFlowFinished() { |
| 221 LaunchApp(ash::AppLauncherId(extension_enable_flow_->extension_id()), | 221 LaunchApp(ash::AppLauncherId(extension_enable_flow_->extension_id()), |
| 222 ash::LAUNCH_FROM_UNKNOWN, ui::EF_NONE); | 222 ash::LAUNCH_FROM_UNKNOWN, ui::EF_NONE); |
| 223 extension_enable_flow_.reset(); | 223 extension_enable_flow_.reset(); |
| 224 } | 224 } |
| 225 | 225 |
| 226 void LauncherControllerHelper::ExtensionEnableFlowAborted(bool user_initiated) { | 226 void LauncherControllerHelper::ExtensionEnableFlowAborted(bool user_initiated) { |
| 227 extension_enable_flow_.reset(); | 227 extension_enable_flow_.reset(); |
| 228 } | 228 } |
| OLD | NEW |