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 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1037 case IDC_RELOAD: | 1037 case IDC_RELOAD: |
1038 return source_tab_contents_->delegate() && | 1038 return source_tab_contents_->delegate() && |
1039 source_tab_contents_->delegate()->CanReloadContents( | 1039 source_tab_contents_->delegate()->CanReloadContents( |
1040 source_tab_contents_); | 1040 source_tab_contents_); |
1041 | 1041 |
1042 case IDC_VIEW_SOURCE: | 1042 case IDC_VIEW_SOURCE: |
1043 case IDC_CONTENT_CONTEXT_VIEWFRAMESOURCE: | 1043 case IDC_CONTENT_CONTEXT_VIEWFRAMESOURCE: |
1044 return source_tab_contents_->controller().CanViewSource(); | 1044 return source_tab_contents_->controller().CanViewSource(); |
1045 | 1045 |
1046 case IDC_CONTENT_CONTEXT_INSPECTELEMENT: | 1046 case IDC_CONTENT_CONTEXT_INSPECTELEMENT: |
1047 // Viewing page info is not a developer command but is meaningful for the | 1047 return IsDevCommandEnabled(id); |
1048 // same set of pages which developer commands are meaningful for. | 1048 |
1049 case IDC_CONTENT_CONTEXT_VIEWPAGEINFO: | 1049 case IDC_CONTENT_CONTEXT_VIEWPAGEINFO: |
1050 return IsDevCommandEnabled(id); | 1050 return source_tab_contents_->controller().GetActiveEntry() != NULL; |
1051 | 1051 |
1052 case IDC_CONTENT_CONTEXT_TRANSLATE: { | 1052 case IDC_CONTENT_CONTEXT_TRANSLATE: { |
1053 TabContentsWrapper* tab_contents_wrapper = | 1053 TabContentsWrapper* tab_contents_wrapper = |
1054 TabContentsWrapper::GetCurrentWrapperForContents( | 1054 TabContentsWrapper::GetCurrentWrapperForContents( |
1055 source_tab_contents_); | 1055 source_tab_contents_); |
1056 if (!tab_contents_wrapper) | 1056 if (!tab_contents_wrapper) |
1057 return false; | 1057 return false; |
1058 TranslateTabHelper* helper = tab_contents_wrapper->translate_tab_helper(); | 1058 TranslateTabHelper* helper = tab_contents_wrapper->translate_tab_helper(); |
1059 std::string original_lang = | 1059 std::string original_lang = |
1060 helper->language_state().original_language(); | 1060 helper->language_state().original_language(); |
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1861 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), | 1861 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), |
1862 g_browser_process->clipboard()); | 1862 g_browser_process->clipboard()); |
1863 } | 1863 } |
1864 | 1864 |
1865 void RenderViewContextMenu::MediaPlayerActionAt( | 1865 void RenderViewContextMenu::MediaPlayerActionAt( |
1866 const gfx::Point& location, | 1866 const gfx::Point& location, |
1867 const WebMediaPlayerAction& action) { | 1867 const WebMediaPlayerAction& action) { |
1868 source_tab_contents_->render_view_host()-> | 1868 source_tab_contents_->render_view_host()-> |
1869 ExecuteMediaPlayerActionAtLocation(location, action); | 1869 ExecuteMediaPlayerActionAtLocation(location, action); |
1870 } | 1870 } |
OLD | NEW |