OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/renderer_context_menu/render_view_context_menu.h" | 5 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1717 | 1717 |
1718 content::NotificationService::current()->Notify( | 1718 content::NotificationService::current()->Notify( |
1719 chrome::NOTIFICATION_RETARGETING, | 1719 chrome::NOTIFICATION_RETARGETING, |
1720 content::Source<Profile>(GetProfile()), | 1720 content::Source<Profile>(GetProfile()), |
1721 content::Details<RetargetingDetails>(&details)); | 1721 content::Details<RetargetingDetails>(&details)); |
1722 } | 1722 } |
1723 | 1723 |
1724 bool RenderViewContextMenu::IsDevCommandEnabled(int id) const { | 1724 bool RenderViewContextMenu::IsDevCommandEnabled(int id) const { |
1725 if (id == IDC_CONTENT_CONTEXT_INSPECTELEMENT || | 1725 if (id == IDC_CONTENT_CONTEXT_INSPECTELEMENT || |
1726 id == IDC_CONTENT_CONTEXT_INSPECTBACKGROUNDPAGE) { | 1726 id == IDC_CONTENT_CONTEXT_INSPECTBACKGROUNDPAGE) { |
1727 const base::CommandLine* command_line = | |
1728 base::CommandLine::ForCurrentProcess(); | |
1729 if (!GetPrefs(browser_context_) | 1727 if (!GetPrefs(browser_context_) |
1730 ->GetBoolean(prefs::kWebKitJavascriptEnabled) || | 1728 ->GetBoolean(prefs::kWebKitJavascriptEnabled)) |
1731 command_line->HasSwitch(switches::kDisableJavaScript)) | |
1732 return false; | 1729 return false; |
1733 | 1730 |
1734 // Don't enable the web inspector if the developer tools are disabled via | 1731 // Don't enable the web inspector if the developer tools are disabled via |
1735 // the preference dev-tools-disabled. | 1732 // the preference dev-tools-disabled. |
1736 if (GetPrefs(browser_context_)->GetBoolean(prefs::kDevToolsDisabled)) | 1733 if (GetPrefs(browser_context_)->GetBoolean(prefs::kDevToolsDisabled)) |
1737 return false; | 1734 return false; |
1738 } | 1735 } |
1739 | 1736 |
1740 return true; | 1737 return true; |
1741 } | 1738 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1783 source_web_contents_->GetRenderViewHost()-> | 1780 source_web_contents_->GetRenderViewHost()-> |
1784 ExecuteMediaPlayerActionAtLocation(location, action); | 1781 ExecuteMediaPlayerActionAtLocation(location, action); |
1785 } | 1782 } |
1786 | 1783 |
1787 void RenderViewContextMenu::PluginActionAt( | 1784 void RenderViewContextMenu::PluginActionAt( |
1788 const gfx::Point& location, | 1785 const gfx::Point& location, |
1789 const WebPluginAction& action) { | 1786 const WebPluginAction& action) { |
1790 source_web_contents_->GetRenderViewHost()-> | 1787 source_web_contents_->GetRenderViewHost()-> |
1791 ExecutePluginActionAtLocation(location, action); | 1788 ExecutePluginActionAtLocation(location, action); |
1792 } | 1789 } |
OLD | NEW |