| 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 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1112 // unknown language (in which case the page language is detected on | 1112 // unknown language (in which case the page language is detected on |
| 1113 // the server side). | 1113 // the server side). |
| 1114 (original_lang == chrome::kUnknownLanguageCode || | 1114 (original_lang == chrome::kUnknownLanguageCode || |
| 1115 TranslateManager::IsSupportedLanguage(original_lang)) && | 1115 TranslateManager::IsSupportedLanguage(original_lang)) && |
| 1116 !helper->language_state().IsPageTranslated() && | 1116 !helper->language_state().IsPageTranslated() && |
| 1117 !source_tab_contents_->interstitial_page() && | 1117 !source_tab_contents_->interstitial_page() && |
| 1118 TranslateManager::IsTranslatableURL(params_.page_url); | 1118 TranslateManager::IsTranslatableURL(params_.page_url); |
| 1119 } | 1119 } |
| 1120 | 1120 |
| 1121 case IDC_CONTENT_CONTEXT_OPENLINKNEWTAB: | 1121 case IDC_CONTENT_CONTEXT_OPENLINKNEWTAB: |
| 1122 case IDC_CONTENT_CONTEXT_OPENLINKNEWWINDOW: |
| 1122 return params_.link_url.is_valid(); | 1123 return params_.link_url.is_valid(); |
| 1123 case IDC_CONTENT_CONTEXT_OPENLINKNEWWINDOW: | |
| 1124 return params_.link_url.is_valid() && | |
| 1125 incognito_avail != IncognitoModePrefs::FORCED; | |
| 1126 | 1124 |
| 1127 case IDC_CONTENT_CONTEXT_COPYLINKLOCATION: | 1125 case IDC_CONTENT_CONTEXT_COPYLINKLOCATION: |
| 1128 return params_.unfiltered_link_url.is_valid(); | 1126 return params_.unfiltered_link_url.is_valid(); |
| 1129 | 1127 |
| 1130 case IDC_CONTENT_CONTEXT_SAVELINKAS: { | 1128 case IDC_CONTENT_CONTEXT_SAVELINKAS: { |
| 1131 PrefService* local_state = g_browser_process->local_state(); | 1129 PrefService* local_state = g_browser_process->local_state(); |
| 1132 DCHECK(local_state); | 1130 DCHECK(local_state); |
| 1133 // Test if file-selection dialogs are forbidden by policy. | 1131 // Test if file-selection dialogs are forbidden by policy. |
| 1134 if (!local_state->GetBoolean(prefs::kAllowFileSelectionDialogs)) | 1132 if (!local_state->GetBoolean(prefs::kAllowFileSelectionDialogs)) |
| 1135 return false; | 1133 return false; |
| (...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1960 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), | 1958 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), |
| 1961 g_browser_process->clipboard()); | 1959 g_browser_process->clipboard()); |
| 1962 } | 1960 } |
| 1963 | 1961 |
| 1964 void RenderViewContextMenu::MediaPlayerActionAt( | 1962 void RenderViewContextMenu::MediaPlayerActionAt( |
| 1965 const gfx::Point& location, | 1963 const gfx::Point& location, |
| 1966 const WebMediaPlayerAction& action) { | 1964 const WebMediaPlayerAction& action) { |
| 1967 source_tab_contents_->render_view_host()-> | 1965 source_tab_contents_->render_view_host()-> |
| 1968 ExecuteMediaPlayerActionAtLocation(location, action); | 1966 ExecuteMediaPlayerActionAtLocation(location, action); |
| 1969 } | 1967 } |
| OLD | NEW |