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 // Don't inspect about:network, about:memory, etc. | 1591 // Do not inspect Chrome URLs (chrome://network/, chrome://memory/, etc.). |
1592 // However, we do want to inspect about:blank, which is often | 1592 // However, do inspect about:blank, which is often used by ordinary web pages. |
1593 // used by ordinary web pages. | 1593 if (active_entry->virtual_url().SchemeIs(chrome::kChromeUIScheme)) |
1594 if (active_entry->virtual_url().SchemeIs(chrome::kAboutScheme) && | |
1595 !LowerCaseEqualsASCII(active_entry->virtual_url().path(), "blank")) | |
1596 return false; | 1594 return false; |
1597 | 1595 |
1598 if (id == IDC_CONTENT_CONTEXT_INSPECTELEMENT) { | 1596 if (id == IDC_CONTENT_CONTEXT_INSPECTELEMENT) { |
1599 // Don't enable the web inspector if JavaScript is disabled. | 1597 // Don't enable the web inspector if JavaScript is disabled. |
1600 if (!profile_->GetPrefs()->GetBoolean(prefs::kWebKitJavascriptEnabled) || | 1598 if (!profile_->GetPrefs()->GetBoolean(prefs::kWebKitJavascriptEnabled) || |
1601 command_line.HasSwitch(switches::kDisableJavaScript)) | 1599 command_line.HasSwitch(switches::kDisableJavaScript)) |
1602 return false; | 1600 return false; |
1603 // Don't enable the web inspector if the developer tools are disabled via | 1601 // Don't enable the web inspector if the developer tools are disabled via |
1604 // the preference dev-tools-disabled. | 1602 // the preference dev-tools-disabled. |
1605 if (profile_->GetPrefs()->GetBoolean(prefs::kDevToolsDisabled)) | 1603 if (profile_->GetPrefs()->GetBoolean(prefs::kDevToolsDisabled)) |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1641 g_browser_process->clipboard()); | 1639 g_browser_process->clipboard()); |
1642 } | 1640 } |
1643 | 1641 |
1644 void RenderViewContextMenu::MediaPlayerActionAt( | 1642 void RenderViewContextMenu::MediaPlayerActionAt( |
1645 const gfx::Point& location, | 1643 const gfx::Point& location, |
1646 const WebMediaPlayerAction& action) { | 1644 const WebMediaPlayerAction& action) { |
1647 RenderViewHost* rvh = source_tab_contents_->render_view_host(); | 1645 RenderViewHost* rvh = source_tab_contents_->render_view_host(); |
1648 rvh->Send(new ViewMsg_MediaPlayerActionAt( | 1646 rvh->Send(new ViewMsg_MediaPlayerActionAt( |
1649 rvh->routing_id(), location, action)); | 1647 rvh->routing_id(), location, action)); |
1650 } | 1648 } |
OLD | NEW |