| 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/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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |