| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #include "chrome/browser/ui/download/download_tab_helper.h" | 44 #include "chrome/browser/ui/download/download_tab_helper.h" |
| 45 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" | 45 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" |
| 46 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 46 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 47 #include "chrome/common/chrome_constants.h" | 47 #include "chrome/common/chrome_constants.h" |
| 48 #include "chrome/common/chrome_switches.h" | 48 #include "chrome/common/chrome_switches.h" |
| 49 #include "chrome/common/pref_names.h" | 49 #include "chrome/common/pref_names.h" |
| 50 #include "chrome/common/print_messages.h" | 50 #include "chrome/common/print_messages.h" |
| 51 #include "chrome/common/spellcheck_messages.h" | 51 #include "chrome/common/spellcheck_messages.h" |
| 52 #include "chrome/common/url_constants.h" | 52 #include "chrome/common/url_constants.h" |
| 53 #include "content/browser/child_process_security_policy.h" | 53 #include "content/browser/child_process_security_policy.h" |
| 54 #include "content/browser/debugger/devtools_manager.h" | |
| 55 #include "content/browser/debugger/devtools_window.h" | 54 #include "content/browser/debugger/devtools_window.h" |
| 56 #include "content/browser/renderer_host/render_view_host.h" | 55 #include "content/browser/renderer_host/render_view_host.h" |
| 57 #include "content/browser/renderer_host/render_widget_host_view.h" | 56 #include "content/browser/renderer_host/render_widget_host_view.h" |
| 58 #include "content/browser/tab_contents/navigation_entry.h" | 57 #include "content/browser/tab_contents/navigation_entry.h" |
| 59 #include "content/browser/tab_contents/tab_contents.h" | 58 #include "content/browser/tab_contents/tab_contents.h" |
| 60 #include "content/browser/user_metrics.h" | 59 #include "content/browser/user_metrics.h" |
| 61 #include "content/common/content_restriction.h" | 60 #include "content/common/content_restriction.h" |
| 62 #include "content/common/view_messages.h" | 61 #include "content/common/view_messages.h" |
| 63 #include "grit/generated_resources.h" | 62 #include "grit/generated_resources.h" |
| 64 #include "net/base/escape.h" | 63 #include "net/base/escape.h" |
| (...skipping 1671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1736 source_tab_contents_->OpenURL(url, referrer, disposition, transition); | 1735 source_tab_contents_->OpenURL(url, referrer, disposition, transition); |
| 1737 } | 1736 } |
| 1738 | 1737 |
| 1739 void RenderViewContextMenu::CopyImageAt(int x, int y) { | 1738 void RenderViewContextMenu::CopyImageAt(int x, int y) { |
| 1740 RenderViewHost* rvh = source_tab_contents_->render_view_host(); | 1739 RenderViewHost* rvh = source_tab_contents_->render_view_host(); |
| 1741 rvh->Send(new ViewMsg_CopyImageAt(rvh->routing_id(), x, y)); | 1740 rvh->Send(new ViewMsg_CopyImageAt(rvh->routing_id(), x, y)); |
| 1742 } | 1741 } |
| 1743 | 1742 |
| 1744 void RenderViewContextMenu::Inspect(int x, int y) { | 1743 void RenderViewContextMenu::Inspect(int x, int y) { |
| 1745 UserMetrics::RecordAction(UserMetricsAction("DevTools_InspectElement")); | 1744 UserMetrics::RecordAction(UserMetricsAction("DevTools_InspectElement")); |
| 1746 DevToolsManager::GetInstance()->InspectElement( | 1745 DevToolsWindow::InspectElement( |
| 1747 source_tab_contents_->render_view_host(), x, y); | 1746 source_tab_contents_->render_view_host(), x, y); |
| 1748 } | 1747 } |
| 1749 | 1748 |
| 1750 void RenderViewContextMenu::WriteURLToClipboard(const GURL& url) { | 1749 void RenderViewContextMenu::WriteURLToClipboard(const GURL& url) { |
| 1751 chrome_browser_net::WriteURLToClipboard( | 1750 chrome_browser_net::WriteURLToClipboard( |
| 1752 url, | 1751 url, |
| 1753 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), | 1752 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), |
| 1754 g_browser_process->clipboard()); | 1753 g_browser_process->clipboard()); |
| 1755 } | 1754 } |
| 1756 | 1755 |
| 1757 void RenderViewContextMenu::MediaPlayerActionAt( | 1756 void RenderViewContextMenu::MediaPlayerActionAt( |
| 1758 const gfx::Point& location, | 1757 const gfx::Point& location, |
| 1759 const WebMediaPlayerAction& action) { | 1758 const WebMediaPlayerAction& action) { |
| 1760 RenderViewHost* rvh = source_tab_contents_->render_view_host(); | 1759 RenderViewHost* rvh = source_tab_contents_->render_view_host(); |
| 1761 rvh->Send(new ViewMsg_MediaPlayerActionAt( | 1760 rvh->Send(new ViewMsg_MediaPlayerActionAt( |
| 1762 rvh->routing_id(), location, action)); | 1761 rvh->routing_id(), location, action)); |
| 1763 } | 1762 } |
| OLD | NEW |