Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Side by Side Diff: chrome/browser/ui/startup/startup_browser_creator_impl.cc

Issue 873503006: Handle --kiosk correctly when the browser is set to "Continue where I left off". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698