Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Side by Side Diff: chrome/browser/sync/test/integration/sync_extension_installer.cc

Issue 425303002: Move extension notifications to extensions/browser/notification_types.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: (extension-notifications) rebase Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/sync_extension_installer.h" 5 #include "chrome/browser/sync/test/integration/sync_extension_installer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "chrome/browser/chrome_notification_types.h" 9 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/sync/test/integration/sync_extension_helper.h" 10 #include "chrome/browser/sync/test/integration/sync_extension_helper.h"
11 #include "content/public/browser/notification_source.h" 11 #include "content/public/browser/notification_source.h"
12 12
13 SyncedExtensionInstaller::SyncedExtensionInstaller(Profile* profile) 13 SyncedExtensionInstaller::SyncedExtensionInstaller(Profile* profile)
14 : profile_(profile), 14 : profile_(profile),
15 weak_ptr_factory_(this) { 15 weak_ptr_factory_(this) {
16 DoInstallSyncedExtensions(); 16 DoInstallSyncedExtensions();
17 registrar_.Add(this, 17 registrar_.Add(this,
18 chrome::NOTIFICATION_EXTENSION_UPDATING_STARTED, 18 extensions::NOTIFICATION_EXTENSION_UPDATING_STARTED,
19 content::Source<Profile>(profile_)); 19 content::Source<Profile>(profile_));
20 } 20 }
21 21
22 SyncedExtensionInstaller::~SyncedExtensionInstaller() { 22 SyncedExtensionInstaller::~SyncedExtensionInstaller() {
23 } 23 }
24 24
25 void SyncedExtensionInstaller::Observe( 25 void SyncedExtensionInstaller::Observe(
26 int type, 26 int type,
27 const content::NotificationSource& source, 27 const content::NotificationSource& source,
28 const content::NotificationDetails& details) { 28 const content::NotificationDetails& details) {
29 DCHECK_EQ(chrome::NOTIFICATION_EXTENSION_UPDATING_STARTED, type); 29 DCHECK_EQ(extensions::NOTIFICATION_EXTENSION_UPDATING_STARTED, type);
30 30
31 // The extension system is trying to check for updates. In the real world, 31 // The extension system is trying to check for updates. In the real world,
32 // this would be where synced extensions are asynchronously downloaded from 32 // this would be where synced extensions are asynchronously downloaded from
33 // the web store and installed. In this test framework, we use this event as 33 // the web store and installed. In this test framework, we use this event as
34 // a signal that it's time to asynchronously fake the installation of these 34 // a signal that it's time to asynchronously fake the installation of these
35 // extensions. 35 // extensions.
36 36
37 base::MessageLoop::current()->PostTask( 37 base::MessageLoop::current()->PostTask(
38 FROM_HERE, 38 FROM_HERE,
39 base::Bind(&SyncedExtensionInstaller::DoInstallSyncedExtensions, 39 base::Bind(&SyncedExtensionInstaller::DoInstallSyncedExtensions,
40 weak_ptr_factory_.GetWeakPtr())); 40 weak_ptr_factory_.GetWeakPtr()));
41 } 41 }
42 42
43 void SyncedExtensionInstaller::DoInstallSyncedExtensions() { 43 void SyncedExtensionInstaller::DoInstallSyncedExtensions() {
44 SyncExtensionHelper::GetInstance()->InstallExtensionsPendingForSync(profile_); 44 SyncExtensionHelper::GetInstance()->InstallExtensionsPendingForSync(profile_);
45 } 45 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698