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

Side by Side Diff: chrome/browser/profiles/profile_manager.cc

Issue 6542003: Refactor WebResourceService class, making it more generic. Move all the prom... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: For the records Created 9 years, 10 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 <set> 5 #include <set>
6 6
7 #include "chrome/browser/profiles/profile_manager.h" 7 #include "chrome/browser/profiles/profile_manager.h"
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 profile->GetPath().value() << 172 profile->GetPath().value() <<
173 ") as an already-loaded profile."; 173 ") as an already-loaded profile.";
174 return false; 174 return false;
175 } 175 }
176 176
177 profiles_.insert(profiles_.end(), profile); 177 profiles_.insert(profiles_.end(), profile);
178 if (init_extensions) 178 if (init_extensions)
179 profile->InitExtensions(); 179 profile->InitExtensions();
180 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 180 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
181 if (!command_line.HasSwitch(switches::kDisableWebResources)) 181 if (!command_line.HasSwitch(switches::kDisableWebResources))
182 profile->InitWebResources(); 182 profile->InitPromoResources();
183 return true; 183 return true;
184 } 184 }
185 185
186 Profile* ProfileManager::GetProfileByPath(const FilePath& path) const { 186 Profile* ProfileManager::GetProfileByPath(const FilePath& path) const {
187 for (const_iterator i(begin()); i != end(); ++i) { 187 for (const_iterator i(begin()); i != end(); ++i) {
188 if ((*i)->GetPath() == path) 188 if ((*i)->GetPath() == path)
189 return *i; 189 return *i;
190 } 190 }
191 191
192 return NULL; 192 return NULL;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 if (!file_util::PathExists(path)) { 273 if (!file_util::PathExists(path)) {
274 // TODO(tc): http://b/1094718 Bad things happen if we can't write to the 274 // TODO(tc): http://b/1094718 Bad things happen if we can't write to the
275 // profile directory. We should eventually be able to run in this 275 // profile directory. We should eventually be able to run in this
276 // situation. 276 // situation.
277 if (!file_util::CreateDirectory(path)) 277 if (!file_util::CreateDirectory(path))
278 return NULL; 278 return NULL;
279 } 279 }
280 280
281 return Profile::CreateProfile(path); 281 return Profile::CreateProfile(path);
282 } 282 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_impl.cc ('k') | chrome/browser/web_resource/promo_resource_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698