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/chromeos/extensions/wallpaper_manager_util.h" | 5 #include "chrome/browser/chromeos/extensions/wallpaper_manager_util.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "chrome/browser/chromeos/arc/arc_session_manager.h" | 10 #include "chrome/browser/chromeos/arc/arc_session_manager.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 const char kAndroidWallpapersAppPackage[] = "com.google.android.apps.wallpaper"; | 31 const char kAndroidWallpapersAppPackage[] = "com.google.android.apps.wallpaper"; |
32 const char kAndroidWallpapersAppActivity[] = | 32 const char kAndroidWallpapersAppActivity[] = |
33 "com.google.android.apps.wallpaper.picker.CategoryPickerActivity"; | 33 "com.google.android.apps.wallpaper.picker.CategoryPickerActivity"; |
34 | 34 |
35 const char kAndroidWallpapersAppTrialName[] = "AndroidWallpapersAppOnChromeOS"; | 35 const char kAndroidWallpapersAppTrialName[] = "AndroidWallpapersAppOnChromeOS"; |
36 const char kEnableAndroidWallpapersApp[] = | 36 const char kEnableAndroidWallpapersApp[] = |
37 "Enable-android-wallpapers-app_Dogfood"; | 37 "Enable-android-wallpapers-app_Dogfood"; |
38 | 38 |
39 } // namespace | 39 } // namespace |
40 | 40 |
41 // Only if the current profile is the primary profile && Arc service is enabled | 41 // Only if the current profile is the primary profile && ARC service is enabled |
42 // && the Android Wallpapers App has been installed && the finch experiment or | 42 // && the Android Wallpapers App has been installed && the finch experiment or |
43 // chrome flag is enabled, launch the Android Wallpapers App. Otherwise launch | 43 // chrome flag is enabled, launch the Android Wallpapers App. Otherwise launch |
44 // the old Chrome OS Wallpaper Picker App. | 44 // the old Chrome OS Wallpaper Picker App. |
45 bool ShouldUseAndroidWallpapersApp(Profile* profile) { | 45 bool ShouldUseAndroidWallpapersApp(Profile* profile) { |
46 if (!chromeos::ProfileHelper::IsPrimaryProfile(profile)) | 46 if (!chromeos::ProfileHelper::IsPrimaryProfile(profile)) |
47 return false; | 47 return false; |
48 | 48 |
49 // Check if the ARC++ is enabled. | 49 // Check if the ARC is enabled. |
50 const arc::ArcSessionManager* const arc_session_manager = | 50 const arc::ArcSessionManager* const arc_session_manager = |
51 arc::ArcSessionManager::Get(); | 51 arc::ArcSessionManager::Get(); |
52 if (!arc_session_manager || !arc_session_manager->IsArcPlayStoreEnabled()) | 52 if (!arc_session_manager || !arc_session_manager->IsArcPlayStoreEnabled()) |
53 return false; | 53 return false; |
54 | 54 |
55 // Check if Android Wallpapers App has been installed. | 55 // Check if Android Wallpapers App has been installed. |
56 const ArcAppListPrefs* const prefs = ArcAppListPrefs::Get(profile); | 56 const ArcAppListPrefs* const prefs = ArcAppListPrefs::Get(profile); |
57 if (!prefs || prefs->GetAppsForPackage(kAndroidWallpapersAppPackage).empty()) | 57 if (!prefs || prefs->GetAppsForPackage(kAndroidWallpapersAppPackage).empty()) |
58 return false; | 58 return false; |
59 | 59 |
(...skipping 27 matching lines...) Expand all Loading... |
87 if (!extension) | 87 if (!extension) |
88 return; | 88 return; |
89 | 89 |
90 OpenApplication(AppLaunchParams( | 90 OpenApplication(AppLaunchParams( |
91 profile, extension, extensions::LAUNCH_CONTAINER_WINDOW, | 91 profile, extension, extensions::LAUNCH_CONTAINER_WINDOW, |
92 WindowOpenDisposition::NEW_WINDOW, extensions::SOURCE_CHROME_INTERNAL)); | 92 WindowOpenDisposition::NEW_WINDOW, extensions::SOURCE_CHROME_INTERNAL)); |
93 } | 93 } |
94 } | 94 } |
95 | 95 |
96 } // namespace wallpaper_manager_util | 96 } // namespace wallpaper_manager_util |
OLD | NEW |