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