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

Side by Side Diff: chrome/browser/ui/webui/options/browser_options_handler.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/webui/options/browser_options_handler.h" 5 #include "chrome/browser/ui/webui/options/browser_options_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 #include "chrome/browser/ui/startup/default_browser_prompt.h" 116 #include "chrome/browser/ui/startup/default_browser_prompt.h"
117 #include "chrome/browser/ui/webui/settings_utils.h" 117 #include "chrome/browser/ui/webui/settings_utils.h"
118 #endif 118 #endif
119 119
120 #if defined(OS_CHROMEOS) 120 #if defined(OS_CHROMEOS)
121 #include "ash/common/accessibility_types.h" // nogncheck 121 #include "ash/common/accessibility_types.h" // nogncheck
122 #include "ash/common/system/chromeos/devicetype_utils.h" // nogncheck 122 #include "ash/common/system/chromeos/devicetype_utils.h" // nogncheck
123 #include "ash/shell.h" // nogncheck 123 #include "ash/shell.h" // nogncheck
124 #include "chrome/browser/browser_process_platform_part.h" 124 #include "chrome/browser/browser_process_platform_part.h"
125 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" 125 #include "chrome/browser/chromeos/accessibility/accessibility_util.h"
126 #include "chrome/browser/chromeos/arc/arc_session_manager.h"
127 #include "chrome/browser/chromeos/arc/arc_util.h" 126 #include "chrome/browser/chromeos/arc/arc_util.h"
128 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h" 127 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h"
129 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" 128 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h"
130 #include "chrome/browser/chromeos/net/wake_on_wifi_manager.h" 129 #include "chrome/browser/chromeos/net/wake_on_wifi_manager.h"
131 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" 130 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
132 #include "chrome/browser/chromeos/profiles/profile_helper.h" 131 #include "chrome/browser/chromeos/profiles/profile_helper.h"
133 #include "chrome/browser/chromeos/reset/metrics.h" 132 #include "chrome/browser/chromeos/reset/metrics.h"
134 #include "chrome/browser/chromeos/settings/cros_settings.h" 133 #include "chrome/browser/chromeos/settings/cros_settings.h"
135 #include "chrome/browser/chromeos/system/timezone_util.h" 134 #include "chrome/browser/chromeos/system/timezone_util.h"
136 #include "chrome/browser/policy/profile_policy_connector.h" 135 #include "chrome/browser/policy/profile_policy_connector.h"
(...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after
1212 std::string())) 1211 std::string()))
1213 .Get(policy::key::kUserAvatarImage)); 1212 .Get(policy::key::kUserAvatarImage));
1214 1213
1215 OnWallpaperManagedChanged( 1214 OnWallpaperManagedChanged(
1216 chromeos::WallpaperManager::Get()->IsPolicyControlled( 1215 chromeos::WallpaperManager::Get()->IsPolicyControlled(
1217 user->GetAccountId())); 1216 user->GetAccountId()));
1218 1217
1219 if (arc::IsArcAllowedForProfile(profile) && 1218 if (arc::IsArcAllowedForProfile(profile) &&
1220 !arc::IsArcOptInVerificationDisabled()) { 1219 !arc::IsArcOptInVerificationDisabled()) {
1221 base::FundamentalValue is_arc_enabled( 1220 base::FundamentalValue is_arc_enabled(
1222 arc::ArcSessionManager::Get()->IsArcPlayStoreEnabled()); 1221 arc::IsArcPlayStoreEnabledForProfile(profile));
1223 web_ui()->CallJavascriptFunctionUnsafe( 1222 web_ui()->CallJavascriptFunctionUnsafe(
1224 "BrowserOptions.showAndroidAppsSection", 1223 "BrowserOptions.showAndroidAppsSection",
1225 is_arc_enabled); 1224 is_arc_enabled);
1226 // Get the initial state of Android Settings app readiness. 1225 // Get the initial state of Android Settings app readiness.
1227 std::unique_ptr<ArcAppListPrefs::AppInfo> app_info = 1226 std::unique_ptr<ArcAppListPrefs::AppInfo> app_info =
1228 ArcAppListPrefs::Get(profile)->GetApp(arc::kSettingsAppId); 1227 ArcAppListPrefs::Get(profile)->GetApp(arc::kSettingsAppId);
1229 if (app_info && app_info->ready) 1228 if (app_info && app_info->ready)
1230 UpdateAndroidSettingsAppState(app_info->ready); 1229 UpdateAndroidSettingsAppState(app_info->ready);
1231 } 1230 }
1232 1231
(...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after
2362 2361
2363 bool BrowserOptionsHandler::IsDeviceOwnerProfile() { 2362 bool BrowserOptionsHandler::IsDeviceOwnerProfile() {
2364 #if defined(OS_CHROMEOS) 2363 #if defined(OS_CHROMEOS)
2365 return chromeos::ProfileHelper::IsOwnerProfile(Profile::FromWebUI(web_ui())); 2364 return chromeos::ProfileHelper::IsOwnerProfile(Profile::FromWebUI(web_ui()));
2366 #else 2365 #else
2367 return true; 2366 return true;
2368 #endif 2367 #endif
2369 } 2368 }
2370 2369
2371 } // namespace options 2370 } // namespace options
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698