OLD | NEW |
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/profile_manager.h" | 7 #include "chrome/browser/profile_manager.h" |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 if (GetProfileByPath(profile->GetPath())) { | 184 if (GetProfileByPath(profile->GetPath())) { |
185 NOTREACHED() << "Attempted to add profile with the same path (" << | 185 NOTREACHED() << "Attempted to add profile with the same path (" << |
186 profile->GetPath().value() << | 186 profile->GetPath().value() << |
187 ") as an already-loaded profile."; | 187 ") as an already-loaded profile."; |
188 return false; | 188 return false; |
189 } | 189 } |
190 | 190 |
191 profiles_.insert(profiles_.end(), profile); | 191 profiles_.insert(profiles_.end(), profile); |
192 if (init_extensions) | 192 if (init_extensions) |
193 profile->InitExtensions(); | 193 profile->InitExtensions(); |
194 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | |
195 if (!command_line.HasSwitch(switches::kDisableWebResources)) | |
196 profile->InitWebResources(); | |
197 return true; | 194 return true; |
198 } | 195 } |
199 | 196 |
200 Profile* ProfileManager::GetProfileByPath(const FilePath& path) const { | 197 Profile* ProfileManager::GetProfileByPath(const FilePath& path) const { |
201 for (const_iterator i(begin()); i != end(); ++i) { | 198 for (const_iterator i(begin()); i != end(); ++i) { |
202 if ((*i)->GetPath() == path) | 199 if ((*i)->GetPath() == path) |
203 return *i; | 200 return *i; |
204 } | 201 } |
205 | 202 |
206 return NULL; | 203 return NULL; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 if (!file_util::PathExists(path)) { | 283 if (!file_util::PathExists(path)) { |
287 // TODO(tc): http://b/1094718 Bad things happen if we can't write to the | 284 // TODO(tc): http://b/1094718 Bad things happen if we can't write to the |
288 // profile directory. We should eventually be able to run in this | 285 // profile directory. We should eventually be able to run in this |
289 // situation. | 286 // situation. |
290 if (!file_util::CreateDirectory(path)) | 287 if (!file_util::CreateDirectory(path)) |
291 return NULL; | 288 return NULL; |
292 } | 289 } |
293 | 290 |
294 return Profile::CreateProfile(path); | 291 return Profile::CreateProfile(path); |
295 } | 292 } |
OLD | NEW |