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

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

Issue 488853002: Removed --disable-print-preview switch and policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tue Aug 19 16:35:18 PDT 2014 Created 6 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
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 837 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 web_contents, url, ssl); 848 web_contents, url, ssl);
849 } 849 }
850 850
851 851
852 void Print(Browser* browser) { 852 void Print(Browser* browser) {
853 #if defined(ENABLE_PRINTING) 853 #if defined(ENABLE_PRINTING)
854 WebContents* contents = browser->tab_strip_model()->GetActiveWebContents(); 854 WebContents* contents = browser->tab_strip_model()->GetActiveWebContents();
855 #if defined(ENABLE_FULL_PRINTING) 855 #if defined(ENABLE_FULL_PRINTING)
856 printing::PrintViewManager* print_view_manager = 856 printing::PrintViewManager* print_view_manager =
857 printing::PrintViewManager::FromWebContents(contents); 857 printing::PrintViewManager::FromWebContents(contents);
858 if (browser->profile()->GetPrefs()->GetBoolean(prefs::kPrintPreviewDisabled)) 858 print_view_manager->PrintPreviewNow(false);
859 print_view_manager->PrintNow();
860 else
861 print_view_manager->PrintPreviewNow(false);
862 #else 859 #else
863 printing::PrintViewManagerBasic* print_view_manager = 860 printing::PrintViewManagerBasic* print_view_manager =
864 printing::PrintViewManagerBasic::FromWebContents(contents); 861 printing::PrintViewManagerBasic::FromWebContents(contents);
865 print_view_manager->PrintNow(); 862 print_view_manager->PrintNow();
866 #endif // defined(ENABLE_FULL_PRINTING) 863 #endif // defined(ENABLE_FULL_PRINTING)
867 #endif // defined(ENABLE_PRINTING) 864 #endif // defined(ENABLE_PRINTING)
868 } 865 }
869 866
870 bool CanPrint(Browser* browser) { 867 bool CanPrint(Browser* browser) {
871 // Do not print when printing is disabled via pref or policy. 868 // Do not print when printing is disabled via pref or policy.
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
1284 browser->profile(), 1281 browser->profile(),
1285 browser->host_desktop_type())); 1282 browser->host_desktop_type()));
1286 app_browser->tab_strip_model()->AppendWebContents(contents, true); 1283 app_browser->tab_strip_model()->AppendWebContents(contents, true);
1287 1284
1288 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; 1285 contents->GetMutableRendererPrefs()->can_accept_load_drops = false;
1289 contents->GetRenderViewHost()->SyncRendererPrefs(); 1286 contents->GetRenderViewHost()->SyncRendererPrefs();
1290 app_browser->window()->Show(); 1287 app_browser->window()->Show();
1291 } 1288 }
1292 1289
1293 } // namespace chrome 1290 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698