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 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1470 | 1470 |
1471 NavigationEntry *active_entry = | 1471 NavigationEntry *active_entry = |
1472 source_tab_contents_->controller().GetActiveEntry(); | 1472 source_tab_contents_->controller().GetActiveEntry(); |
1473 if (!active_entry) | 1473 if (!active_entry) |
1474 return false; | 1474 return false; |
1475 | 1475 |
1476 // Don't inspect view source. | 1476 // Don't inspect view source. |
1477 if (active_entry->IsViewSourceMode()) | 1477 if (active_entry->IsViewSourceMode()) |
1478 return false; | 1478 return false; |
1479 | 1479 |
1480 // Don't inspect HTML dialogs (doesn't work anyway). | |
1481 if (active_entry->url().SchemeIs(chrome::kGearsScheme)) | |
1482 return false; | |
1483 | |
1484 // Don't inspect about:network, about:memory, etc. | 1480 // Don't inspect about:network, about:memory, etc. |
1485 // However, we do want to inspect about:blank, which is often | 1481 // However, we do want to inspect about:blank, which is often |
1486 // used by ordinary web pages. | 1482 // used by ordinary web pages. |
1487 if (active_entry->virtual_url().SchemeIs(chrome::kAboutScheme) && | 1483 if (active_entry->virtual_url().SchemeIs(chrome::kAboutScheme) && |
1488 !LowerCaseEqualsASCII(active_entry->virtual_url().path(), "blank")) | 1484 !LowerCaseEqualsASCII(active_entry->virtual_url().path(), "blank")) |
1489 return false; | 1485 return false; |
1490 | 1486 |
1491 if (id == IDC_CONTENT_CONTEXT_INSPECTELEMENT) { | 1487 if (id == IDC_CONTENT_CONTEXT_INSPECTELEMENT) { |
1492 // Don't enable the web inspector if JavaScript is disabled. | 1488 // Don't enable the web inspector if JavaScript is disabled. |
1493 if (!profile_->GetPrefs()->GetBoolean(prefs::kWebKitJavascriptEnabled) || | 1489 if (!profile_->GetPrefs()->GetBoolean(prefs::kWebKitJavascriptEnabled) || |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1533 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), | 1529 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), |
1534 g_browser_process->clipboard()); | 1530 g_browser_process->clipboard()); |
1535 } | 1531 } |
1536 | 1532 |
1537 void RenderViewContextMenu::MediaPlayerActionAt( | 1533 void RenderViewContextMenu::MediaPlayerActionAt( |
1538 const gfx::Point& location, | 1534 const gfx::Point& location, |
1539 const WebMediaPlayerAction& action) { | 1535 const WebMediaPlayerAction& action) { |
1540 source_tab_contents_->render_view_host()->MediaPlayerActionAt( | 1536 source_tab_contents_->render_view_host()->MediaPlayerActionAt( |
1541 location, action); | 1537 location, action); |
1542 } | 1538 } |
OLD | NEW |