| 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 27 matching lines...) Expand all Loading... |
| 38 #include "chrome/browser/search_engines/template_url_service.h" | 38 #include "chrome/browser/search_engines/template_url_service.h" |
| 39 #include "chrome/browser/search_engines/template_url_service_factory.h" | 39 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 40 #include "chrome/browser/spellchecker/spellcheck_host.h" | 40 #include "chrome/browser/spellchecker/spellcheck_host.h" |
| 41 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" | 41 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" |
| 42 #include "chrome/browser/tab_contents/spellchecker_submenu_observer.h" | 42 #include "chrome/browser/tab_contents/spellchecker_submenu_observer.h" |
| 43 #include "chrome/browser/tab_contents/spelling_menu_observer.h" | 43 #include "chrome/browser/tab_contents/spelling_menu_observer.h" |
| 44 #include "chrome/browser/translate/translate_manager.h" | 44 #include "chrome/browser/translate/translate_manager.h" |
| 45 #include "chrome/browser/translate/translate_prefs.h" | 45 #include "chrome/browser/translate/translate_prefs.h" |
| 46 #include "chrome/browser/translate/translate_tab_helper.h" | 46 #include "chrome/browser/translate/translate_tab_helper.h" |
| 47 #include "chrome/browser/ui/browser.h" | 47 #include "chrome/browser/ui/browser.h" |
| 48 #include "chrome/browser/ui/prefs/prefs_tab_helper.h" |
| 48 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" | 49 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" |
| 49 #include "chrome/browser/ui/tab_contents/per_tab_prefs_tab_helper.h" | |
| 50 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 50 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 51 #include "chrome/common/chrome_constants.h" | 51 #include "chrome/common/chrome_constants.h" |
| 52 #include "chrome/common/chrome_switches.h" | 52 #include "chrome/common/chrome_switches.h" |
| 53 #include "chrome/common/pref_names.h" | 53 #include "chrome/common/pref_names.h" |
| 54 #include "chrome/common/print_messages.h" | 54 #include "chrome/common/print_messages.h" |
| 55 #include "chrome/common/spellcheck_messages.h" | 55 #include "chrome/common/spellcheck_messages.h" |
| 56 #include "chrome/common/url_constants.h" | 56 #include "chrome/common/url_constants.h" |
| 57 #include "content/browser/child_process_security_policy.h" | 57 #include "content/browser/child_process_security_policy.h" |
| 58 #include "content/browser/download/download_manager.h" | 58 #include "content/browser/download/download_manager.h" |
| 59 #include "content/browser/download/download_stats.h" | 59 #include "content/browser/download/download_stats.h" |
| (...skipping 1712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1772 | 1772 |
| 1773 bool RenderViewContextMenu::IsDevCommandEnabled(int id) const { | 1773 bool RenderViewContextMenu::IsDevCommandEnabled(int id) const { |
| 1774 if (id == IDC_CONTENT_CONTEXT_INSPECTELEMENT) { | 1774 if (id == IDC_CONTENT_CONTEXT_INSPECTELEMENT) { |
| 1775 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 1775 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 1776 TabContentsWrapper* tab_contents_wrapper = | 1776 TabContentsWrapper* tab_contents_wrapper = |
| 1777 TabContentsWrapper::GetCurrentWrapperForContents( | 1777 TabContentsWrapper::GetCurrentWrapperForContents( |
| 1778 source_tab_contents_); | 1778 source_tab_contents_); |
| 1779 if (!tab_contents_wrapper) | 1779 if (!tab_contents_wrapper) |
| 1780 return false; | 1780 return false; |
| 1781 // Don't enable the web inspector if JavaScript is disabled. | 1781 // Don't enable the web inspector if JavaScript is disabled. |
| 1782 if (!tab_contents_wrapper->per_tab_prefs_tab_helper()->prefs()->GetBoolean( | 1782 if (!tab_contents_wrapper->prefs_tab_helper()->per_tab_prefs()->GetBoolean( |
| 1783 prefs::kWebKitJavascriptEnabled) || | 1783 prefs::kWebKitJavascriptEnabled) || |
| 1784 command_line.HasSwitch(switches::kDisableJavaScript)) | 1784 command_line.HasSwitch(switches::kDisableJavaScript)) |
| 1785 return false; | 1785 return false; |
| 1786 // Don't enable the web inspector if the developer tools are disabled via | 1786 // Don't enable the web inspector if the developer tools are disabled via |
| 1787 // the preference dev-tools-disabled. | 1787 // the preference dev-tools-disabled. |
| 1788 if (profile_->GetPrefs()->GetBoolean(prefs::kDevToolsDisabled)) | 1788 if (profile_->GetPrefs()->GetBoolean(prefs::kDevToolsDisabled)) |
| 1789 return false; | 1789 return false; |
| 1790 } | 1790 } |
| 1791 | 1791 |
| 1792 return true; | 1792 return true; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1837 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), | 1837 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), |
| 1838 g_browser_process->clipboard()); | 1838 g_browser_process->clipboard()); |
| 1839 } | 1839 } |
| 1840 | 1840 |
| 1841 void RenderViewContextMenu::MediaPlayerActionAt( | 1841 void RenderViewContextMenu::MediaPlayerActionAt( |
| 1842 const gfx::Point& location, | 1842 const gfx::Point& location, |
| 1843 const WebMediaPlayerAction& action) { | 1843 const WebMediaPlayerAction& action) { |
| 1844 source_tab_contents_->render_view_host()-> | 1844 source_tab_contents_->render_view_host()-> |
| 1845 ExecuteMediaPlayerActionAtLocation(location, action); | 1845 ExecuteMediaPlayerActionAtLocation(location, action); |
| 1846 } | 1846 } |
| OLD | NEW |