| 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 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 appinfo.package_name = package_name; | 866 appinfo.package_name = package_name; |
| 867 appinfo.activity = activity; | 867 appinfo.activity = activity; |
| 868 appinfo.orientation_lock = lock; | 868 appinfo.orientation_lock = lock; |
| 869 return appinfo; | 869 return appinfo; |
| 870 } | 870 } |
| 871 | 871 |
| 872 std::string AddArcAppAndShortcut(const arc::mojom::AppInfo& app_info) { | 872 std::string AddArcAppAndShortcut(const arc::mojom::AppInfo& app_info) { |
| 873 ArcAppListPrefs* const prefs = arc_test_.arc_app_list_prefs(); | 873 ArcAppListPrefs* const prefs = arc_test_.arc_app_list_prefs(); |
| 874 // Adding app to the prefs, and check that the app is accessible by id. | 874 // Adding app to the prefs, and check that the app is accessible by id. |
| 875 prefs->AddAppAndShortcut( | 875 prefs->AddAppAndShortcut( |
| 876 app_info.name, app_info.package_name, app_info.activity, | 876 true /* app_ready */, app_info.name, app_info.package_name, |
| 877 std::string() /* intent_uri */, std::string() /* icon_resource_id */, | 877 app_info.activity, std::string() /* intent_uri */, |
| 878 false /* sticky */, true /* notifications_enabled */, | 878 std::string() /* icon_resource_id */, false /* sticky */, |
| 879 false /* shortcut */, true /* launchable */, app_info.orientation_lock); | 879 true /* notifications_enabled */, false /* shortcut */, |
| 880 true /* launchable */, app_info.orientation_lock); |
| 880 const std::string app_id = | 881 const std::string app_id = |
| 881 ArcAppListPrefs::GetAppId(app_info.package_name, app_info.activity); | 882 ArcAppListPrefs::GetAppId(app_info.package_name, app_info.activity); |
| 882 EXPECT_TRUE(prefs->GetApp(app_id)); | 883 EXPECT_TRUE(prefs->GetApp(app_id)); |
| 883 return app_id; | 884 return app_id; |
| 884 } | 885 } |
| 885 | 886 |
| 886 void NotifyOnTaskCreated(const arc::mojom::AppInfo& appinfo, | 887 void NotifyOnTaskCreated(const arc::mojom::AppInfo& appinfo, |
| 887 int32_t task_id) { | 888 int32_t task_id) { |
| 888 ArcAppListPrefs* const prefs = arc_test_.arc_app_list_prefs(); | 889 ArcAppListPrefs* const prefs = arc_test_.arc_app_list_prefs(); |
| 889 prefs->OnTaskCreated(task_id, appinfo.package_name, appinfo.activity, | 890 prefs->OnTaskCreated(task_id, appinfo.package_name, appinfo.activity, |
| (...skipping 2893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3783 EXPECT_TRUE(launcher_controller_->GetArcDeferredLauncher()->HasApp(app_id)); | 3784 EXPECT_TRUE(launcher_controller_->GetArcDeferredLauncher()->HasApp(app_id)); |
| 3784 | 3785 |
| 3785 std::string window_app_id("org.chromium.arc.1"); | 3786 std::string window_app_id("org.chromium.arc.1"); |
| 3786 CreateArcWindow(window_app_id); | 3787 CreateArcWindow(window_app_id); |
| 3787 arc_test_.app_instance()->SendTaskCreated(1, | 3788 arc_test_.app_instance()->SendTaskCreated(1, |
| 3788 arc_test_.fake_default_apps()[0]); | 3789 arc_test_.fake_default_apps()[0]); |
| 3789 | 3790 |
| 3790 EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(app_id)); | 3791 EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(app_id)); |
| 3791 EXPECT_FALSE(launcher_controller_->GetArcDeferredLauncher()->HasApp(app_id)); | 3792 EXPECT_FALSE(launcher_controller_->GetArcDeferredLauncher()->HasApp(app_id)); |
| 3792 } | 3793 } |
| OLD | NEW |