OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/sync/test/integration/apps_helper.h" | 5 #include "chrome/browser/sync/test/integration/apps_helper.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ptr_util.h" |
9 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 11 #include "chrome/browser/chrome_notification_types.h" |
11 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
12 #include "chrome/browser/sync/test/integration/sync_app_helper.h" | 13 #include "chrome/browser/sync/test/integration/sync_app_helper.h" |
13 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" | 14 #include "chrome/browser/sync/test/integration/sync_datatype_helper.h" |
14 #include "chrome/browser/sync/test/integration/sync_extension_helper.h" | 15 #include "chrome/browser/sync/test/integration/sync_extension_helper.h" |
15 #include "chrome/browser/sync/test/integration/sync_extension_installer.h" | 16 #include "chrome/browser/sync/test/integration/sync_extension_installer.h" |
16 #include "content/public/browser/notification_service.h" | 17 #include "content/public/browser/notification_service.h" |
17 #include "extensions/browser/extension_prefs.h" | 18 #include "extensions/browser/extension_prefs.h" |
18 #include "extensions/browser/extension_registry.h" | 19 #include "extensions/browser/extension_registry.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 } | 146 } |
146 | 147 |
147 } // namespace apps_helper | 148 } // namespace apps_helper |
148 | 149 |
149 AppsMatchChecker::AppsMatchChecker() : profiles_(test()->GetAllProfiles()) { | 150 AppsMatchChecker::AppsMatchChecker() : profiles_(test()->GetAllProfiles()) { |
150 DCHECK_GE(profiles_.size(), 2U); | 151 DCHECK_GE(profiles_.size(), 2U); |
151 | 152 |
152 for (Profile* profile : profiles_) { | 153 for (Profile* profile : profiles_) { |
153 // Begin mocking the installation of synced extensions from the web store. | 154 // Begin mocking the installation of synced extensions from the web store. |
154 synced_extension_installers_.push_back( | 155 synced_extension_installers_.push_back( |
155 new SyncedExtensionInstaller(profile)); | 156 base::MakeUnique<SyncedExtensionInstaller>(profile)); |
156 | 157 |
157 // Register as an observer of ExtensionsRegistry to receive notifications of | 158 // Register as an observer of ExtensionsRegistry to receive notifications of |
158 // big events, like installs and uninstalls. | 159 // big events, like installs and uninstalls. |
159 extensions::ExtensionRegistry* registry = | 160 extensions::ExtensionRegistry* registry = |
160 extensions::ExtensionRegistry::Get(profile); | 161 extensions::ExtensionRegistry::Get(profile); |
161 registry->AddObserver(this); | 162 registry->AddObserver(this); |
162 | 163 |
163 // Register for ExtensionPrefs events, too, so we can get notifications | 164 // Register for ExtensionPrefs events, too, so we can get notifications |
164 // about | 165 // about |
165 // smaller but still syncable events, like launch type changes. | 166 // smaller but still syncable events, like launch type changes. |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 CheckExitCondition(); | 258 CheckExitCondition(); |
258 } | 259 } |
259 | 260 |
260 void AppsMatchChecker::Observe(int type, | 261 void AppsMatchChecker::Observe(int type, |
261 const content::NotificationSource& source, | 262 const content::NotificationSource& source, |
262 const content::NotificationDetails& details) { | 263 const content::NotificationDetails& details) { |
263 DCHECK_EQ(chrome::NOTIFICATION_APP_LAUNCHER_REORDERED, type); | 264 DCHECK_EQ(chrome::NOTIFICATION_APP_LAUNCHER_REORDERED, type); |
264 CheckExitCondition(); | 265 CheckExitCondition(); |
265 } | 266 } |
266 | 267 |
OLD | NEW |