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

Unified Diff: chrome/browser/tab_contents/render_view_context_menu.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/profiles/profile_io_data.cc ('k') | chrome/browser/ui/browser_command_controller.cc » ('j') | 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
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc
index 9ff2c162f90abbaef9435e88c6d287a46261fbaf..01cc19065ca16f74532b18819a81375bc1e2bf77 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc
@@ -1329,13 +1329,9 @@ bool RenderViewContextMenu::IsCommandIdEnabled(int id) const {
incognito_avail != IncognitoModePrefs::DISABLED;
case IDC_PRINT:
- if (g_browser_process->local_state() &&
- !g_browser_process->local_state()->GetBoolean(
- prefs::kPrintingEnabled)) {
- return false;
- }
- return params_.media_type == WebContextMenuData::MediaTypeNone ||
- params_.media_flags & WebContextMenuData::MediaCanPrint;
+ return profile_->GetPrefs()->GetBoolean(prefs::kPrintingEnabled) &&
+ (params_.media_type == WebContextMenuData::MediaTypeNone ||
+ params_.media_flags & WebContextMenuData::MediaCanPrint);
case IDC_CONTENT_CONTEXT_SEARCHWEBFOR:
case IDC_CONTENT_CONTEXT_GOTOURL:
@@ -1694,8 +1690,7 @@ void RenderViewContextMenu::ExecuteCommand(int id, int event_flags) {
TabContents::FromWebContents(source_web_contents_);
if (!tab_contents)
break;
- if (g_browser_process->local_state()->GetBoolean(
- prefs::kPrintPreviewDisabled)) {
+ if (profile_->GetPrefs()->GetBoolean(prefs::kPrintPreviewDisabled)) {
tab_contents->print_view_manager()->PrintNow();
} else {
tab_contents->print_view_manager()->PrintPreviewNow();
« no previous file with comments | « chrome/browser/profiles/profile_io_data.cc ('k') | chrome/browser/ui/browser_command_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698