OLD | NEW |
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 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
881 print_view_manager->AdvancedPrintNow(); | 881 print_view_manager->AdvancedPrintNow(); |
882 #endif | 882 #endif |
883 } | 883 } |
884 | 884 |
885 bool CanAdvancedPrint(Browser* browser) { | 885 bool CanAdvancedPrint(Browser* browser) { |
886 return browser->profile()->GetPrefs()->GetBoolean(prefs::kPrintingEnabled) && | 886 return browser->profile()->GetPrefs()->GetBoolean(prefs::kPrintingEnabled) && |
887 (PrintPreviewShowing(browser) || CanPrint(browser)); | 887 (PrintPreviewShowing(browser) || CanPrint(browser)); |
888 } | 888 } |
889 #endif // !OS_WIN | 889 #endif // !OS_WIN |
890 | 890 |
891 void PrintToDestination(Browser* browser) { | |
892 #if defined(ENABLE_FULL_PRINTING) | |
893 printing::PrintViewManager* print_view_manager = | |
894 printing::PrintViewManager::FromWebContents( | |
895 browser->tab_strip_model()->GetActiveWebContents()); | |
896 print_view_manager->PrintToDestination(); | |
897 #endif | |
898 } | |
899 | |
900 void EmailPageLocation(Browser* browser) { | 891 void EmailPageLocation(Browser* browser) { |
901 content::RecordAction(UserMetricsAction("EmailPageLocation")); | 892 content::RecordAction(UserMetricsAction("EmailPageLocation")); |
902 WebContents* wc = browser->tab_strip_model()->GetActiveWebContents(); | 893 WebContents* wc = browser->tab_strip_model()->GetActiveWebContents(); |
903 DCHECK(wc); | 894 DCHECK(wc); |
904 | 895 |
905 std::string title = net::EscapeQueryParamValue( | 896 std::string title = net::EscapeQueryParamValue( |
906 base::UTF16ToUTF8(wc->GetTitle()), false); | 897 base::UTF16ToUTF8(wc->GetTitle()), false); |
907 std::string page_url = net::EscapeQueryParamValue(wc->GetURL().spec(), false); | 898 std::string page_url = net::EscapeQueryParamValue(wc->GetURL().spec(), false); |
908 std::string mailto = std::string("mailto:?subject=Fwd:%20") + | 899 std::string mailto = std::string("mailto:?subject=Fwd:%20") + |
909 title + "&body=%0A%0A" + page_url; | 900 title + "&body=%0A%0A" + page_url; |
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1269 browser->profile(), | 1260 browser->profile(), |
1270 browser->host_desktop_type())); | 1261 browser->host_desktop_type())); |
1271 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1262 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
1272 | 1263 |
1273 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1264 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
1274 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1265 contents->GetRenderViewHost()->SyncRendererPrefs(); |
1275 app_browser->window()->Show(); | 1266 app_browser->window()->Show(); |
1276 } | 1267 } |
1277 | 1268 |
1278 } // namespace chrome | 1269 } // namespace chrome |
OLD | NEW |