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

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

Issue 2702723002: Extract kArcEnabled preference from ArcSessionManager part 1. (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"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 if (!GetExtensionByID(profile_, id)) 154 if (!GetExtensionByID(profile_, id))
155 return false; 155 return false;
156 if (id == ArcSupportHost::kHostAppId) { 156 if (id == ArcSupportHost::kHostAppId) {
157 if (!arc::IsArcAllowedForProfile(profile())) 157 if (!arc::IsArcAllowedForProfile(profile()))
158 return false; 158 return false;
159 const arc::ArcSessionManager* arc_session_manager = 159 const arc::ArcSessionManager* arc_session_manager =
160 arc::ArcSessionManager::Get(); 160 arc::ArcSessionManager::Get();
161 DCHECK(arc_session_manager); 161 DCHECK(arc_session_manager);
162 if (!arc_session_manager->IsAllowed()) 162 if (!arc_session_manager->IsAllowed())
163 return false; 163 return false;
164 if (!arc_session_manager->IsArcPlayStoreEnabled() && 164 if (!arc::IsArcPlayStoreEnabledForProfile(profile()) &&
165 arc_session_manager->IsArcManaged()) 165 arc::IsArcPlayStoreEnabledPreferenceManagedForProfile(profile()))
166 return false; 166 return false;
167 } 167 }
168 168
169 return true; 169 return true;
170 } 170 }
171 171
172 void LauncherControllerHelper::LaunchApp(ash::AppLauncherId id, 172 void LauncherControllerHelper::LaunchApp(ash::AppLauncherId id,
173 ash::ShelfLaunchSource source, 173 ash::ShelfLaunchSource source,
174 int event_flags) { 174 int event_flags) {
175 const std::string& app_id = id.app_id(); 175 const std::string& app_id = id.app_id();
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698