| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1239 } | 1239 } |
| 1240 std::string original_lang = | 1240 std::string original_lang = |
| 1241 source_tab_contents_->language_state().original_language(); | 1241 source_tab_contents_->language_state().original_language(); |
| 1242 std::string target_lang = g_browser_process->GetApplicationLocale(); | 1242 std::string target_lang = g_browser_process->GetApplicationLocale(); |
| 1243 target_lang = TranslateManager::GetLanguageCode(target_lang); | 1243 target_lang = TranslateManager::GetLanguageCode(target_lang); |
| 1244 // Since the user decided to translate for that language and site, clears | 1244 // Since the user decided to translate for that language and site, clears |
| 1245 // any preferences for not translating them. | 1245 // any preferences for not translating them. |
| 1246 TranslatePrefs prefs(profile_->GetPrefs()); | 1246 TranslatePrefs prefs(profile_->GetPrefs()); |
| 1247 prefs.RemoveLanguageFromBlacklist(original_lang); | 1247 prefs.RemoveLanguageFromBlacklist(original_lang); |
| 1248 prefs.RemoveSiteFromBlacklist(params_.page_url.HostNoBrackets()); | 1248 prefs.RemoveSiteFromBlacklist(params_.page_url.HostNoBrackets()); |
| 1249 Singleton<TranslateManager>::get()->TranslatePage( | 1249 TranslateManager::GetInstance()->TranslatePage( |
| 1250 source_tab_contents_, original_lang, target_lang); | 1250 source_tab_contents_, original_lang, target_lang); |
| 1251 break; | 1251 break; |
| 1252 } | 1252 } |
| 1253 | 1253 |
| 1254 case IDC_CONTENT_CONTEXT_RELOADFRAME: | 1254 case IDC_CONTENT_CONTEXT_RELOADFRAME: |
| 1255 source_tab_contents_->render_view_host()->ReloadFrame(); | 1255 source_tab_contents_->render_view_host()->ReloadFrame(); |
| 1256 break; | 1256 break; |
| 1257 | 1257 |
| 1258 case IDC_CONTENT_CONTEXT_VIEWFRAMESOURCE: | 1258 case IDC_CONTENT_CONTEXT_VIEWFRAMESOURCE: |
| 1259 OpenURL(GURL(chrome::kViewSourceScheme + std::string(":") + | 1259 OpenURL(GURL(chrome::kViewSourceScheme + std::string(":") + |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1460 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), | 1460 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), |
| 1461 g_browser_process->clipboard()); | 1461 g_browser_process->clipboard()); |
| 1462 } | 1462 } |
| 1463 | 1463 |
| 1464 void RenderViewContextMenu::MediaPlayerActionAt( | 1464 void RenderViewContextMenu::MediaPlayerActionAt( |
| 1465 const gfx::Point& location, | 1465 const gfx::Point& location, |
| 1466 const WebMediaPlayerAction& action) { | 1466 const WebMediaPlayerAction& action) { |
| 1467 source_tab_contents_->render_view_host()->MediaPlayerActionAt( | 1467 source_tab_contents_->render_view_host()->MediaPlayerActionAt( |
| 1468 location, action); | 1468 location, action); |
| 1469 } | 1469 } |
| OLD | NEW |