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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
477 | 477 |
478 if (AppendCustomItems()) { | 478 if (AppendCustomItems()) { |
479 // Don't add items for Pepper menu. | 479 // Don't add items for Pepper menu. |
480 if (!params_.custom_context.is_pepper_menu) | 480 if (!params_.custom_context.is_pepper_menu) |
481 AppendDeveloperItems(); | 481 AppendDeveloperItems(); |
482 return; | 482 return; |
483 } | 483 } |
484 | 484 |
485 // When no special node or text is selected and selection has no link, | 485 // When no special node or text is selected and selection has no link, |
486 // show page items. | 486 // show page items. |
487 bool is_devtools = false; | |
488 if (params_.media_type == WebContextMenuData::MediaTypeNone && | 487 if (params_.media_type == WebContextMenuData::MediaTypeNone && |
489 !has_link && | 488 !has_link && |
490 !params_.is_editable && | 489 !params_.is_editable && |
491 !has_selection) { | 490 !has_selection) { |
492 if (!params_.page_url.is_empty()) { | 491 if (!params_.page_url.is_empty()) { |
493 is_devtools = IsDevToolsURL(params_.page_url); | 492 bool is_devtools = IsDevToolsURL(params_.page_url); |
494 if (!is_devtools && !IsInternalResourcesURL(params_.page_url)) { | 493 if (!is_devtools && !IsInternalResourcesURL(params_.page_url)) { |
495 AppendPageItems(); | 494 AppendPageItems(); |
496 // Merge in frame items if we clicked within a frame that needs them. | 495 // Merge in frame items if we clicked within a frame that needs them. |
497 if (!params_.frame_url.is_empty()) { | 496 if (!params_.frame_url.is_empty()) { |
498 is_devtools = IsDevToolsURL(params_.frame_url); | 497 is_devtools = IsDevToolsURL(params_.frame_url); |
499 if (!is_devtools && !IsInternalResourcesURL(params_.frame_url)) { | 498 if (!is_devtools && !IsInternalResourcesURL(params_.frame_url)) { |
500 menu_model_.AddSeparator(); | 499 menu_model_.AddSeparator(); |
501 AppendFrameItems(); | 500 AppendFrameItems(); |
502 } | 501 } |
503 } | 502 } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
535 } | 534 } |
536 | 535 |
537 if (params_.is_editable) | 536 if (params_.is_editable) |
538 AppendEditableItems(); | 537 AppendEditableItems(); |
539 else if (has_selection) | 538 else if (has_selection) |
540 AppendCopyItem(); | 539 AppendCopyItem(); |
541 | 540 |
542 if (has_selection) | 541 if (has_selection) |
543 AppendSearchProvider(); | 542 AppendSearchProvider(); |
544 | 543 |
545 if (!is_devtools) | 544 if (!IsDevToolsURL(params_.page_url)) |
yurys
2011/08/15 15:05:52
It doesn't take into account IsDevToolsURL(params_
| |
546 AppendAllExtensionItems(); | 545 AppendAllExtensionItems(); |
547 | 546 |
548 AppendDeveloperItems(); | 547 AppendDeveloperItems(); |
549 } | 548 } |
550 | 549 |
551 void RenderViewContextMenu::LookUpInDictionary() { | 550 void RenderViewContextMenu::LookUpInDictionary() { |
552 // Used only in the Mac port. | 551 // Used only in the Mac port. |
553 NOTREACHED(); | 552 NOTREACHED(); |
554 } | 553 } |
555 | 554 |
(...skipping 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1834 g_browser_process->clipboard()); | 1833 g_browser_process->clipboard()); |
1835 } | 1834 } |
1836 | 1835 |
1837 void RenderViewContextMenu::MediaPlayerActionAt( | 1836 void RenderViewContextMenu::MediaPlayerActionAt( |
1838 const gfx::Point& location, | 1837 const gfx::Point& location, |
1839 const WebMediaPlayerAction& action) { | 1838 const WebMediaPlayerAction& action) { |
1840 RenderViewHost* rvh = source_tab_contents_->render_view_host(); | 1839 RenderViewHost* rvh = source_tab_contents_->render_view_host(); |
1841 rvh->Send(new ViewMsg_MediaPlayerActionAt( | 1840 rvh->Send(new ViewMsg_MediaPlayerActionAt( |
1842 rvh->routing_id(), location, action)); | 1841 rvh->routing_id(), location, action)); |
1843 } | 1842 } |
OLD | NEW |