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 | 7 |
8 #include "chrome/browser/tab_contents/render_view_context_menu.h" | 8 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1581 | 1581 |
1582 NavigationEntry *active_entry = | 1582 NavigationEntry *active_entry = |
1583 source_tab_contents_->controller().GetActiveEntry(); | 1583 source_tab_contents_->controller().GetActiveEntry(); |
1584 if (!active_entry) | 1584 if (!active_entry) |
1585 return false; | 1585 return false; |
1586 | 1586 |
1587 // Don't inspect view source. | 1587 // Don't inspect view source. |
1588 if (active_entry->IsViewSourceMode()) | 1588 if (active_entry->IsViewSourceMode()) |
1589 return false; | 1589 return false; |
1590 | 1590 |
1591 // Do not inspect Chrome URLs (chrome://network/, chrome://memory/, etc.). | |
1592 // However, do inspect about:blank, which is often used by ordinary web pages. | |
1593 if (active_entry->virtual_url().SchemeIs(chrome::kChromeUIScheme)) | |
1594 return false; | |
1595 | |
1596 if (id == IDC_CONTENT_CONTEXT_INSPECTELEMENT) { | 1591 if (id == IDC_CONTENT_CONTEXT_INSPECTELEMENT) { |
1597 // Don't enable the web inspector if JavaScript is disabled. | 1592 // Don't enable the web inspector if JavaScript is disabled. |
1598 if (!profile_->GetPrefs()->GetBoolean(prefs::kWebKitJavascriptEnabled) || | 1593 if (!profile_->GetPrefs()->GetBoolean(prefs::kWebKitJavascriptEnabled) || |
1599 command_line.HasSwitch(switches::kDisableJavaScript)) | 1594 command_line.HasSwitch(switches::kDisableJavaScript)) |
1600 return false; | 1595 return false; |
1601 // Don't enable the web inspector if the developer tools are disabled via | 1596 // Don't enable the web inspector if the developer tools are disabled via |
1602 // the preference dev-tools-disabled. | 1597 // the preference dev-tools-disabled. |
1603 if (profile_->GetPrefs()->GetBoolean(prefs::kDevToolsDisabled)) | 1598 if (profile_->GetPrefs()->GetBoolean(prefs::kDevToolsDisabled)) |
1604 return false; | 1599 return false; |
1605 } | 1600 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1639 g_browser_process->clipboard()); | 1634 g_browser_process->clipboard()); |
1640 } | 1635 } |
1641 | 1636 |
1642 void RenderViewContextMenu::MediaPlayerActionAt( | 1637 void RenderViewContextMenu::MediaPlayerActionAt( |
1643 const gfx::Point& location, | 1638 const gfx::Point& location, |
1644 const WebMediaPlayerAction& action) { | 1639 const WebMediaPlayerAction& action) { |
1645 RenderViewHost* rvh = source_tab_contents_->render_view_host(); | 1640 RenderViewHost* rvh = source_tab_contents_->render_view_host(); |
1646 rvh->Send(new ViewMsg_MediaPlayerActionAt( | 1641 rvh->Send(new ViewMsg_MediaPlayerActionAt( |
1647 rvh->routing_id(), location, action)); | 1642 rvh->routing_id(), location, action)); |
1648 } | 1643 } |
OLD | NEW |