Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/ui/browser_init.h" | 5 #include "chrome/browser/ui/browser_init.h" |
| 6 | 6 |
| 7 #include <algorithm> // For max(). | 7 #include <algorithm> // For max(). |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1220 params.tabstrip_index = index; | 1220 params.tabstrip_index = index; |
| 1221 params.tabstrip_add_types = add_types; | 1221 params.tabstrip_add_types = add_types; |
| 1222 params.extension_app_id = tabs[i].app_id; | 1222 params.extension_app_id = tabs[i].app_id; |
| 1223 browser::Navigate(¶ms); | 1223 browser::Navigate(¶ms); |
| 1224 | 1224 |
| 1225 first_tab = false; | 1225 first_tab = false; |
| 1226 } | 1226 } |
| 1227 browser->window()->Show(); | 1227 browser->window()->Show(); |
| 1228 // TODO(jcampan): http://crbug.com/8123 we should not need to set the initial | 1228 // TODO(jcampan): http://crbug.com/8123 we should not need to set the initial |
| 1229 // focus explicitly. | 1229 // focus explicitly. |
| 1230 browser->GetSelectedWebContents()->GetView()->SetInitialFocus(); | 1230 if (browser->GetSelectedWebContents()) |
| 1231 browser->GetSelectedWebContents()->GetView()->SetInitialFocus(); | |
|
csilv
2012/02/03 19:43:52
just checking... intentional for this CL, or shoul
James Hawkins
2012/02/03 22:48:40
Will remove and do a separate CL.
| |
| 1231 | 1232 |
| 1232 return browser; | 1233 return browser; |
| 1233 } | 1234 } |
| 1234 | 1235 |
| 1235 void BrowserInit::LaunchWithProfile::AddInfoBarsIfNecessary(Browser* browser) { | 1236 void BrowserInit::LaunchWithProfile::AddInfoBarsIfNecessary(Browser* browser) { |
| 1236 if (!browser || !profile_ || browser->tab_count() == 0) | 1237 if (!browser || !profile_ || browser->tab_count() == 0) |
| 1237 return; | 1238 return; |
| 1238 | 1239 |
| 1239 TabContentsWrapper* tab_contents = browser->GetSelectedTabContentsWrapper(); | 1240 TabContentsWrapper* tab_contents = browser->GetSelectedTabContentsWrapper(); |
| 1240 AddCrashedInfoBarIfNecessary(browser, tab_contents); | 1241 AddCrashedInfoBarIfNecessary(browser, tab_contents); |
| (...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1832 | 1833 |
| 1833 Profile* profile = ProfileManager::GetLastUsedProfile(); | 1834 Profile* profile = ProfileManager::GetLastUsedProfile(); |
| 1834 if (!profile) { | 1835 if (!profile) { |
| 1835 // We should only be able to get here if the profile already exists and | 1836 // We should only be able to get here if the profile already exists and |
| 1836 // has been created. | 1837 // has been created. |
| 1837 NOTREACHED(); | 1838 NOTREACHED(); |
| 1838 return; | 1839 return; |
| 1839 } | 1840 } |
| 1840 ProcessCmdLineImpl(cmd_line, cur_dir, false, profile, Profiles(), NULL, NULL); | 1841 ProcessCmdLineImpl(cmd_line, cur_dir, false, profile, Profiles(), NULL, NULL); |
| 1841 } | 1842 } |
| OLD | NEW |