diff options
-rw-r--r-- | chrome/browser/browser_init.cc | 7 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 3 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 1 |
3 files changed, 11 insertions, 0 deletions
diff --git a/chrome/browser/browser_init.cc b/chrome/browser/browser_init.cc index 42b41cf..f5a2ec4 100644 --- a/chrome/browser/browser_init.cc +++ b/chrome/browser/browser_init.cc @@ -424,6 +424,13 @@ bool BrowserInit::LaunchWithProfile::Launch(Profile* profile, RecordLaunchModeHistogram(LM_AS_WEBAPP); } + // Print the selected page if the command line switch exists. Note that the + // current selected tab would be the page which will be printed. + if (command_line_.HasSwitch(switches::kPrint)) { + Browser* browser = BrowserList::GetLastActive(); + browser->Print(); + } + // If we're recording or playing back, startup the EventRecorder now // unless otherwise specified. if (!command_line_.HasSwitch(switches::kNoEvents)) { diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index feb9cf3..ffe8d9c 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -263,6 +263,9 @@ extern const wchar_t kDnsPrefetchDisable[] = L"dns-prefetch-disable"; // Enables support to debug printing subsystem. const wchar_t kDebugPrint[] = L"debug-print"; +// Prints the pages on the screen. +const wchar_t kPrint[] = L"print"; + // Allow initialization of all activex controls. This is only to help website // developers test their controls to see if they are compatible in Chrome. // Note there's a duplicate value in activex_shared.cc (to avoid diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index a4782e1..e7adab0 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -84,6 +84,7 @@ extern const wchar_t kProxyAutoDetect[]; extern const wchar_t kProxyPacUrl[]; extern const wchar_t kWinHttpProxyResolver[]; extern const wchar_t kDebugPrint[]; +extern const wchar_t kPrint[]; extern const wchar_t kDnsLogDetails[]; extern const wchar_t kDnsPrefetchDisable[]; |