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

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

Issue 443073002: Added code to disable 'paste' if nothing is present in clipboard to paste. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after
1363 case IDC_CONTENT_CONTEXT_REDO: 1363 case IDC_CONTENT_CONTEXT_REDO:
1364 return !!(params_.edit_flags & WebContextMenuData::CanRedo); 1364 return !!(params_.edit_flags & WebContextMenuData::CanRedo);
1365 1365
1366 case IDC_CONTENT_CONTEXT_CUT: 1366 case IDC_CONTENT_CONTEXT_CUT:
1367 return !!(params_.edit_flags & WebContextMenuData::CanCut); 1367 return !!(params_.edit_flags & WebContextMenuData::CanCut);
1368 1368
1369 case IDC_CONTENT_CONTEXT_COPY: 1369 case IDC_CONTENT_CONTEXT_COPY:
1370 return !!(params_.edit_flags & WebContextMenuData::CanCopy); 1370 return !!(params_.edit_flags & WebContextMenuData::CanCopy);
1371 1371
1372 case IDC_CONTENT_CONTEXT_PASTE: 1372 case IDC_CONTENT_CONTEXT_PASTE:
1373 case IDC_CONTENT_CONTEXT_PASTE_AND_MATCH_STYLE: 1373 case IDC_CONTENT_CONTEXT_PASTE_AND_MATCH_STYLE: {
1374 return !!(params_.edit_flags & WebContextMenuData::CanPaste); 1374 std::vector<base::string16> types;
1375 1375 bool ignore;
1376 ui::Clipboard::GetForCurrentThread()->ReadAvailableTypes(
darin (slow to review) 2014/08/06 16:31:33 This is potentially an expensive call, right? Shou
1377 ui::CLIPBOARD_TYPE_COPY_PASTE, &types, &ignore);
1378 return !types.empty();
1379 }
1376 case IDC_CONTENT_CONTEXT_DELETE: 1380 case IDC_CONTENT_CONTEXT_DELETE:
1377 return !!(params_.edit_flags & WebContextMenuData::CanDelete); 1381 return !!(params_.edit_flags & WebContextMenuData::CanDelete);
1378 1382
1379 case IDC_CONTENT_CONTEXT_SELECTALL: 1383 case IDC_CONTENT_CONTEXT_SELECTALL:
1380 return !!(params_.edit_flags & WebContextMenuData::CanSelectAll); 1384 return !!(params_.edit_flags & WebContextMenuData::CanSelectAll);
1381 1385
1382 case IDC_CONTENT_CONTEXT_OPENLINKOFFTHERECORD: 1386 case IDC_CONTENT_CONTEXT_OPENLINKOFFTHERECORD:
1383 return !browser_context_->IsOffTheRecord() && 1387 return !browser_context_->IsOffTheRecord() &&
1384 params_.link_url.is_valid() && 1388 params_.link_url.is_valid() &&
1385 incognito_avail != IncognitoModePrefs::DISABLED; 1389 incognito_avail != IncognitoModePrefs::DISABLED;
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
2049 source_web_contents_->GetRenderViewHost()-> 2053 source_web_contents_->GetRenderViewHost()->
2050 ExecuteMediaPlayerActionAtLocation(location, action); 2054 ExecuteMediaPlayerActionAtLocation(location, action);
2051 } 2055 }
2052 2056
2053 void RenderViewContextMenu::PluginActionAt( 2057 void RenderViewContextMenu::PluginActionAt(
2054 const gfx::Point& location, 2058 const gfx::Point& location,
2055 const WebPluginAction& action) { 2059 const WebPluginAction& action) {
2056 source_web_contents_->GetRenderViewHost()-> 2060 source_web_contents_->GetRenderViewHost()->
2057 ExecutePluginActionAtLocation(location, action); 2061 ExecutePluginActionAtLocation(location, action);
2058 } 2062 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698