| 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/startup/startup_browser_creator_impl.h" | 5 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "apps/app_restore_service.h" | 10 #include "apps/app_restore_service.h" |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 | 375 |
| 376 #if defined(OS_MACOSX) | 376 #if defined(OS_MACOSX) |
| 377 if (process_startup) { | 377 if (process_startup) { |
| 378 // Check whether the auto-update system needs to be promoted from user | 378 // Check whether the auto-update system needs to be promoted from user |
| 379 // to system. | 379 // to system. |
| 380 KeystoneInfoBar::PromotionInfoBar(profile); | 380 KeystoneInfoBar::PromotionInfoBar(profile); |
| 381 } | 381 } |
| 382 #endif | 382 #endif |
| 383 } | 383 } |
| 384 | 384 |
| 385 // In kiosk mode, we want to always be fullscreen, so switch to that now. |
| 386 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode) || |
| 387 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 388 switches::kStartFullscreen)) { |
| 389 // It's possible for there to be no browser window, e.g. if someone |
| 390 // specified a non-sensical combination of options |
| 391 // ("--kiosk --no_startup_window"); do nothing in that case. |
| 392 Browser* browser = BrowserList::GetInstance(desktop_type)->GetLastActive(); |
| 393 if (browser) |
| 394 chrome::ToggleFullscreenMode(browser); |
| 395 } |
| 396 |
| 385 #if defined(OS_WIN) | 397 #if defined(OS_WIN) |
| 386 if (process_startup) | 398 if (process_startup) |
| 387 ShellIntegration::MigrateChromiumShortcuts(); | 399 ShellIntegration::MigrateChromiumShortcuts(); |
| 388 #endif // defined(OS_WIN) | 400 #endif // defined(OS_WIN) |
| 389 | 401 |
| 390 return true; | 402 return true; |
| 391 } | 403 } |
| 392 | 404 |
| 393 bool StartupBrowserCreatorImpl::IsAppLaunch(std::string* app_url, | 405 bool StartupBrowserCreatorImpl::IsAppLaunch(std::string* app_url, |
| 394 std::string* app_id) { | 406 std::string* app_id) { |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 794 browser->tab_strip_model()->ActivateTabAt(0, false); | 806 browser->tab_strip_model()->ActivateTabAt(0, false); |
| 795 } | 807 } |
| 796 | 808 |
| 797 // The default behavior is to show the window, as expressed by the default | 809 // The default behavior is to show the window, as expressed by the default |
| 798 // value of StartupBrowserCreated::show_main_browser_window_. If this was set | 810 // value of StartupBrowserCreated::show_main_browser_window_. If this was set |
| 799 // to true ahead of this place, it means another task must have been spawned | 811 // to true ahead of this place, it means another task must have been spawned |
| 800 // to take care of that. | 812 // to take care of that. |
| 801 if (!browser_creator_ || browser_creator_->show_main_browser_window()) | 813 if (!browser_creator_ || browser_creator_->show_main_browser_window()) |
| 802 browser->window()->Show(); | 814 browser->window()->Show(); |
| 803 | 815 |
| 804 // In kiosk mode, we want to always be fullscreen, so switch to that now. | |
| 805 if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode) || | |
| 806 base::CommandLine::ForCurrentProcess()->HasSwitch( | |
| 807 switches::kStartFullscreen)) | |
| 808 chrome::ToggleFullscreenMode(browser); | |
| 809 | |
| 810 return browser; | 816 return browser; |
| 811 } | 817 } |
| 812 | 818 |
| 813 void StartupBrowserCreatorImpl::AddInfoBarsIfNecessary( | 819 void StartupBrowserCreatorImpl::AddInfoBarsIfNecessary( |
| 814 Browser* browser, | 820 Browser* browser, |
| 815 chrome::startup::IsProcessStartup is_process_startup) { | 821 chrome::startup::IsProcessStartup is_process_startup) { |
| 816 if (!browser || !profile_ || browser->tab_strip_model()->count() == 0) | 822 if (!browser || !profile_ || browser->tab_strip_model()->count() == 0) |
| 817 return; | 823 return; |
| 818 | 824 |
| 819 if (HasPendingUncleanExit(browser->profile()) && | 825 if (HasPendingUncleanExit(browser->profile()) && |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 905 // behavior is desired because completing or skipping the sync promo | 911 // behavior is desired because completing or skipping the sync promo |
| 906 // causes a redirect to the NTP. | 912 // causes a redirect to the NTP. |
| 907 if (!startup_urls->empty() && | 913 if (!startup_urls->empty() && |
| 908 startup_urls->at(0) == GURL(chrome::kChromeUINewTabURL)) | 914 startup_urls->at(0) == GURL(chrome::kChromeUINewTabURL)) |
| 909 startup_urls->at(0) = sync_promo_url; | 915 startup_urls->at(0) = sync_promo_url; |
| 910 else | 916 else |
| 911 startup_urls->insert(startup_urls->begin(), sync_promo_url); | 917 startup_urls->insert(startup_urls->begin(), sync_promo_url); |
| 912 } | 918 } |
| 913 } | 919 } |
| 914 } | 920 } |
| OLD | NEW |