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 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1348 return; | 1348 return; |
1349 } | 1349 } |
1350 | 1350 |
1351 if (id >= IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_FIRST && | 1351 if (id >= IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_FIRST && |
1352 id <= IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_LAST) { | 1352 id <= IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_LAST) { |
1353 ProtocolHandlerRegistry::ProtocolHandlerList handlers = | 1353 ProtocolHandlerRegistry::ProtocolHandlerList handlers = |
1354 GetHandlersForLinkUrl(); | 1354 GetHandlersForLinkUrl(); |
1355 if (handlers.empty()) { | 1355 if (handlers.empty()) { |
1356 return; | 1356 return; |
1357 } | 1357 } |
1358 UserMetrics::RecordAction(UserMetricsAction( | 1358 UserMetrics::RecordAction( |
1359 "RegisterProtocolHandler.ContextMenu_Open")); | 1359 UserMetricsAction("RegisterProtocolHandler.ContextMenu_Open")); |
1360 int handlerIndex = id - IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_FIRST; | 1360 int handlerIndex = id - IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_FIRST; |
1361 OpenURL( | 1361 OpenURL( |
1362 handlers[handlerIndex].TranslateUrl(params_.link_url), | 1362 handlers[handlerIndex].TranslateUrl(params_.link_url), |
1363 params_.frame_url.is_empty() ? params_.page_url : params_.frame_url, | 1363 params_.frame_url.is_empty() ? params_.page_url : params_.frame_url, |
1364 params_.frame_id, | 1364 params_.frame_id, |
1365 NEW_FOREGROUND_TAB, | 1365 NEW_FOREGROUND_TAB, |
1366 PageTransition::LINK); | 1366 PageTransition::LINK); |
1367 return; | 1367 return; |
1368 } | 1368 } |
1369 | 1369 |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1672 dir = WebKit::WebTextDirectionRightToLeft; | 1672 dir = WebKit::WebTextDirectionRightToLeft; |
1673 rvh->UpdateTextDirection(dir); | 1673 rvh->UpdateTextDirection(dir); |
1674 rvh->NotifyTextDirection(); | 1674 rvh->NotifyTextDirection(); |
1675 break; | 1675 break; |
1676 } | 1676 } |
1677 case IDC_CONTENT_CONTEXT_LOOK_UP_IN_DICTIONARY: | 1677 case IDC_CONTENT_CONTEXT_LOOK_UP_IN_DICTIONARY: |
1678 LookUpInDictionary(); | 1678 LookUpInDictionary(); |
1679 break; | 1679 break; |
1680 #endif // OS_MACOSX | 1680 #endif // OS_MACOSX |
1681 case IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_SETTINGS: { | 1681 case IDC_CONTENT_CONTEXT_PROTOCOL_HANDLER_SETTINGS: { |
1682 UserMetrics::RecordAction(UserMetricsAction( | 1682 UserMetrics::RecordAction( |
1683 "RegisterProtocolHandler.ContextMenu_Settings")); | 1683 UserMetricsAction("RegisterProtocolHandler.ContextMenu_Settings")); |
1684 std::string url = std::string(chrome::kChromeUISettingsURL) + | 1684 std::string url = std::string(chrome::kChromeUISettingsURL) + |
1685 chrome::kHandlerSettingsSubPage; | 1685 chrome::kHandlerSettingsSubPage; |
1686 OpenURL(GURL(url), GURL(), 0, NEW_FOREGROUND_TAB, PageTransition::LINK); | 1686 OpenURL(GURL(url), GURL(), 0, NEW_FOREGROUND_TAB, PageTransition::LINK); |
1687 break; | 1687 break; |
1688 } | 1688 } |
1689 | 1689 |
1690 case IDC_CONTENT_CONTEXT_ADDSEARCHENGINE: { | 1690 case IDC_CONTENT_CONTEXT_ADDSEARCHENGINE: { |
1691 // Make sure the model is loaded. | 1691 // Make sure the model is loaded. |
1692 TemplateURLService* model = | 1692 TemplateURLService* model = |
1693 TemplateURLServiceFactory::GetForProfile(profile_); | 1693 TemplateURLServiceFactory::GetForProfile(profile_); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1835 g_browser_process->clipboard()); | 1835 g_browser_process->clipboard()); |
1836 } | 1836 } |
1837 | 1837 |
1838 void RenderViewContextMenu::MediaPlayerActionAt( | 1838 void RenderViewContextMenu::MediaPlayerActionAt( |
1839 const gfx::Point& location, | 1839 const gfx::Point& location, |
1840 const WebMediaPlayerAction& action) { | 1840 const WebMediaPlayerAction& action) { |
1841 RenderViewHost* rvh = source_tab_contents_->render_view_host(); | 1841 RenderViewHost* rvh = source_tab_contents_->render_view_host(); |
1842 rvh->Send(new ViewMsg_MediaPlayerActionAt( | 1842 rvh->Send(new ViewMsg_MediaPlayerActionAt( |
1843 rvh->routing_id(), location, action)); | 1843 rvh->routing_id(), location, action)); |
1844 } | 1844 } |
OLD | NEW |