| 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 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 865 return appinfo; | 865 return appinfo; |
| 866 } | 866 } |
| 867 | 867 |
| 868 std::string AddArcAppAndShortcut(const arc::mojom::AppInfo& app_info) { | 868 std::string AddArcAppAndShortcut(const arc::mojom::AppInfo& app_info) { |
| 869 ArcAppListPrefs* const prefs = arc_test_.arc_app_list_prefs(); | 869 ArcAppListPrefs* const prefs = arc_test_.arc_app_list_prefs(); |
| 870 // Adding app to the prefs, and check that the app is accessible by id. | 870 // Adding app to the prefs, and check that the app is accessible by id. |
| 871 prefs->AddAppAndShortcut( | 871 prefs->AddAppAndShortcut( |
| 872 app_info.name, app_info.package_name, app_info.activity, | 872 app_info.name, app_info.package_name, app_info.activity, |
| 873 std::string() /* intent_uri */, std::string() /* icon_resource_id */, | 873 std::string() /* intent_uri */, std::string() /* icon_resource_id */, |
| 874 false /* sticky */, true /* notifications_enabled */, | 874 false /* sticky */, true /* notifications_enabled */, |
| 875 false /* shortcut */, app_info.orientation_lock); | 875 false /* shortcut */, true /* launchable */, app_info.orientation_lock); |
| 876 const std::string app_id = | 876 const std::string app_id = |
| 877 ArcAppListPrefs::GetAppId(app_info.package_name, app_info.activity); | 877 ArcAppListPrefs::GetAppId(app_info.package_name, app_info.activity); |
| 878 EXPECT_TRUE(prefs->GetApp(app_id)); | 878 EXPECT_TRUE(prefs->GetApp(app_id)); |
| 879 return app_id; | 879 return app_id; |
| 880 } | 880 } |
| 881 | 881 |
| 882 void NotifyOnTaskCreated(const arc::mojom::AppInfo& appinfo, | 882 void NotifyOnTaskCreated(const arc::mojom::AppInfo& appinfo, |
| 883 int32_t task_id) { | 883 int32_t task_id) { |
| 884 ArcAppListPrefs* const prefs = arc_test_.arc_app_list_prefs(); | 884 ArcAppListPrefs* const prefs = arc_test_.arc_app_list_prefs(); |
| 885 prefs->OnTaskCreated(task_id, appinfo.package_name, appinfo.activity); | 885 prefs->OnTaskCreated(task_id, appinfo.package_name, appinfo.activity, |
| 886 appinfo.name); |
| 886 } | 887 } |
| 887 | 888 |
| 888 void NotifyOnTaskOrientationLockRequested(int32_t task_id, | 889 void NotifyOnTaskOrientationLockRequested(int32_t task_id, |
| 889 OrientationLock lock) { | 890 OrientationLock lock) { |
| 890 ArcAppListPrefs* const prefs = arc_test_.arc_app_list_prefs(); | 891 ArcAppListPrefs* const prefs = arc_test_.arc_app_list_prefs(); |
| 891 prefs->OnTaskOrientationLockRequested(task_id, lock); | 892 prefs->OnTaskOrientationLockRequested(task_id, lock); |
| 892 } | 893 } |
| 893 | 894 |
| 894 // Needed for extension service & friends to work. | 895 // Needed for extension service & friends to work. |
| 895 scoped_refptr<Extension> extension1_; | 896 scoped_refptr<Extension> extension1_; |
| (...skipping 2757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3653 EXPECT_FALSE(controller->rotation_locked()); | 3654 EXPECT_FALSE(controller->rotation_locked()); |
| 3654 EXPECT_EQ(display::Display::ROTATE_0, | 3655 EXPECT_EQ(display::Display::ROTATE_0, |
| 3655 display::Screen::GetScreen()->GetPrimaryDisplay().rotation()); | 3656 display::Screen::GetScreen()->GetPrimaryDisplay().rotation()); |
| 3656 | 3657 |
| 3657 NotifyOnTaskOrientationLockRequested(task_id_current_, | 3658 NotifyOnTaskOrientationLockRequested(task_id_current_, |
| 3658 OrientationLock::CURRENT); | 3659 OrientationLock::CURRENT); |
| 3659 EXPECT_TRUE(controller->rotation_locked()); | 3660 EXPECT_TRUE(controller->rotation_locked()); |
| 3660 EXPECT_EQ(display::Display::ROTATE_0, | 3661 EXPECT_EQ(display::Display::ROTATE_0, |
| 3661 display::Screen::GetScreen()->GetPrimaryDisplay().rotation()); | 3662 display::Screen::GetScreen()->GetPrimaryDisplay().rotation()); |
| 3662 } | 3663 } |
| OLD | NEW |