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