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

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

Issue 8395007: Add policy for blocking GCP printing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix build break and respond to additional feedback Created 9 years, 2 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
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/print_preview_handler.cc
diff --git a/chrome/browser/ui/webui/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview_handler.cc
index d859e4cad9f023338ce4be0decc7e0de66ff484e..a0bdcb09f35cad9db8f57586ca2ae4a38dcb97c3 100644
--- a/chrome/browser/ui/webui/print_preview_handler.cc
+++ b/chrome/browser/ui/webui/print_preview_handler.cc
@@ -24,6 +24,7 @@
#include "base/values.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/platform_util.h"
+#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/printing/background_printing_manager.h"
#include "chrome/browser/printing/cloud_print/cloud_print_url.h"
#include "chrome/browser/printing/print_dialog_cloud.h"
@@ -32,6 +33,7 @@
#include "chrome/browser/printing/print_system_task_proxy.h"
#include "chrome/browser/printing/print_view_manager.h"
#include "chrome/browser/printing/printer_manager_dialog.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sessions/restore_tab_helper.h"
#include "chrome/browser/tabs/tab_strip_model.h"
#include "chrome/browser/ui/browser_list.h"
@@ -39,6 +41,7 @@
#include "chrome/browser/ui/webui/cloud_print_signin_dialog.h"
#include "chrome/browser/ui/webui/print_preview_ui.h"
#include "chrome/common/chrome_paths.h"
+#include "chrome/common/pref_names.h"
#include "chrome/common/print_messages.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/tab_contents/tab_contents.h"
@@ -658,10 +661,13 @@ void PrintPreviewHandler::SetupPrinterList(const ListValue& printers) {
}
void PrintPreviewHandler::SendCloudPrintEnabled() {
- GURL gcp_url(CloudPrintURL(BrowserList::GetLastActive()->profile()).
- GetCloudPrintServiceURL());
- base::StringValue gcp_url_value(gcp_url.spec());
- web_ui_->CallJavascriptFunction("setUseCloudPrint", gcp_url_value);
+ Profile* profile = BrowserList::GetLastActive()->profile();
+ PrefService* prefs = profile->GetPrefs();
+ if (prefs->GetBoolean(prefs::kCloudPrintSubmitEnabled)) {
+ GURL gcp_url(CloudPrintURL(profile).GetCloudPrintServiceURL());
+ base::StringValue gcp_url_value(gcp_url.spec());
+ web_ui_->CallJavascriptFunction("setUseCloudPrint", gcp_url_value);
+ }
}
void PrintPreviewHandler::SendCloudPrintJob(const DictionaryValue& settings,
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698