| 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/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 } | 357 } |
| 358 | 358 |
| 359 Browser* OpenEmptyWindow(Profile* profile) { | 359 Browser* OpenEmptyWindow(Profile* profile) { |
| 360 Browser* browser = | 360 Browser* browser = |
| 361 new Browser(Browser::CreateParams(Browser::TYPE_TABBED, profile)); | 361 new Browser(Browser::CreateParams(Browser::TYPE_TABBED, profile)); |
| 362 AddTabAt(browser, GURL(), -1, true); | 362 AddTabAt(browser, GURL(), -1, true); |
| 363 browser->window()->Show(); | 363 browser->window()->Show(); |
| 364 return browser; | 364 return browser; |
| 365 } | 365 } |
| 366 | 366 |
| 367 void OpenWindowWithRestoredTabs(Profile* profile, | 367 void OpenWindowWithRestoredTabs(Profile* profile) { |
| 368 HostDesktopType host_desktop_type) { | |
| 369 sessions::TabRestoreService* service = | 368 sessions::TabRestoreService* service = |
| 370 TabRestoreServiceFactory::GetForProfile(profile); | 369 TabRestoreServiceFactory::GetForProfile(profile); |
| 371 if (service) | 370 if (service) |
| 372 service->RestoreMostRecentEntry(NULL, host_desktop_type); | 371 service->RestoreMostRecentEntry(nullptr); |
| 373 } | 372 } |
| 374 | 373 |
| 375 void OpenURLOffTheRecord(Profile* profile, | 374 void OpenURLOffTheRecord(Profile* profile, |
| 376 const GURL& url) { | 375 const GURL& url) { |
| 377 ScopedTabbedBrowserDisplayer displayer(profile->GetOffTheRecordProfile()); | 376 ScopedTabbedBrowserDisplayer displayer(profile->GetOffTheRecordProfile()); |
| 378 AddSelectedTabWithURL(displayer.browser(), url, | 377 AddSelectedTabWithURL(displayer.browser(), url, |
| 379 ui::PAGE_TRANSITION_LINK); | 378 ui::PAGE_TRANSITION_LINK); |
| 380 } | 379 } |
| 381 | 380 |
| 382 bool CanGoBack(const Browser* browser) { | 381 bool CanGoBack(const Browser* browser) { |
| (...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1294 app_name, true /* trusted_source */, gfx::Rect(), browser->profile())); | 1293 app_name, true /* trusted_source */, gfx::Rect(), browser->profile())); |
| 1295 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1294 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
| 1296 | 1295 |
| 1297 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1296 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
| 1298 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1297 contents->GetRenderViewHost()->SyncRendererPrefs(); |
| 1299 app_browser->window()->Show(); | 1298 app_browser->window()->Show(); |
| 1300 } | 1299 } |
| 1301 #endif // defined(ENABLE_EXTENSIONS) | 1300 #endif // defined(ENABLE_EXTENSIONS) |
| 1302 | 1301 |
| 1303 } // namespace chrome | 1302 } // namespace chrome |
| OLD | NEW |