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

Unified Diff: chrome/browser/tab_contents/tab_contents.cc

Issue 5320001: Disable printing context menus on the print preview page. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix tests Created 10 years, 1 month 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
Index: chrome/browser/tab_contents/tab_contents.cc
===================================================================
--- chrome/browser/tab_contents/tab_contents.cc (revision 67834)
+++ chrome/browser/tab_contents/tab_contents.cc (working copy)
@@ -85,6 +85,7 @@
#include "chrome/browser/translate/page_translated_details.h"
#include "chrome/common/bindings_policy.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/content_restriction.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_action.h"
#include "chrome/common/extensions/extension_icon_set.h"
@@ -2648,9 +2649,14 @@
void TabContents::DidStartLoading() {
SetIsLoading(true, NULL);
- if (content_restrictions_) {
- content_restrictions_= 0;
- delegate()->ContentRestrictionsChanged(this);
+ if (delegate()) {
+ bool is_print_preview_tab =
+ printing::PrintPreviewTabController::IsPrintPreviewTab(this);
+ if (content_restrictions_ || is_print_preview_tab) {
+ content_restrictions_= is_print_preview_tab ?
+ CONTENT_RESTRICTION_PRINT : 0;
+ delegate()->ContentRestrictionsChanged(this);
+ }
}
// Notify observers about navigation.

Powered by Google App Engine
This is Rietveld 408576698