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

Side by Side Diff: chrome/browser/sync/glue/extension_change_processor.cc

Issue 3063002: Merge 53127 - Added checks to handle unsyncable extensions.... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/472/src/
Patch Set: Created 10 years, 5 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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/glue/extension_change_processor.h" 5 #include "chrome/browser/sync/glue/extension_change_processor.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 #include <string> 8 #include <string>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 DCHECK(running()); 44 DCHECK(running());
45 DCHECK(profile_); 45 DCHECK(profile_);
46 switch (type.value) { 46 switch (type.value) {
47 case NotificationType::EXTENSION_LOADED: 47 case NotificationType::EXTENSION_LOADED:
48 case NotificationType::EXTENSION_UPDATE_DISABLED: 48 case NotificationType::EXTENSION_UPDATE_DISABLED:
49 case NotificationType::EXTENSION_UNLOADED: 49 case NotificationType::EXTENSION_UNLOADED:
50 case NotificationType::EXTENSION_UNLOADED_DISABLED: { 50 case NotificationType::EXTENSION_UNLOADED_DISABLED: {
51 DCHECK_EQ(Source<Profile>(source).ptr(), profile_); 51 DCHECK_EQ(Source<Profile>(source).ptr(), profile_);
52 Extension* extension = Details<Extension>(details).ptr(); 52 Extension* extension = Details<Extension>(details).ptr();
53 CHECK(extension); 53 CHECK(extension);
54 // Ignore non-syncable extensions.
54 if (!IsExtensionSyncable(*extension)) { 55 if (!IsExtensionSyncable(*extension)) {
55 return; 56 return;
56 } 57 }
57 const std::string& id = extension->id(); 58 const std::string& id = extension->id();
58 LOG(INFO) << "Got change notification of type " << type.value 59 LOG(INFO) << "Got change notification of type " << type.value
59 << " for extension " << id; 60 << " for extension " << id;
60 if (!extension_model_associator_->OnClientUpdate(id)) { 61 if (!extension_model_associator_->OnClientUpdate(id)) {
61 std::string error = std::string("Client update failed for ") + id; 62 std::string error = std::string("Client update failed for ") + id;
62 error_handler()->OnUnrecoverableError(FROM_HERE, error); 63 error_handler()->OnUnrecoverableError(FROM_HERE, error);
63 return; 64 return;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 } 165 }
165 166
166 void ExtensionChangeProcessor::StopObserving() { 167 void ExtensionChangeProcessor::StopObserving() {
167 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); 168 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
168 DCHECK(profile_); 169 DCHECK(profile_);
169 LOG(INFO) << "Unobserving all notifications"; 170 LOG(INFO) << "Unobserving all notifications";
170 notification_registrar_.RemoveAll(); 171 notification_registrar_.RemoveAll();
171 } 172 }
172 173
173 } // namespace browser_sync 174 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extensions_service_unittest.cc ('k') | chrome/browser/sync/glue/extension_model_associator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698