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

Unified Diff: chrome/browser/printing/print_view_manager.h

Issue 10689190: Block printing through JS when printing is disabled by policy or pref (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Meh. The printing code changed under me. Rebased. 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 | « no previous file | chrome/browser/printing/print_view_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/print_view_manager.h
diff --git a/chrome/browser/printing/print_view_manager.h b/chrome/browser/printing/print_view_manager.h
index 196dae0ddbf23c7c5f763aa7f17c95243a7ea9eb..4db11387efa5e20f8cf7d18bdf8f99ba3c2dd2d8 100644
--- a/chrome/browser/printing/print_view_manager.h
+++ b/chrome/browser/printing/print_view_manager.h
@@ -7,6 +7,7 @@
#include "base/memory/ref_counted.h"
#include "base/string16.h"
+#include "chrome/browser/prefs/pref_member.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_contents_observer.h"
@@ -17,6 +18,7 @@ struct PrintHostMsg_DidPrintPage_Params;
namespace content {
class RenderProcessHost;
+class RenderViewHost;
}
namespace printing {
@@ -69,8 +71,8 @@ class PrintViewManager : public content::NotificationObserver,
// renderer in the case of scripted print preview.
void PrintPreviewDone();
- // Whether to block scripted printing or not.
- void SetScriptedPrintingBlocked(bool blocked);
+ // Whether to block scripted printing for our tab or not.
+ void UpdateScriptedPrintingBlocked();
// Sets |observer| as the current PrintViewManagerObserver. Pass in NULL to
// remove the current observer. |observer| may always be NULL, but |observer_|
@@ -86,6 +88,10 @@ class PrintViewManager : public content::NotificationObserver,
const content::NotificationDetails& details) OVERRIDE;
// content::WebContentsObserver implementation.
+ virtual void DidStartLoading(
+ content::RenderViewHost* render_view_host) OVERRIDE;
+
+ // content::WebContentsObserver implementation.
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
// Terminates or cancels the print job if one was pending.
@@ -203,6 +209,12 @@ class PrintViewManager : public content::NotificationObserver,
// Keeps track of the pending callback during scripted print preview.
content::RenderProcessHost* scripted_print_preview_rph_;
+ // Whether printing is enabled.
+ BooleanPrefMember printing_enabled_;
+
+ // Whether our tab content is in blocked state.
+ bool tab_content_blocked_;
+
DISALLOW_COPY_AND_ASSIGN(PrintViewManager);
};
« no previous file with comments | « no previous file | chrome/browser/printing/print_view_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698