| 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 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 882 return appinfo; | 882 return appinfo; |
| 883 } | 883 } |
| 884 | 884 |
| 885 std::string AddArcAppAndShortcut(const arc::mojom::AppInfo& app_info) { | 885 std::string AddArcAppAndShortcut(const arc::mojom::AppInfo& app_info) { |
| 886 ArcAppListPrefs* const prefs = arc_test_.arc_app_list_prefs(); | 886 ArcAppListPrefs* const prefs = arc_test_.arc_app_list_prefs(); |
| 887 // Adding app to the prefs, and check that the app is accessible by id. | 887 // Adding app to the prefs, and check that the app is accessible by id. |
| 888 prefs->AddAppAndShortcut( | 888 prefs->AddAppAndShortcut( |
| 889 app_info.name, app_info.package_name, app_info.activity, | 889 app_info.name, app_info.package_name, app_info.activity, |
| 890 std::string() /* intent_uri */, std::string() /* icon_resource_id */, | 890 std::string() /* intent_uri */, std::string() /* icon_resource_id */, |
| 891 false /* sticky */, true /* notifications_enabled */, | 891 false /* sticky */, true /* notifications_enabled */, |
| 892 false /* shortcut */, app_info.orientation_lock); | 892 false /* shortcut */, true /* launchable */, app_info.orientation_lock); |
| 893 const std::string app_id = | 893 const std::string app_id = |
| 894 ArcAppListPrefs::GetAppId(app_info.package_name, app_info.activity); | 894 ArcAppListPrefs::GetAppId(app_info.package_name, app_info.activity); |
| 895 EXPECT_TRUE(prefs->GetApp(app_id)); | 895 EXPECT_TRUE(prefs->GetApp(app_id)); |
| 896 return app_id; | 896 return app_id; |
| 897 } | 897 } |
| 898 | 898 |
| 899 void NotifyOnTaskCreated(const arc::mojom::AppInfo& appinfo, | 899 void NotifyOnTaskCreated(const arc::mojom::AppInfo& appinfo, |
| 900 int32_t task_id) { | 900 int32_t task_id) { |
| 901 ArcAppListPrefs* const prefs = arc_test_.arc_app_list_prefs(); | 901 ArcAppListPrefs* const prefs = arc_test_.arc_app_list_prefs(); |
| 902 prefs->OnTaskCreated(task_id, appinfo.package_name, appinfo.activity); | 902 prefs->OnTaskCreated(task_id, appinfo.package_name, appinfo.activity, |
| 903 appinfo.name); |
| 903 } | 904 } |
| 904 | 905 |
| 905 void NotifyOnTaskOrientationLockRequested(int32_t task_id, | 906 void NotifyOnTaskOrientationLockRequested(int32_t task_id, |
| 906 OrientationLock lock) { | 907 OrientationLock lock) { |
| 907 ArcAppListPrefs* const prefs = arc_test_.arc_app_list_prefs(); | 908 ArcAppListPrefs* const prefs = arc_test_.arc_app_list_prefs(); |
| 908 prefs->OnTaskOrientationLockRequested(task_id, lock); | 909 prefs->OnTaskOrientationLockRequested(task_id, lock); |
| 909 } | 910 } |
| 910 | 911 |
| 911 // Needed for extension service & friends to work. | 912 // Needed for extension service & friends to work. |
| 912 scoped_refptr<Extension> extension1_; | 913 scoped_refptr<Extension> extension1_; |
| (...skipping 2789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3702 EXPECT_FALSE(controller->rotation_locked()); | 3703 EXPECT_FALSE(controller->rotation_locked()); |
| 3703 EXPECT_EQ(display::Display::ROTATE_0, | 3704 EXPECT_EQ(display::Display::ROTATE_0, |
| 3704 display::Screen::GetScreen()->GetPrimaryDisplay().rotation()); | 3705 display::Screen::GetScreen()->GetPrimaryDisplay().rotation()); |
| 3705 | 3706 |
| 3706 NotifyOnTaskOrientationLockRequested(task_id_current_, | 3707 NotifyOnTaskOrientationLockRequested(task_id_current_, |
| 3707 OrientationLock::CURRENT); | 3708 OrientationLock::CURRENT); |
| 3708 EXPECT_TRUE(controller->rotation_locked()); | 3709 EXPECT_TRUE(controller->rotation_locked()); |
| 3709 EXPECT_EQ(display::Display::ROTATE_0, | 3710 EXPECT_EQ(display::Display::ROTATE_0, |
| 3710 display::Screen::GetScreen()->GetPrimaryDisplay().rotation()); | 3711 display::Screen::GetScreen()->GetPrimaryDisplay().rotation()); |
| 3711 } | 3712 } |
| OLD | NEW |