Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Side by Side Diff: chrome/browser/ui/ash/launcher/launcher_controller_helper.cc

Issue 2642783003: Move more utility functions to arc_util. (Closed)
Patch Set: address comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "chrome/browser/chromeos/arc/arc_support_host.h" 12 #include "chrome/browser/chromeos/arc/arc_support_host.h"
13 #include "chrome/browser/chromeos/arc/arc_util.h"
12 #include "chrome/browser/extensions/extension_service.h" 14 #include "chrome/browser/extensions/extension_service.h"
13 #include "chrome/browser/extensions/extension_util.h" 15 #include "chrome/browser/extensions/extension_util.h"
14 #include "chrome/browser/extensions/launch_util.h" 16 #include "chrome/browser/extensions/launch_util.h"
15 #include "chrome/browser/profiles/profile.h" 17 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/browser/profiles/profile_manager.h" 18 #include "chrome/browser/profiles/profile_manager.h"
17 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" 19 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
18 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" 20 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
19 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h" 21 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h"
20 #include "chrome/browser/ui/browser_finder.h" 22 #include "chrome/browser/ui/browser_finder.h"
21 #include "chrome/browser/ui/extensions/app_launch_params.h" 23 #include "chrome/browser/ui/extensions/app_launch_params.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 } 147 }
146 148
147 bool LauncherControllerHelper::IsValidIDForCurrentUser( 149 bool LauncherControllerHelper::IsValidIDForCurrentUser(
148 const std::string& id) const { 150 const std::string& id) const {
149 const ArcAppListPrefs* arc_prefs = GetArcAppListPrefs(); 151 const ArcAppListPrefs* arc_prefs = GetArcAppListPrefs();
150 if (arc_prefs && arc_prefs->IsRegistered(id)) 152 if (arc_prefs && arc_prefs->IsRegistered(id))
151 return true; 153 return true;
152 if (!GetExtensionByID(profile_, id)) 154 if (!GetExtensionByID(profile_, id))
153 return false; 155 return false;
154 if (id == ArcSupportHost::kHostAppId) { 156 if (id == ArcSupportHost::kHostAppId) {
155 if (!arc::ArcSessionManager::IsAllowedForProfile(profile())) 157 if (!arc::IsArcAllowedForProfile(profile()))
156 return false; 158 return false;
157 const arc::ArcSessionManager* arc_session_manager = 159 const arc::ArcSessionManager* arc_session_manager =
158 arc::ArcSessionManager::Get(); 160 arc::ArcSessionManager::Get();
159 DCHECK(arc_session_manager); 161 DCHECK(arc_session_manager);
160 if (!arc_session_manager->IsAllowed()) 162 if (!arc_session_manager->IsAllowed())
161 return false; 163 return false;
162 if (!arc_session_manager->IsArcEnabled() && 164 if (!arc_session_manager->IsArcEnabled() &&
163 arc_session_manager->IsArcManaged()) 165 arc_session_manager->IsArcManaged())
164 return false; 166 return false;
165 } 167 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 226
225 void LauncherControllerHelper::ExtensionEnableFlowFinished() { 227 void LauncherControllerHelper::ExtensionEnableFlowFinished() {
226 LaunchApp(extension_enable_flow_->extension_id(), ash::LAUNCH_FROM_UNKNOWN, 228 LaunchApp(extension_enable_flow_->extension_id(), ash::LAUNCH_FROM_UNKNOWN,
227 ui::EF_NONE); 229 ui::EF_NONE);
228 extension_enable_flow_.reset(); 230 extension_enable_flow_.reset();
229 } 231 }
230 232
231 void LauncherControllerHelper::ExtensionEnableFlowAborted(bool user_initiated) { 233 void LauncherControllerHelper::ExtensionEnableFlowAborted(bool user_initiated) {
232 extension_enable_flow_.reset(); 234 extension_enable_flow_.reset();
233 } 235 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc ('k') | chrome/browser/ui/extensions/app_launch_params.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698