| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chrome_launcher_controller_impl.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 appinfo.package_name = package_name; | 869 appinfo.package_name = package_name; |
| 870 appinfo.activity = activity; | 870 appinfo.activity = activity; |
| 871 appinfo.orientation_lock = lock; | 871 appinfo.orientation_lock = lock; |
| 872 return appinfo; | 872 return appinfo; |
| 873 } | 873 } |
| 874 | 874 |
| 875 std::string AddArcAppAndShortcut(const arc::mojom::AppInfo& app_info) { | 875 std::string AddArcAppAndShortcut(const arc::mojom::AppInfo& app_info) { |
| 876 ArcAppListPrefs* const prefs = arc_test_.arc_app_list_prefs(); | 876 ArcAppListPrefs* const prefs = arc_test_.arc_app_list_prefs(); |
| 877 // Adding app to the prefs, and check that the app is accessible by id. | 877 // Adding app to the prefs, and check that the app is accessible by id. |
| 878 prefs->AddAppAndShortcut( | 878 prefs->AddAppAndShortcut( |
| 879 app_info.name, app_info.package_name, app_info.activity, | 879 true /* app_ready */, app_info.name, app_info.package_name, |
| 880 std::string() /* intent_uri */, std::string() /* icon_resource_id */, | 880 app_info.activity, std::string() /* intent_uri */, |
| 881 false /* sticky */, true /* notifications_enabled */, | 881 std::string() /* icon_resource_id */, false /* sticky */, |
| 882 false /* shortcut */, true /* launchable */, app_info.orientation_lock); | 882 true /* notifications_enabled */, false /* shortcut */, |
| 883 true /* launchable */, app_info.orientation_lock); |
| 883 const std::string app_id = | 884 const std::string app_id = |
| 884 ArcAppListPrefs::GetAppId(app_info.package_name, app_info.activity); | 885 ArcAppListPrefs::GetAppId(app_info.package_name, app_info.activity); |
| 885 EXPECT_TRUE(prefs->GetApp(app_id)); | 886 EXPECT_TRUE(prefs->GetApp(app_id)); |
| 886 return app_id; | 887 return app_id; |
| 887 } | 888 } |
| 888 | 889 |
| 889 void NotifyOnTaskCreated(const arc::mojom::AppInfo& appinfo, | 890 void NotifyOnTaskCreated(const arc::mojom::AppInfo& appinfo, |
| 890 int32_t task_id) { | 891 int32_t task_id) { |
| 891 ArcAppListPrefs* const prefs = arc_test_.arc_app_list_prefs(); | 892 ArcAppListPrefs* const prefs = arc_test_.arc_app_list_prefs(); |
| 892 prefs->OnTaskCreated(task_id, appinfo.package_name, appinfo.activity, | 893 prefs->OnTaskCreated(task_id, appinfo.package_name, appinfo.activity, |
| (...skipping 2939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3832 EXPECT_TRUE(launcher_controller_->GetArcDeferredLauncher()->HasApp(app_id)); | 3833 EXPECT_TRUE(launcher_controller_->GetArcDeferredLauncher()->HasApp(app_id)); |
| 3833 | 3834 |
| 3834 std::string window_app_id("org.chromium.arc.1"); | 3835 std::string window_app_id("org.chromium.arc.1"); |
| 3835 CreateArcWindow(window_app_id); | 3836 CreateArcWindow(window_app_id); |
| 3836 arc_test_.app_instance()->SendTaskCreated(1, | 3837 arc_test_.app_instance()->SendTaskCreated(1, |
| 3837 arc_test_.fake_default_apps()[0]); | 3838 arc_test_.fake_default_apps()[0]); |
| 3838 | 3839 |
| 3839 EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(app_id)); | 3840 EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(app_id)); |
| 3840 EXPECT_FALSE(launcher_controller_->GetArcDeferredLauncher()->HasApp(app_id)); | 3841 EXPECT_FALSE(launcher_controller_->GetArcDeferredLauncher()->HasApp(app_id)); |
| 3841 } | 3842 } |
| OLD | NEW |