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

Side by Side Diff: chrome/browser/renderer_context_menu/render_view_context_menu.cc

Issue 597933002: Restored disable print preview policy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Wed Sep 24 10:32:18 PDT 2014 Created 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" 5 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1460 matching lines...) Expand 10 before | Expand all | Expand 10 after
1471 case IDC_CONTENT_CONTEXT_RESTART_PACKAGED_APP: { 1471 case IDC_CONTENT_CONTEXT_RESTART_PACKAGED_APP: {
1472 const Extension* platform_app = GetExtension(); 1472 const Extension* platform_app = GetExtension();
1473 DCHECK(platform_app); 1473 DCHECK(platform_app);
1474 DCHECK(platform_app->is_platform_app()); 1474 DCHECK(platform_app->is_platform_app());
1475 1475
1476 apps::AppLoadService::Get(GetProfile()) 1476 apps::AppLoadService::Get(GetProfile())
1477 ->RestartApplication(platform_app->id()); 1477 ->RestartApplication(platform_app->id());
1478 break; 1478 break;
1479 } 1479 }
1480 1480
1481 case IDC_PRINT: 1481 case IDC_PRINT: {
1482 #if defined(ENABLE_PRINTING) 1482 #if defined(ENABLE_PRINTING)
1483 if (params_.media_type == WebContextMenuData::MediaTypeNone) { 1483 if (params_.media_type != WebContextMenuData::MediaTypeNone) {
1484 #if defined(ENABLE_FULL_PRINTING)
1485 printing::PrintViewManager* print_view_manager =
1486 printing::PrintViewManager::FromWebContents(source_web_contents_);
1487
1488 if (!print_view_manager)
1489 break;
1490 print_view_manager->PrintPreviewNow(!params_.selection_text.empty());
1491 #else
1492 printing::PrintViewManagerBasic* print_view_manager =
1493 printing::PrintViewManagerBasic::FromWebContents(
1494 source_web_contents_);
1495 if (!print_view_manager)
1496 break;
1497 print_view_manager->PrintNow();
1498 #endif // defined(ENABLE_FULL_PRINTING)
1499 } else {
1500 if (render_frame_host) { 1484 if (render_frame_host) {
1501 render_frame_host->Send(new PrintMsg_PrintNodeUnderContextMenu( 1485 render_frame_host->Send(new PrintMsg_PrintNodeUnderContextMenu(
1502 render_frame_host->GetRoutingID())); 1486 render_frame_host->GetRoutingID()));
1503 } 1487 }
1488 return;
1504 } 1489 }
1505 #endif // defined(ENABLE_PRINTING) 1490
1491 printing::PrintViewManager* print_view_manager =
1492 printing::PrintViewManager::FromWebContents(source_web_contents_);
1493 if (!print_view_manager)
1494 break;
1495
1496 #if defined(ENABLE_FULL_PRINTING)
1497 if (!GetPrefs(browser_context_)->GetBoolean(prefs::kPrintPreviewDisabled)) {
1498 print_view_manager->PrintPreviewNow(!params_.selection_text.empty());
1499 break;
1500 }
1501 #endif // ENABLE_FULL_PRINTING
1502
1503 #if !defined(DISABLE_BASIC_PRINTING)
1504 print_view_manager->PrintNow();
1505 #endif // !DISABLE_BASIC_PRINTING
1506
1507 #endif // ENABLE_PRINTING
1506 break; 1508 break;
1509 }
1507 1510
1508 case IDC_VIEW_SOURCE: 1511 case IDC_VIEW_SOURCE:
1509 source_web_contents_->ViewSource(); 1512 source_web_contents_->ViewSource();
1510 break; 1513 break;
1511 1514
1512 case IDC_CONTENT_CONTEXT_INSPECTELEMENT: 1515 case IDC_CONTENT_CONTEXT_INSPECTELEMENT:
1513 Inspect(params_.x, params_.y); 1516 Inspect(params_.x, params_.y);
1514 break; 1517 break;
1515 1518
1516 case IDC_CONTENT_CONTEXT_INSPECTBACKGROUNDPAGE: { 1519 case IDC_CONTENT_CONTEXT_INSPECTBACKGROUNDPAGE: {
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
1769 source_web_contents_->GetRenderViewHost()-> 1772 source_web_contents_->GetRenderViewHost()->
1770 ExecuteMediaPlayerActionAtLocation(location, action); 1773 ExecuteMediaPlayerActionAtLocation(location, action);
1771 } 1774 }
1772 1775
1773 void RenderViewContextMenu::PluginActionAt( 1776 void RenderViewContextMenu::PluginActionAt(
1774 const gfx::Point& location, 1777 const gfx::Point& location,
1775 const WebPluginAction& action) { 1778 const WebPluginAction& action) {
1776 source_web_contents_->GetRenderViewHost()-> 1779 source_web_contents_->GetRenderViewHost()->
1777 ExecutePluginActionAtLocation(location, action); 1780 ExecutePluginActionAtLocation(location, action);
1778 } 1781 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698