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

Unified Diff: chrome/browser/ui/browser.cc

Issue 7721001: PrintPreview: Make ctrl-shift-p start the native print flow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 9071b40104a09d1a82ae418494b6b311b28d683c..78248aa34273363eadc0d05c43415fbfd423cbd5 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -1756,6 +1756,10 @@ void Browser::Print() {
GetSelectedTabContentsWrapper()->print_view_manager()->PrintNow();
}
+void Browser::AdvancedPrint() {
+ GetSelectedTabContentsWrapper()->print_view_manager()->AdvancedPrintNow();
+}
+
void Browser::ToggleEncodingAutoDetect() {
UserMetrics::RecordAction(UserMetricsAction("AutoDetectChange"));
encoding_auto_detect_.SetValue(!encoding_auto_detect_.GetValue());
@@ -2429,6 +2433,7 @@ void Browser::ExecuteCommandWithDisposition(
case IDC_VIEW_SOURCE: ViewSelectedSource(); break;
case IDC_EMAIL_PAGE_LOCATION: EmailPageLocation(); break;
case IDC_PRINT: Print(); break;
+ case IDC_ADVANCED_PRINT: AdvancedPrint(); break;
case IDC_ENCODING_AUTO_DETECT: ToggleEncodingAutoDetect(); break;
case IDC_ENCODING_UTF8:
case IDC_ENCODING_UTF16LE:
@@ -4160,9 +4165,11 @@ void Browser::UpdatePrintingState(int content_restrictions) {
bool enabled = true;
if (content_restrictions & CONTENT_RESTRICTION_PRINT) {
enabled = false;
+ command_updater_.UpdateCommandEnabled(IDC_ADVANCED_PRINT, true);
Lei Zhang 2011/08/24 01:27:28 You don't always want to do this. For example, if
kmadhusu 2011/08/25 02:15:20 Fixed.
} else if (g_browser_process->local_state()) {
enabled = g_browser_process->local_state()->
GetBoolean(prefs::kPrintingEnabled);
+ command_updater_.UpdateCommandEnabled(IDC_ADVANCED_PRINT, enabled);
}
command_updater_.UpdateCommandEnabled(IDC_PRINT, enabled);
}

Powered by Google App Engine
This is Rietveld 408576698