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

Side by Side Diff: chrome/browser/extensions/settings/settings_test_util.cc

Issue 10696208: Move ExtensionEventRouter and related into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed bug + latest master Created 8 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
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/extensions/settings/settings_test_util.h" 5 #include "chrome/browser/extensions/settings/settings_test_util.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "chrome/common/extensions/extension.h" 8 #include "chrome/common/extensions/extension.h"
9 #include "chrome/browser/extensions/settings/settings_frontend.h" 9 #include "chrome/browser/extensions/settings/settings_frontend.h"
10 10
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 for (std::set<std::string>::const_iterator it = permissions_set.begin(); 102 for (std::set<std::string>::const_iterator it = permissions_set.begin();
103 it != permissions_set.end(); ++it) { 103 it != permissions_set.end(); ++it) {
104 DCHECK(extension->HasAPIPermission(*it)); 104 DCHECK(extension->HasAPIPermission(*it));
105 } 105 }
106 } 106 }
107 107
108 // MockProfile 108 // MockProfile
109 109
110 MockProfile::MockProfile(const FilePath& file_path) 110 MockProfile::MockProfile(const FilePath& file_path)
111 : TestingProfile(file_path) { 111 : TestingProfile(file_path) {
112 event_router_.reset(new ExtensionEventRouter(this)); 112 event_router_.reset(new EventRouter(this));
113 } 113 }
114 114
115 MockProfile::~MockProfile() {} 115 MockProfile::~MockProfile() {}
116 116
117 MockExtensionService* MockProfile::GetMockExtensionService() { 117 MockExtensionService* MockProfile::GetMockExtensionService() {
118 return &extension_service_; 118 return &extension_service_;
119 } 119 }
120 120
121 ExtensionService* MockProfile::GetExtensionService() { 121 ExtensionService* MockProfile::GetExtensionService() {
122 ExtensionServiceInterface* as_interface = 122 ExtensionServiceInterface* as_interface =
123 static_cast<ExtensionServiceInterface*>(&extension_service_); 123 static_cast<ExtensionServiceInterface*>(&extension_service_);
124 return static_cast<ExtensionService*>(as_interface); 124 return static_cast<ExtensionService*>(as_interface);
125 } 125 }
126 126
127 ExtensionEventRouter* MockProfile::GetExtensionEventRouter() { 127 EventRouter* MockProfile::GetExtensionEventRouter() {
128 return event_router_.get(); 128 return event_router_.get();
129 } 129 }
130 130
131 // ScopedSettingsFactory 131 // ScopedSettingsFactory
132 132
133 ScopedSettingsStorageFactory::ScopedSettingsStorageFactory() {} 133 ScopedSettingsStorageFactory::ScopedSettingsStorageFactory() {}
134 134
135 ScopedSettingsStorageFactory::ScopedSettingsStorageFactory( 135 ScopedSettingsStorageFactory::ScopedSettingsStorageFactory(
136 const scoped_refptr<SettingsStorageFactory>& delegate) 136 const scoped_refptr<SettingsStorageFactory>& delegate)
137 : delegate_(delegate) {} 137 : delegate_(delegate) {}
138 138
139 ScopedSettingsStorageFactory::~ScopedSettingsStorageFactory() {} 139 ScopedSettingsStorageFactory::~ScopedSettingsStorageFactory() {}
140 140
141 void ScopedSettingsStorageFactory::Reset( 141 void ScopedSettingsStorageFactory::Reset(
142 const scoped_refptr<SettingsStorageFactory>& delegate) { 142 const scoped_refptr<SettingsStorageFactory>& delegate) {
143 delegate_ = delegate; 143 delegate_ = delegate;
144 } 144 }
145 145
146 ValueStore* ScopedSettingsStorageFactory::Create( 146 ValueStore* ScopedSettingsStorageFactory::Create(
147 const FilePath& base_path, const std::string& extension_id) { 147 const FilePath& base_path, const std::string& extension_id) {
148 DCHECK(delegate_.get()); 148 DCHECK(delegate_.get());
149 return delegate_->Create(base_path, extension_id); 149 return delegate_->Create(base_path, extension_id);
150 } 150 }
151 151
152 } // namespace settings_test_util 152 } // namespace settings_test_util
153 153
154 } // namespace extensions 154 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/settings/settings_test_util.h ('k') | chrome/browser/extensions/system/system_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698