OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <algorithm> | 5 #include <algorithm> |
6 #include <set> | 6 #include <set> |
7 | 7 |
8 #include "chrome/browser/tab_contents/render_view_context_menu.h" | 8 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
937 case IDC_CONTENT_CONTEXT_PASTE: | 937 case IDC_CONTENT_CONTEXT_PASTE: |
938 return !!(params_.edit_flags & WebContextMenuData::CanPaste); | 938 return !!(params_.edit_flags & WebContextMenuData::CanPaste); |
939 | 939 |
940 case IDC_CONTENT_CONTEXT_DELETE: | 940 case IDC_CONTENT_CONTEXT_DELETE: |
941 return !!(params_.edit_flags & WebContextMenuData::CanDelete); | 941 return !!(params_.edit_flags & WebContextMenuData::CanDelete); |
942 | 942 |
943 case IDC_CONTENT_CONTEXT_SELECTALL: | 943 case IDC_CONTENT_CONTEXT_SELECTALL: |
944 return !!(params_.edit_flags & WebContextMenuData::CanSelectAll); | 944 return !!(params_.edit_flags & WebContextMenuData::CanSelectAll); |
945 | 945 |
946 case IDC_CONTENT_CONTEXT_OPENLINKOFFTHERECORD: | 946 case IDC_CONTENT_CONTEXT_OPENLINKOFFTHERECORD: |
947 return !profile_->IsOffTheRecord() && params_.link_url.is_valid(); | 947 return !profile_->IsOffTheRecord() && params_.link_url.is_valid() && |
| 948 profile_->GetPrefs()->GetBoolean(prefs::kIncognitoEnabled); |
948 | 949 |
949 case IDC_SPELLCHECK_ADD_TO_DICTIONARY: | 950 case IDC_SPELLCHECK_ADD_TO_DICTIONARY: |
950 return !params_.misspelled_word.empty(); | 951 return !params_.misspelled_word.empty(); |
951 | 952 |
952 case IDC_PRINT: | 953 case IDC_PRINT: |
953 return params_.media_type == WebContextMenuData::MediaTypeNone || | 954 return params_.media_type == WebContextMenuData::MediaTypeNone || |
954 params_.media_flags & WebContextMenuData::MediaCanPrint; | 955 params_.media_flags & WebContextMenuData::MediaCanPrint; |
955 | 956 |
956 case IDC_CONTENT_CONTEXT_SEARCHWEBFOR: | 957 case IDC_CONTENT_CONTEXT_SEARCHWEBFOR: |
957 case IDC_CONTENT_CONTEXT_GOTOURL: | 958 case IDC_CONTENT_CONTEXT_GOTOURL: |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1477 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), | 1478 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), |
1478 g_browser_process->clipboard()); | 1479 g_browser_process->clipboard()); |
1479 } | 1480 } |
1480 | 1481 |
1481 void RenderViewContextMenu::MediaPlayerActionAt( | 1482 void RenderViewContextMenu::MediaPlayerActionAt( |
1482 const gfx::Point& location, | 1483 const gfx::Point& location, |
1483 const WebMediaPlayerAction& action) { | 1484 const WebMediaPlayerAction& action) { |
1484 source_tab_contents_->render_view_host()->MediaPlayerActionAt( | 1485 source_tab_contents_->render_view_host()->MediaPlayerActionAt( |
1485 location, action); | 1486 location, action); |
1486 } | 1487 } |
OLD | NEW |