| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "chrome/browser/tab_contents/render_view_context_menu.h" | 9 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
| 10 | 10 |
| (...skipping 1900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1911 | 1911 |
| 1912 content::NotificationService::current()->Notify( | 1912 content::NotificationService::current()->Notify( |
| 1913 chrome::NOTIFICATION_RENDER_VIEW_CONTEXT_MENU_CLOSED, | 1913 chrome::NOTIFICATION_RENDER_VIEW_CONTEXT_MENU_CLOSED, |
| 1914 content::Source<RenderViewContextMenu>(this), | 1914 content::Source<RenderViewContextMenu>(this), |
| 1915 content::NotificationService::NoDetails()); | 1915 content::NotificationService::NoDetails()); |
| 1916 } | 1916 } |
| 1917 | 1917 |
| 1918 bool RenderViewContextMenu::IsDevCommandEnabled(int id) const { | 1918 bool RenderViewContextMenu::IsDevCommandEnabled(int id) const { |
| 1919 if (id == IDC_CONTENT_CONTEXT_INSPECTELEMENT) { | 1919 if (id == IDC_CONTENT_CONTEXT_INSPECTELEMENT) { |
| 1920 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 1920 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 1921 if (!profile_->GetPrefs()->GetBoolean( | 1921 if (!profile_->GetPrefs()->GetBoolean(prefs::kWebKitJavascriptEnabled) || |
| 1922 prefs::kWebKitGlobalJavascriptEnabled) || | |
| 1923 command_line->HasSwitch(switches::kDisableJavaScript)) | 1922 command_line->HasSwitch(switches::kDisableJavaScript)) |
| 1924 return false; | 1923 return false; |
| 1925 | 1924 |
| 1926 // Don't enable the web inspector if the developer tools are disabled via | 1925 // Don't enable the web inspector if the developer tools are disabled via |
| 1927 // the preference dev-tools-disabled. | 1926 // the preference dev-tools-disabled. |
| 1928 if (profile_->GetPrefs()->GetBoolean(prefs::kDevToolsDisabled)) | 1927 if (profile_->GetPrefs()->GetBoolean(prefs::kDevToolsDisabled)) |
| 1929 return false; | 1928 return false; |
| 1930 } | 1929 } |
| 1931 | 1930 |
| 1932 return true; | 1931 return true; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1985 source_web_contents_->GetRenderViewHost()-> | 1984 source_web_contents_->GetRenderViewHost()-> |
| 1986 ExecuteMediaPlayerActionAtLocation(location, action); | 1985 ExecuteMediaPlayerActionAtLocation(location, action); |
| 1987 } | 1986 } |
| 1988 | 1987 |
| 1989 void RenderViewContextMenu::PluginActionAt( | 1988 void RenderViewContextMenu::PluginActionAt( |
| 1990 const gfx::Point& location, | 1989 const gfx::Point& location, |
| 1991 const WebPluginAction& action) { | 1990 const WebPluginAction& action) { |
| 1992 source_web_contents_->GetRenderViewHost()-> | 1991 source_web_contents_->GetRenderViewHost()-> |
| 1993 ExecutePluginActionAtLocation(location, action); | 1992 ExecutePluginActionAtLocation(location, action); |
| 1994 } | 1993 } |
| OLD | NEW |