Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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_commands.h" | 5 #include "chrome/browser/ui/browser_commands.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 347 !session_service->RestoreIfNecessary(std::vector<GURL>())) { | 347 !session_service->RestoreIfNecessary(std::vector<GURL>())) { |
| 348 OpenEmptyWindow(profile->GetOriginalProfile(), desktop_type); | 348 OpenEmptyWindow(profile->GetOriginalProfile(), desktop_type); |
| 349 } | 349 } |
| 350 } | 350 } |
| 351 } | 351 } |
| 352 | 352 |
| 353 Browser* OpenEmptyWindow(Profile* profile, HostDesktopType desktop_type) { | 353 Browser* OpenEmptyWindow(Profile* profile, HostDesktopType desktop_type) { |
| 354 Browser* browser = new Browser( | 354 Browser* browser = new Browser( |
| 355 Browser::CreateParams(Browser::TYPE_TABBED, profile, desktop_type)); | 355 Browser::CreateParams(Browser::TYPE_TABBED, profile, desktop_type)); |
| 356 AddTabAt(browser, GURL(), -1, true); | 356 AddTabAt(browser, GURL(), -1, true); |
| 357 // If appropriate, show Goodies page in second tab. | |
| 358 GURL goodies_url = profile->ShowingGoodiesPageInNewWindow(); | |
| 359 if (!goodies_url.is_empty()) | |
| 360 AddTabAt(browser, goodies_url, 2, false); | |
|
Greg Levin
2015/09/09 23:20:33
At the moment, this only shows Goodies when user o
Peter Kasting
2015/09/10 00:10:05
I don't know. Both these locations seem wrong. H
Greg Levin
2015/09/10 13:20:21
The first-run pages I know about are the ChromeVox
Peter Kasting
2015/09/10 20:39:35
The bug suggests this should be in the foreground
Greg Levin
2015/09/15 00:12:11
Done (Moved all code into new file / class, which
| |
| 357 browser->window()->Show(); | 361 browser->window()->Show(); |
| 358 return browser; | 362 return browser; |
| 359 } | 363 } |
| 360 | 364 |
| 361 void OpenWindowWithRestoredTabs(Profile* profile, | 365 void OpenWindowWithRestoredTabs(Profile* profile, |
| 362 HostDesktopType host_desktop_type) { | 366 HostDesktopType host_desktop_type) { |
| 363 TabRestoreService* service = TabRestoreServiceFactory::GetForProfile(profile); | 367 TabRestoreService* service = TabRestoreServiceFactory::GetForProfile(profile); |
| 364 if (service) | 368 if (service) |
| 365 service->RestoreMostRecentEntry(NULL, host_desktop_type); | 369 service->RestoreMostRecentEntry(NULL, host_desktop_type); |
| 366 } | 370 } |
| (...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1284 browser->host_desktop_type())); | 1288 browser->host_desktop_type())); |
| 1285 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1289 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
| 1286 | 1290 |
| 1287 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1291 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
| 1288 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1292 contents->GetRenderViewHost()->SyncRendererPrefs(); |
| 1289 app_browser->window()->Show(); | 1293 app_browser->window()->Show(); |
| 1290 } | 1294 } |
| 1291 #endif // defined(ENABLE_EXTENSIONS) | 1295 #endif // defined(ENABLE_EXTENSIONS) |
| 1292 | 1296 |
| 1293 } // namespace chrome | 1297 } // namespace chrome |
| OLD | NEW |