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

Side by Side Diff: chrome/browser/ui/browser_commands.cc

Issue 517193003: More System Dialog printing code disabled on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@522493002
Patch Set: Mon Sep 8 01:10:20 PDT 2014 Created 6 years, 3 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 | « chrome/browser/ui/browser_commands.h ('k') | chrome/browser/ui/cocoa/accelerators_cocoa.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/browser_commands.h" 5 #include "chrome/browser/ui/browser_commands.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 // Do not print when a constrained window is showing. It's confusing. 874 // Do not print when a constrained window is showing. It's confusing.
875 // TODO(gbillock): Need to re-assess the call to 875 // TODO(gbillock): Need to re-assess the call to
876 // IsShowingWebContentsModalDialog after a popup management policy is 876 // IsShowingWebContentsModalDialog after a popup management policy is
877 // refined -- we will probably want to just queue the print request, not 877 // refined -- we will probably want to just queue the print request, not
878 // block it. 878 // block it.
879 return browser->profile()->GetPrefs()->GetBoolean(prefs::kPrintingEnabled) && 879 return browser->profile()->GetPrefs()->GetBoolean(prefs::kPrintingEnabled) &&
880 !(IsShowingWebContentsModalDialog(browser) || 880 !(IsShowingWebContentsModalDialog(browser) ||
881 GetContentRestrictions(browser) & CONTENT_RESTRICTION_PRINT); 881 GetContentRestrictions(browser) & CONTENT_RESTRICTION_PRINT);
882 } 882 }
883 883
884 #if !defined(OS_WIN) 884 #if !defined(DISABLE_BASIC_PRINTING)
885 void AdvancedPrint(Browser* browser) { 885 void BasicPrint(Browser* browser) {
886 #if defined(ENABLE_FULL_PRINTING) 886 #if defined(ENABLE_FULL_PRINTING)
887 printing::PrintViewManager* print_view_manager = 887 printing::PrintViewManager* print_view_manager =
888 printing::PrintViewManager::FromWebContents( 888 printing::PrintViewManager::FromWebContents(
889 browser->tab_strip_model()->GetActiveWebContents()); 889 browser->tab_strip_model()->GetActiveWebContents());
890 print_view_manager->AdvancedPrintNow(); 890 print_view_manager->BasicPrint();
891 #endif 891 #endif
892 } 892 }
893 893
894 bool CanAdvancedPrint(Browser* browser) { 894 bool CanBasicPrint(Browser* browser) {
895 return browser->profile()->GetPrefs()->GetBoolean(prefs::kPrintingEnabled) && 895 return browser->profile()->GetPrefs()->GetBoolean(prefs::kPrintingEnabled) &&
896 (PrintPreviewShowing(browser) || CanPrint(browser)); 896 (PrintPreviewShowing(browser) || CanPrint(browser));
897 } 897 }
898 #endif // !OS_WIN 898 #endif // !DISABLE_BASIC_PRINTING
899 899
900 void EmailPageLocation(Browser* browser) { 900 void EmailPageLocation(Browser* browser) {
901 content::RecordAction(UserMetricsAction("EmailPageLocation")); 901 content::RecordAction(UserMetricsAction("EmailPageLocation"));
902 WebContents* wc = browser->tab_strip_model()->GetActiveWebContents(); 902 WebContents* wc = browser->tab_strip_model()->GetActiveWebContents();
903 DCHECK(wc); 903 DCHECK(wc);
904 904
905 std::string title = net::EscapeQueryParamValue( 905 std::string title = net::EscapeQueryParamValue(
906 base::UTF16ToUTF8(wc->GetTitle()), false); 906 base::UTF16ToUTF8(wc->GetTitle()), false);
907 std::string page_url = net::EscapeQueryParamValue(wc->GetURL().spec(), false); 907 std::string page_url = net::EscapeQueryParamValue(wc->GetURL().spec(), false);
908 std::string mailto = std::string("mailto:?subject=Fwd:%20") + 908 std::string mailto = std::string("mailto:?subject=Fwd:%20") +
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
1269 browser->profile(), 1269 browser->profile(),
1270 browser->host_desktop_type())); 1270 browser->host_desktop_type()));
1271 app_browser->tab_strip_model()->AppendWebContents(contents, true); 1271 app_browser->tab_strip_model()->AppendWebContents(contents, true);
1272 1272
1273 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; 1273 contents->GetMutableRendererPrefs()->can_accept_load_drops = false;
1274 contents->GetRenderViewHost()->SyncRendererPrefs(); 1274 contents->GetRenderViewHost()->SyncRendererPrefs();
1275 app_browser->window()->Show(); 1275 app_browser->window()->Show();
1276 } 1276 }
1277 1277
1278 } // namespace chrome 1278 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_commands.h ('k') | chrome/browser/ui/cocoa/accelerators_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698