| 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" |
| 11 #include "chrome/browser/chromeos/arc/arc_session_manager.h" | |
| 12 #include "chrome/browser/chromeos/arc/arc_support_host.h" | 11 #include "chrome/browser/chromeos/arc/arc_support_host.h" |
| 13 #include "chrome/browser/chromeos/arc/arc_util.h" | |
| 14 #include "chrome/browser/extensions/extension_service.h" | 12 #include "chrome/browser/extensions/extension_service.h" |
| 15 #include "chrome/browser/extensions/extension_util.h" | 13 #include "chrome/browser/extensions/extension_util.h" |
| 16 #include "chrome/browser/extensions/launch_util.h" | 14 #include "chrome/browser/extensions/launch_util.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/browser/profiles/profile_manager.h" | 16 #include "chrome/browser/profiles/profile_manager.h" |
| 19 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" | 17 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" |
| 20 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" | 18 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" |
| 21 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h" | 19 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h" |
| 22 #include "chrome/browser/ui/browser_finder.h" | 20 #include "chrome/browser/ui/browser_finder.h" |
| 23 #include "chrome/browser/ui/extensions/app_launch_params.h" | 21 #include "chrome/browser/ui/extensions/app_launch_params.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 } | 145 } |
| 148 | 146 |
| 149 bool LauncherControllerHelper::IsValidIDForCurrentUser( | 147 bool LauncherControllerHelper::IsValidIDForCurrentUser( |
| 150 const std::string& id) const { | 148 const std::string& id) const { |
| 151 const ArcAppListPrefs* arc_prefs = GetArcAppListPrefs(); | 149 const ArcAppListPrefs* arc_prefs = GetArcAppListPrefs(); |
| 152 if (arc_prefs && arc_prefs->IsRegistered(id)) | 150 if (arc_prefs && arc_prefs->IsRegistered(id)) |
| 153 return true; | 151 return true; |
| 154 if (!GetExtensionByID(profile_, id)) | 152 if (!GetExtensionByID(profile_, id)) |
| 155 return false; | 153 return false; |
| 156 if (id == ArcSupportHost::kHostAppId) { | 154 if (id == ArcSupportHost::kHostAppId) { |
| 157 if (!arc::IsArcAllowedForProfile(profile())) | 155 if (!arc::ArcSessionManager::IsAllowedForProfile(profile())) |
| 158 return false; | 156 return false; |
| 159 const arc::ArcSessionManager* arc_session_manager = | 157 const arc::ArcSessionManager* arc_session_manager = |
| 160 arc::ArcSessionManager::Get(); | 158 arc::ArcSessionManager::Get(); |
| 161 DCHECK(arc_session_manager); | 159 DCHECK(arc_session_manager); |
| 162 if (!arc_session_manager->IsAllowed()) | 160 if (!arc_session_manager->IsAllowed()) |
| 163 return false; | 161 return false; |
| 164 if (!arc_session_manager->IsArcEnabled() && | 162 if (!arc_session_manager->IsArcEnabled() && |
| 165 arc_session_manager->IsArcManaged()) | 163 arc_session_manager->IsArcManaged()) |
| 166 return false; | 164 return false; |
| 167 } | 165 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 | 224 |
| 227 void LauncherControllerHelper::ExtensionEnableFlowFinished() { | 225 void LauncherControllerHelper::ExtensionEnableFlowFinished() { |
| 228 LaunchApp(extension_enable_flow_->extension_id(), ash::LAUNCH_FROM_UNKNOWN, | 226 LaunchApp(extension_enable_flow_->extension_id(), ash::LAUNCH_FROM_UNKNOWN, |
| 229 ui::EF_NONE); | 227 ui::EF_NONE); |
| 230 extension_enable_flow_.reset(); | 228 extension_enable_flow_.reset(); |
| 231 } | 229 } |
| 232 | 230 |
| 233 void LauncherControllerHelper::ExtensionEnableFlowAborted(bool user_initiated) { | 231 void LauncherControllerHelper::ExtensionEnableFlowAborted(bool user_initiated) { |
| 234 extension_enable_flow_.reset(); | 232 extension_enable_flow_.reset(); |
| 235 } | 233 } |
| OLD | NEW |