OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <windows.h> | 5 #include <windows.h> |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "chrome/browser/profile_manager.h" | 9 #include "chrome/browser/profile_manager.h" |
10 | 10 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 profile = Profile::CreateProfile(path); | 116 profile = Profile::CreateProfile(path); |
117 if (AddProfile(profile)) { | 117 if (AddProfile(profile)) { |
118 return profile; | 118 return profile; |
119 } else { | 119 } else { |
120 return NULL; | 120 return NULL; |
121 } | 121 } |
122 } | 122 } |
123 | 123 |
124 void ProfileManager::NewWindowWithProfile(Profile* profile) { | 124 void ProfileManager::NewWindowWithProfile(Profile* profile) { |
125 DCHECK(profile); | 125 DCHECK(profile); |
126 | 126 Browser* browser = Browser::Create(profile); |
127 Browser* new_browser = new Browser(gfx::Rect(), SW_SHOWNORMAL, profile, | 127 browser->AddTabWithURL(GURL(), GURL(), PageTransition::TYPED, true, NULL); |
128 BrowserType::TABBED_BROWSER, L""); | 128 browser->window()->Show(); |
129 new_browser->AddTabWithURL(GURL(), GURL(), PageTransition::TYPED, true, | |
130 NULL); | |
131 new_browser->Show(); | |
132 } | 129 } |
133 | 130 |
134 Profile* ProfileManager::AddProfileByID(const std::wstring& id) { | 131 Profile* ProfileManager::AddProfileByID(const std::wstring& id) { |
135 AvailableProfile* available = GetAvailableProfileByID(id); | 132 AvailableProfile* available = GetAvailableProfileByID(id); |
136 if (!available) | 133 if (!available) |
137 return NULL; | 134 return NULL; |
138 | 135 |
139 std::wstring path; | 136 std::wstring path; |
140 PathService::Get(chrome::DIR_USER_DATA, &path); | 137 PathService::Get(chrome::DIR_USER_DATA, &path); |
141 file_util::AppendToPath(&path, available->directory()); | 138 file_util::AppendToPath(&path, available->directory()); |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 return profile; | 297 return profile; |
301 } | 298 } |
302 | 299 |
303 // static | 300 // static |
304 std::wstring ProfileManager::CanonicalizeID(const std::wstring& id) { | 301 std::wstring ProfileManager::CanonicalizeID(const std::wstring& id) { |
305 std::wstring no_whitespace; | 302 std::wstring no_whitespace; |
306 TrimWhitespace(id, TRIM_ALL, &no_whitespace); | 303 TrimWhitespace(id, TRIM_ALL, &no_whitespace); |
307 return StringToLowerASCII(no_whitespace); | 304 return StringToLowerASCII(no_whitespace); |
308 } | 305 } |
309 | 306 |
OLD | NEW |