summaryrefslogtreecommitdiffstats
path: root/chrome/browser/printing
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-11 00:15:50 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-11 00:15:50 +0000
commit7a8ac8ccdcb19d5e4e8eee3605a462dbff0c1fe5 (patch)
tree96fd7d886f2460fe9d4d78ea224e1cf38efaf508 /chrome/browser/printing
parentda5241685d3fc6230b356bf6e220cddd92e677fe (diff)
downloadchromium_src-7a8ac8ccdcb19d5e4e8eee3605a462dbff0c1fe5.zip
chromium_src-7a8ac8ccdcb19d5e4e8eee3605a462dbff0c1fe5.tar.gz
chromium_src-7a8ac8ccdcb19d5e4e8eee3605a462dbff0c1fe5.tar.bz2
Cleanup: Make PrintJobManager::printing_enabled() const.
BUG=none TEST=none Review URL: http://codereview.chromium.org/9114048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117126 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/printing')
-rw-r--r--chrome/browser/printing/print_job_manager.cc8
-rw-r--r--chrome/browser/printing/print_job_manager.h14
2 files changed, 13 insertions, 9 deletions
diff --git a/chrome/browser/printing/print_job_manager.cc b/chrome/browser/printing/print_job_manager.cc
index 8a22a75..3488ad1 100644
--- a/chrome/browser/printing/print_job_manager.cc
+++ b/chrome/browser/printing/print_job_manager.cc
@@ -1,15 +1,15 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/printing/print_job_manager.h"
-#include "chrome/browser/browser_process.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/printing/print_job.h"
#include "chrome/browser/printing/printer_query.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/pref_names.h"
+#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "printing/printed_document.h"
#include "printing/printed_page.h"
@@ -166,4 +166,8 @@ void PrintJobManager::OnPrintJobEvent(
}
}
+bool PrintJobManager::printing_enabled() const {
+ return *printing_enabled_;
+}
+
} // namespace printing
diff --git a/chrome/browser/printing/print_job_manager.h b/chrome/browser/printing/print_job_manager.h
index 39fb381..4fc34d4 100644
--- a/chrome/browser/printing/print_job_manager.h
+++ b/chrome/browser/printing/print_job_manager.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -54,9 +54,9 @@ class PrintJobManager : public content::NotificationObserver {
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
- bool printing_enabled() {
- return *printing_enabled_;
- }
+ // Only accessed on the IO thread. UI thread can query
+ // prefs::kPrintingEnabled via g_browser_process->local_state() directly.
+ bool printing_enabled() const;
private:
typedef std::vector<scoped_refptr<PrintJob> > PrintJobs;
@@ -68,9 +68,6 @@ class PrintJobManager : public content::NotificationObserver {
content::NotificationRegistrar registrar_;
- // Used to serialize access to queued_workers_.
- base::Lock lock_;
-
// Printing is enabled/disabled. For printing with the native print dialog,
// this variable is checked at only one place, by
// PrintingMessageFilter::OnGetDefaultPrintSettings. If its value is true
@@ -81,6 +78,9 @@ class PrintJobManager : public content::NotificationObserver {
// times in the print preview workflow.
BooleanPrefMember printing_enabled_;
+ // Used to serialize access to queued_workers_.
+ base::Lock lock_;
+
PrinterQueries queued_queries_;
// Current print jobs that are active.