Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Side by Side Diff: chrome/browser/custom_handlers/protocol_handler_registry_browsertest.cc

Issue 8588039: Remove "open in new tab" items from context menu if the process doesn't (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <string> 5 #include <string>
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/string16.h" 8 #include "base/string16.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/app/chrome_command_ids.h" 10 #include "chrome/app/chrome_command_ids.h"
(...skipping 24 matching lines...) Expand all
35 }; 35 };
36 36
37 class RegisterProtocolHandlerBrowserTest : public InProcessBrowserTest { 37 class RegisterProtocolHandlerBrowserTest : public InProcessBrowserTest {
38 public: 38 public:
39 RegisterProtocolHandlerBrowserTest() { } 39 RegisterProtocolHandlerBrowserTest() { }
40 40
41 TestRenderViewContextMenu* CreateContextMenu(GURL url) { 41 TestRenderViewContextMenu* CreateContextMenu(GURL url) {
42 ContextMenuParams params; 42 ContextMenuParams params;
43 params.media_type = WebKit::WebContextMenuData::MediaTypeNone; 43 params.media_type = WebKit::WebContextMenuData::MediaTypeNone;
44 params.link_url = url; 44 params.link_url = url;
45 params.unfiltered_link_url = url;
45 TabContents* tab_contents = browser()->GetSelectedTabContents(); 46 TabContents* tab_contents = browser()->GetSelectedTabContents();
46 params.page_url = tab_contents->controller().GetActiveEntry()->url(); 47 params.page_url = tab_contents->controller().GetActiveEntry()->url();
47 #if defined(OS_MACOSX) 48 #if defined(OS_MACOSX)
48 params.writing_direction_default = 0; 49 params.writing_direction_default = 0;
49 params.writing_direction_left_to_right = 0; 50 params.writing_direction_left_to_right = 0;
50 params.writing_direction_right_to_left = 0; 51 params.writing_direction_right_to_left = 0;
51 #endif // OS_MACOSX 52 #endif // OS_MACOSX
52 TestRenderViewContextMenu* menu = new TestRenderViewContextMenu( 53 TestRenderViewContextMenu* menu = new TestRenderViewContextMenu(
53 browser()->GetSelectedTabContents(), params); 54 browser()->GetSelectedTabContents(), params);
54 menu->Init(); 55 menu->Init();
(...skipping 16 matching lines...) Expand all
71 72
72 GURL url("web+search:testing"); 73 GURL url("web+search:testing");
73 registry->OnAcceptRegisterProtocolHandler(handler); 74 registry->OnAcceptRegisterProtocolHandler(handler);
74 ASSERT_TRUE(registry->IsHandledProtocol("web+search")); 75 ASSERT_TRUE(registry->IsHandledProtocol("web+search"));
75 ASSERT_EQ(registry->GetHandlersFor(url.scheme()).size(), (size_t) 1); 76 ASSERT_EQ(registry->GetHandlersFor(url.scheme()).size(), (size_t) 1);
76 menu.reset(CreateContextMenu(url)); 77 menu.reset(CreateContextMenu(url));
77 ASSERT_TRUE(menu->IsItemPresent(IDC_CONTENT_CONTEXT_OPENLINKWITH)); 78 ASSERT_TRUE(menu->IsItemPresent(IDC_CONTENT_CONTEXT_OPENLINKWITH));
78 } 79 }
79 80
80 } // namespace 81 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/browser/tab_contents/render_view_context_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698