| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/chromeos/note_taking_helper.h" | 5 #include "chrome/browser/chromeos/note_taking_helper.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/common/ash_switches.h" | 9 #include "ash/common/ash_switches.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "chrome/test/base/testing_profile_manager.h" | 28 #include "chrome/test/base/testing_profile_manager.h" |
| 29 #include "chromeos/dbus/dbus_thread_manager.h" | 29 #include "chromeos/dbus/dbus_thread_manager.h" |
| 30 #include "chromeos/dbus/fake_session_manager_client.h" | 30 #include "chromeos/dbus/fake_session_manager_client.h" |
| 31 #include "components/arc/arc_bridge_service.h" | 31 #include "components/arc/arc_bridge_service.h" |
| 32 #include "components/arc/arc_service_manager.h" | 32 #include "components/arc/arc_service_manager.h" |
| 33 #include "components/arc/arc_util.h" | 33 #include "components/arc/arc_util.h" |
| 34 #include "components/arc/common/intent_helper.mojom.h" | 34 #include "components/arc/common/intent_helper.mojom.h" |
| 35 #include "components/arc/test/fake_intent_helper_instance.h" | 35 #include "components/arc/test/fake_intent_helper_instance.h" |
| 36 #include "components/crx_file/id_util.h" | 36 #include "components/crx_file/id_util.h" |
| 37 #include "components/sync_preferences/testing_pref_service_syncable.h" | 37 #include "components/sync_preferences/testing_pref_service_syncable.h" |
| 38 #include "content/public/browser/browser_context.h" |
| 38 #include "content/public/browser/notification_service.h" | 39 #include "content/public/browser/notification_service.h" |
| 39 #include "content/public/browser/notification_source.h" | 40 #include "content/public/browser/notification_source.h" |
| 40 #include "extensions/common/api/app_runtime.h" | 41 #include "extensions/common/api/app_runtime.h" |
| 41 #include "extensions/common/extension_builder.h" | 42 #include "extensions/common/extension_builder.h" |
| 42 #include "extensions/common/extension_id.h" | 43 #include "extensions/common/extension_id.h" |
| 43 #include "extensions/common/value_builder.h" | 44 #include "extensions/common/value_builder.h" |
| 44 #include "url/gurl.h" | 45 #include "url/gurl.h" |
| 45 | 46 |
| 46 namespace app_runtime = extensions::api::app_runtime; | 47 namespace app_runtime = extensions::api::app_runtime; |
| 47 | 48 |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 } | 274 } |
| 274 | 275 |
| 275 // Info about launched Chrome apps, in the order they were launched. | 276 // Info about launched Chrome apps, in the order they were launched. |
| 276 std::vector<ChromeAppLaunchInfo> launched_chrome_apps_; | 277 std::vector<ChromeAppLaunchInfo> launched_chrome_apps_; |
| 277 | 278 |
| 278 arc::FakeIntentHelperInstance intent_helper_; | 279 arc::FakeIntentHelperInstance intent_helper_; |
| 279 std::unique_ptr<TestingProfileManager> profile_manager_; | 280 std::unique_ptr<TestingProfileManager> profile_manager_; |
| 280 | 281 |
| 281 private: | 282 private: |
| 282 // Callback registered with the helper to record Chrome app launch requests. | 283 // Callback registered with the helper to record Chrome app launch requests. |
| 283 void LaunchChromeApp(Profile* passed_profile, | 284 void LaunchChromeApp(content::BrowserContext* passed_context, |
| 284 const extensions::Extension* extension, | 285 const extensions::Extension* extension, |
| 285 std::unique_ptr<app_runtime::ActionData> action_data, | 286 std::unique_ptr<app_runtime::ActionData> action_data, |
| 286 const base::FilePath& path) { | 287 const base::FilePath& path) { |
| 287 EXPECT_EQ(profile(), passed_profile); | 288 EXPECT_EQ(profile(), passed_context); |
| 288 EXPECT_EQ(app_runtime::ActionType::ACTION_TYPE_NEW_NOTE, | 289 EXPECT_EQ(app_runtime::ActionType::ACTION_TYPE_NEW_NOTE, |
| 289 action_data->action_type); | 290 action_data->action_type); |
| 290 launched_chrome_apps_.push_back(ChromeAppLaunchInfo{extension->id(), path}); | 291 launched_chrome_apps_.push_back(ChromeAppLaunchInfo{extension->id(), path}); |
| 291 } | 292 } |
| 292 | 293 |
| 293 // Has Init() been called? | 294 // Has Init() been called? |
| 294 bool initialized_ = false; | 295 bool initialized_ = false; |
| 295 | 296 |
| 296 FakeSessionManagerClient* session_manager_client_ = nullptr; // Not owned. | 297 FakeSessionManagerClient* session_manager_client_ = nullptr; // Not owned. |
| 297 ArcAppTest arc_test_; | 298 ArcAppTest arc_test_; |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 748 InitExtensionService(second_profile); | 749 InitExtensionService(second_profile); |
| 749 EXPECT_EQ(0, observer.num_updates()); | 750 EXPECT_EQ(0, observer.num_updates()); |
| 750 InstallExtension(keep_extension.get(), second_profile); | 751 InstallExtension(keep_extension.get(), second_profile); |
| 751 EXPECT_EQ(1, observer.num_updates()); | 752 EXPECT_EQ(1, observer.num_updates()); |
| 752 UninstallExtension(keep_extension.get(), second_profile); | 753 UninstallExtension(keep_extension.get(), second_profile); |
| 753 EXPECT_EQ(2, observer.num_updates()); | 754 EXPECT_EQ(2, observer.num_updates()); |
| 754 profile_manager_->DeleteTestingProfile(kSecondProfileName); | 755 profile_manager_->DeleteTestingProfile(kSecondProfileName); |
| 755 } | 756 } |
| 756 | 757 |
| 757 } // namespace chromeos | 758 } // namespace chromeos |
| OLD | NEW |