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

Side by Side Diff: chrome/browser/browser_init.cc

Issue 3012031: Revert 54073 - Fix --kiosk to work regardless of the startup pref setting or ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 4 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 | Annotate | Revision Log
« 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/browser_init.h" 5 #include "chrome/browser/browser_init.h"
6 6
7 #include <algorithm> // For max(). 7 #include <algorithm> // For max().
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 #if defined(OS_MACOSX) 545 #if defined(OS_MACOSX)
546 // Check whether the auto-update system needs to be promoted from user 546 // Check whether the auto-update system needs to be promoted from user
547 // to system. 547 // to system.
548 KeystoneInfoBar::PromotionInfoBar(profile); 548 KeystoneInfoBar::PromotionInfoBar(profile);
549 #endif 549 #endif
550 } 550 }
551 } else { 551 } else {
552 RecordLaunchModeHistogram(LM_AS_WEBAPP); 552 RecordLaunchModeHistogram(LM_AS_WEBAPP);
553 } 553 }
554 554
555 #if !defined(OS_MACOSX)
556 // In kiosk mode, we want to always be fullscreen, so switch to that now.
557 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode))
558 BrowserList::GetLastActive()->ToggleFullscreenMode();
559 #endif
560
561 #if defined(OS_WIN) 555 #if defined(OS_WIN)
562 // Print the selected page if the command line switch exists. Note that the 556 // Print the selected page if the command line switch exists. Note that the
563 // current selected tab would be the page which will be printed. 557 // current selected tab would be the page which will be printed.
564 if (command_line_.HasSwitch(switches::kPrint)) 558 if (command_line_.HasSwitch(switches::kPrint)) {
565 BrowserList::GetLastActive()->Print(); 559 Browser* browser = BrowserList::GetLastActive();
560 browser->Print();
561 }
566 #endif 562 #endif
567 563
568 // If we're recording or playing back, startup the EventRecorder now 564 // If we're recording or playing back, startup the EventRecorder now
569 // unless otherwise specified. 565 // unless otherwise specified.
570 if (!command_line_.HasSwitch(switches::kNoEvents)) { 566 if (!command_line_.HasSwitch(switches::kNoEvents)) {
571 FilePath script_path; 567 FilePath script_path;
572 PathService::Get(chrome::FILE_RECORDED_SCRIPT, &script_path); 568 PathService::Get(chrome::FILE_RECORDED_SCRIPT, &script_path);
573 569
574 bool record_mode = command_line_.HasSwitch(switches::kRecordMode); 570 bool record_mode = command_line_.HasSwitch(switches::kRecordMode);
575 bool playback_mode = command_line_.HasSwitch(switches::kPlaybackMode); 571 bool playback_mode = command_line_.HasSwitch(switches::kPlaybackMode);
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 browser = Browser::Create(profile_); 735 browser = Browser::Create(profile_);
740 } else { 736 } else {
741 #if defined(TOOLKIT_GTK) 737 #if defined(TOOLKIT_GTK)
742 // Setting the time of the last action on the window here allows us to steal 738 // Setting the time of the last action on the window here allows us to steal
743 // focus, which is what the user wants when opening a new tab in an existing 739 // focus, which is what the user wants when opening a new tab in an existing
744 // browser window. 740 // browser window.
745 gtk_util::SetWMLastUserActionTime(browser->window()->GetNativeHandle()); 741 gtk_util::SetWMLastUserActionTime(browser->window()->GetNativeHandle());
746 #endif 742 #endif
747 } 743 }
748 744
745 #if !defined(OS_MACOSX)
746 // In kiosk mode, we want to always be fullscreen, so switch to that now.
747 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode))
748 browser->ToggleFullscreenMode();
749 #endif
750
749 bool first_tab = true; 751 bool first_tab = true;
750 for (size_t i = 0; i < tabs.size(); ++i) { 752 for (size_t i = 0; i < tabs.size(); ++i) {
751 // We skip URLs that we'd have to launch an external protocol handler for. 753 // We skip URLs that we'd have to launch an external protocol handler for.
752 // This avoids us getting into an infinite loop asking ourselves to open 754 // This avoids us getting into an infinite loop asking ourselves to open
753 // a URL, should the handler be (incorrectly) configured to be us. Anyone 755 // a URL, should the handler be (incorrectly) configured to be us. Anyone
754 // asking us to open such a URL should really ask the handler directly. 756 // asking us to open such a URL should really ask the handler directly.
755 if (!process_startup && !URLRequest::IsHandledURL(tabs[i].url)) 757 if (!process_startup && !URLRequest::IsHandledURL(tabs[i].url))
756 continue; 758 continue;
757 759
758 int add_types = first_tab ? TabStripModel::ADD_SELECTED : 760 int add_types = first_tab ? TabStripModel::ADD_SELECTED :
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 scoped_refptr<AutomationProviderClass> automation = 1052 scoped_refptr<AutomationProviderClass> automation =
1051 new AutomationProviderClass(profile); 1053 new AutomationProviderClass(profile);
1052 automation->ConnectToChannel(channel_id); 1054 automation->ConnectToChannel(channel_id);
1053 automation->SetExpectedTabCount(expected_tabs); 1055 automation->SetExpectedTabCount(expected_tabs);
1054 1056
1055 AutomationProviderList* list = 1057 AutomationProviderList* list =
1056 g_browser_process->InitAutomationProviderList(); 1058 g_browser_process->InitAutomationProviderList();
1057 DCHECK(list); 1059 DCHECK(list);
1058 list->AddProvider(automation); 1060 list->AddProvider(automation);
1059 } 1061 }
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