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

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

Issue 10977048: Fix bug in disabling sync for default apps (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fix browser and integration tests, which got broken Created 8 years, 2 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) 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/sync_extension_helper.h" 5 #include "chrome/browser/sync/test/integration/sync_extension_helper.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 } 64 }
65 65
66 std::string SyncExtensionHelper::InstallExtension( 66 std::string SyncExtensionHelper::InstallExtension(
67 Profile* profile, const std::string& name, Extension::Type type) { 67 Profile* profile, const std::string& name, Extension::Type type) {
68 scoped_refptr<Extension> extension = GetExtension(profile, name, type); 68 scoped_refptr<Extension> extension = GetExtension(profile, name, type);
69 if (!extension.get()) { 69 if (!extension.get()) {
70 NOTREACHED() << "Could not install extension " << name; 70 NOTREACHED() << "Could not install extension " << name;
71 return ""; 71 return "";
72 } 72 }
73 profile->GetExtensionService()->OnExtensionInstalled( 73 profile->GetExtensionService()->OnExtensionInstalled(
74 extension, extension->UpdatesFromGallery(), syncer::StringOrdinal(), 74 extension, syncer::StringOrdinal(), false /* no requirement errors */);
75 false /* no requirement errors */);
76 return extension->id(); 75 return extension->id();
77 } 76 }
78 77
79 void SyncExtensionHelper::UninstallExtension( 78 void SyncExtensionHelper::UninstallExtension(
80 Profile* profile, const std::string& name) { 79 Profile* profile, const std::string& name) {
81 ExtensionService::UninstallExtensionHelper(profile->GetExtensionService(), 80 ExtensionService::UninstallExtensionHelper(profile->GetExtensionService(),
82 NameToId(name)); 81 NameToId(name));
83 } 82 }
84 83
85 std::vector<std::string> SyncExtensionHelper::GetInstalledExtensionNames( 84 std::vector<std::string> SyncExtensionHelper::GetInstalledExtensionNames(
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 if (extension->id() != expected_id) { 347 if (extension->id() != expected_id) {
349 EXPECT_EQ(expected_id, extension->id()); 348 EXPECT_EQ(expected_id, extension->id());
350 return NULL; 349 return NULL;
351 } 350 }
352 DVLOG(2) << "created extension with name = " 351 DVLOG(2) << "created extension with name = "
353 << name << ", id = " << expected_id; 352 << name << ", id = " << expected_id;
354 (it->second)[name] = extension; 353 (it->second)[name] = extension;
355 id_to_name_[expected_id] = name; 354 id_to_name_[expected_id] = name;
356 return extension; 355 return extension;
357 } 356 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698