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

Unified Diff: chrome/browser/printing/printing_message_filter.cc

Issue 10808006: Move printing.* prefs from local state to profile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased just in case as the CL is a few days old now plus I got my branches all mixed up a bit. Created 8 years, 5 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/printing/printing_message_filter.h ('k') | chrome/browser/profiles/profile_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/printing_message_filter.cc
diff --git a/chrome/browser/printing/printing_message_filter.cc b/chrome/browser/printing/printing_message_filter.cc
index 2ba8a02597072096c868796fd46e6a66abd0da99..c5250805c731b1e75ce67c2ff2b1ebd70bf73c80 100644
--- a/chrome/browser/printing/printing_message_filter.cc
+++ b/chrome/browser/printing/printing_message_filter.cc
@@ -11,8 +11,11 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/printing/printer_query.h"
#include "chrome/browser/printing/print_job_manager.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/profiles/profile_io_data.h"
#include "chrome/browser/ui/webui/print_preview/print_preview_ui.h"
#include "chrome/common/print_messages.h"
+#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
@@ -79,8 +82,11 @@ void RenderParamsFromPrintSettings(const printing::PrintSettings& settings,
} // namespace
-PrintingMessageFilter::PrintingMessageFilter(int render_process_id)
+PrintingMessageFilter::PrintingMessageFilter(int render_process_id,
+ Profile* profile)
: print_job_manager_(g_browser_process->print_job_manager()),
+ profile_io_data_(ProfileIOData::FromResourceContext(
+ profile->GetResourceContext())),
render_process_id_(render_process_id) {
}
@@ -226,7 +232,7 @@ void PrintingMessageFilter::GetPrintSettingsForRenderView(
void PrintingMessageFilter::OnGetDefaultPrintSettings(IPC::Message* reply_msg) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
scoped_refptr<printing::PrinterQuery> printer_query;
- if (!print_job_manager_->printing_enabled()) {
+ if (!profile_io_data_->printing_enabled()->GetValue()) {
// Reply with NULL query.
OnGetDefaultPrintSettingsReply(printer_query, reply_msg);
return;
@@ -327,7 +333,7 @@ void PrintingMessageFilter::OnUpdatePrintSettings(
int document_cookie, const DictionaryValue& job_settings,
IPC::Message* reply_msg) {
scoped_refptr<printing::PrinterQuery> printer_query;
- if (!print_job_manager_->printing_enabled()) {
+ if (!profile_io_data_->printing_enabled()->GetValue()) {
// Reply with NULL query.
OnUpdatePrintSettingsReply(printer_query, reply_msg);
return;
« no previous file with comments | « chrome/browser/printing/printing_message_filter.h ('k') | chrome/browser/profiles/profile_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698