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 #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 1790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1801 view->ShowingContextMenu(false); | 1801 view->ShowingContextMenu(false); |
1802 RenderViewHost* rvh = source_tab_contents_->render_view_host(); | 1802 RenderViewHost* rvh = source_tab_contents_->render_view_host(); |
1803 if (rvh) { | 1803 if (rvh) { |
1804 rvh->NotifyContextMenuClosed(params_.custom_context); | 1804 rvh->NotifyContextMenuClosed(params_.custom_context); |
1805 } | 1805 } |
1806 } | 1806 } |
1807 | 1807 |
1808 bool RenderViewContextMenu::IsDevCommandEnabled(int id) const { | 1808 bool RenderViewContextMenu::IsDevCommandEnabled(int id) const { |
1809 if (id == IDC_CONTENT_CONTEXT_INSPECTELEMENT) { | 1809 if (id == IDC_CONTENT_CONTEXT_INSPECTELEMENT) { |
1810 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 1810 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 1811 TabContentsWrapper* tab_contents_wrapper = |
| 1812 TabContentsWrapper::GetCurrentWrapperForContents( |
| 1813 source_tab_contents_); |
| 1814 if (!tab_contents_wrapper) |
| 1815 return false; |
1811 // Don't enable the web inspector if JavaScript is disabled. | 1816 // Don't enable the web inspector if JavaScript is disabled. |
1812 if (!profile_->GetPrefs()->GetBoolean(prefs::kWebKitJavascriptEnabled) || | 1817 if (!tab_contents_wrapper->per_tab_prefs()->GetBoolean( |
| 1818 prefs::kWebKitJavascriptEnabled) || |
1813 command_line.HasSwitch(switches::kDisableJavaScript)) | 1819 command_line.HasSwitch(switches::kDisableJavaScript)) |
1814 return false; | 1820 return false; |
1815 // Don't enable the web inspector if the developer tools are disabled via | 1821 // Don't enable the web inspector if the developer tools are disabled via |
1816 // the preference dev-tools-disabled. | 1822 // the preference dev-tools-disabled. |
1817 if (profile_->GetPrefs()->GetBoolean(prefs::kDevToolsDisabled)) | 1823 if (profile_->GetPrefs()->GetBoolean(prefs::kDevToolsDisabled)) |
1818 return false; | 1824 return false; |
1819 } | 1825 } |
1820 | 1826 |
1821 return true; | 1827 return true; |
1822 } | 1828 } |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1865 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), | 1871 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), |
1866 g_browser_process->clipboard()); | 1872 g_browser_process->clipboard()); |
1867 } | 1873 } |
1868 | 1874 |
1869 void RenderViewContextMenu::MediaPlayerActionAt( | 1875 void RenderViewContextMenu::MediaPlayerActionAt( |
1870 const gfx::Point& location, | 1876 const gfx::Point& location, |
1871 const WebMediaPlayerAction& action) { | 1877 const WebMediaPlayerAction& action) { |
1872 source_tab_contents_->render_view_host()-> | 1878 source_tab_contents_->render_view_host()-> |
1873 ExecuteMediaPlayerActionAtLocation(location, action); | 1879 ExecuteMediaPlayerActionAtLocation(location, action); |
1874 } | 1880 } |
OLD | NEW |