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

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

Issue 7918011: Print Preview: Disable right click -> "Save As" for preview PDF. Users should just print to PDF i... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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/print_preview_tab_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/render_view_context_menu.cc
===================================================================
--- chrome/browser/tab_contents/render_view_context_menu.cc (revision 101261)
+++ chrome/browser/tab_contents/render_view_context_menu.cc (working copy)
@@ -28,6 +28,7 @@
#include "chrome/browser/prefs/incognito_mode_prefs.h"
#include "chrome/browser/prefs/pref_member.h"
#include "chrome/browser/prefs/pref_service.h"
+#include "chrome/browser/printing/print_preview_tab_controller.h"
#include "chrome/browser/printing/print_view_manager.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_io_data.h"
@@ -1190,10 +1191,11 @@
if (!local_state->GetBoolean(prefs::kAllowFileSelectionDialogs))
return false;
- return (params_.media_flags &
- WebContextMenuData::MediaCanSave) &&
- params_.src_url.is_valid() &&
- ProfileIOData::IsHandledProtocol(params_.src_url.scheme());
+ const GURL& url = params_.src_url;
+ return (params_.media_flags & WebContextMenuData::MediaCanSave) &&
+ url.is_valid() && ProfileIOData::IsHandledProtocol(url.scheme()) &&
+ // Do not save the preview PDF on the print preview page.
+ !(printing::PrintPreviewTabController::IsPrintPreviewURL(url));
}
case IDC_CONTENT_CONTEXT_OPENAVNEWTAB:
« no previous file with comments | « chrome/browser/printing/print_preview_tab_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698