OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/app_list/arc/arc_app_utils.h" | 5 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/feature_list.h" | |
13 #include "base/json/json_writer.h" | 12 #include "base/json/json_writer.h" |
14 #include "base/synchronization/waitable_event.h" | 13 #include "base/synchronization/waitable_event.h" |
15 #include "base/values.h" | 14 #include "base/values.h" |
16 #include "chrome/browser/chromeos/arc/arc_migration_guide_notification.h" | 15 #include "chrome/browser/chromeos/arc/arc_migration_guide_notification.h" |
17 #include "chrome/browser/chromeos/arc/arc_session_manager.h" | 16 #include "chrome/browser/chromeos/arc/arc_session_manager.h" |
18 #include "chrome/browser/chromeos/arc/arc_util.h" | 17 #include "chrome/browser/chromeos/arc/arc_util.h" |
19 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
20 #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" |
21 #include "chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.h" | 20 #include "chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.h" |
22 #include "chrome/browser/ui/ash/launcher/arc_app_shelf_id.h" | 21 #include "chrome/browser/ui/ash/launcher/arc_app_shelf_id.h" |
23 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 22 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
24 #include "components/arc/arc_bridge_service.h" | 23 #include "components/arc/arc_bridge_service.h" |
25 #include "components/arc/arc_features.h" | |
26 #include "components/arc/arc_service_manager.h" | 24 #include "components/arc/arc_service_manager.h" |
27 #include "components/arc/arc_util.h" | 25 #include "components/arc/arc_util.h" |
28 #include "components/arc/common/intent_helper.mojom.h" | 26 #include "components/arc/common/intent_helper.mojom.h" |
29 #include "ui/aura/window.h" | 27 #include "ui/aura/window.h" |
30 #include "ui/display/display.h" | 28 #include "ui/display/display.h" |
31 #include "ui/display/screen.h" | 29 #include "ui/display/screen.h" |
32 #include "ui/events/event_constants.h" | 30 #include "ui/events/event_constants.h" |
33 | 31 |
34 // Helper macro which returns the AppInstance. | 32 // Helper macro which returns the AppInstance. |
35 #define GET_APP_INSTANCE(method_name) \ | 33 #define GET_APP_INSTANCE(method_name) \ |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 | 163 |
166 DISALLOW_COPY_AND_ASSIGN(LaunchAppWithoutSize); | 164 DISALLOW_COPY_AND_ASSIGN(LaunchAppWithoutSize); |
167 }; | 165 }; |
168 | 166 |
169 } // namespace | 167 } // namespace |
170 | 168 |
171 const char kPlayStoreAppId[] = "cnbgggchhmkkdmeppjobngjoejnihlei"; | 169 const char kPlayStoreAppId[] = "cnbgggchhmkkdmeppjobngjoejnihlei"; |
172 const char kLegacyPlayStoreAppId[] = "gpkmicpkkebkmabiaedjognfppcchdfa"; | 170 const char kLegacyPlayStoreAppId[] = "gpkmicpkkebkmabiaedjognfppcchdfa"; |
173 const char kPlayStorePackage[] = "com.android.vending"; | 171 const char kPlayStorePackage[] = "com.android.vending"; |
174 const char kPlayStoreActivity[] = "com.android.vending.AssetBrowserActivity"; | 172 const char kPlayStoreActivity[] = "com.android.vending.AssetBrowserActivity"; |
175 const char kFilesAppId[] = "clippbnfpgifdekheldlleoeiiababjg"; | |
176 const char kSettingsAppId[] = "mconboelelhjpkbdhhiijkgcimoangdj"; | 173 const char kSettingsAppId[] = "mconboelelhjpkbdhhiijkgcimoangdj"; |
177 | 174 |
178 bool ShouldShowInLauncher(const std::string& app_id) { | 175 bool ShouldShowInLauncher(const std::string& app_id) { |
179 if (app_id == kFilesAppId) { | 176 return (app_id != kSettingsAppId); |
180 return base::FeatureList::IsEnabled(kShowArcFilesAppFeature); | |
181 } else { | |
182 return (app_id != kSettingsAppId); | |
183 } | |
184 } | 177 } |
185 | 178 |
186 bool LaunchAppWithRect(content::BrowserContext* context, | 179 bool LaunchAppWithRect(content::BrowserContext* context, |
187 const std::string& app_id, | 180 const std::string& app_id, |
188 const gfx::Rect& target_rect, | 181 const gfx::Rect& target_rect, |
189 int event_flags) { | 182 int event_flags) { |
190 ArcAppListPrefs* prefs = ArcAppListPrefs::Get(context); | 183 ArcAppListPrefs* prefs = ArcAppListPrefs::Get(context); |
191 CHECK(prefs); | 184 CHECK(prefs); |
192 | 185 |
193 std::unique_ptr<ArcAppListPrefs::AppInfo> app_info = prefs->GetApp(app_id); | 186 std::unique_ptr<ArcAppListPrefs::AppInfo> app_info = prefs->GetApp(app_id); |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 return false; | 450 return false; |
458 | 451 |
459 const ArcAppListPrefs* const arc_prefs = ArcAppListPrefs::Get(context); | 452 const ArcAppListPrefs* const arc_prefs = ArcAppListPrefs::Get(context); |
460 if (!arc_prefs) | 453 if (!arc_prefs) |
461 return false; | 454 return false; |
462 | 455 |
463 return arc_prefs->IsRegistered(ArcAppShelfId::FromString(id).app_id()); | 456 return arc_prefs->IsRegistered(ArcAppShelfId::FromString(id).app_id()); |
464 } | 457 } |
465 | 458 |
466 } // namespace arc | 459 } // namespace arc |
OLD | NEW |