| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 } // namespace | 45 } // namespace |
| 46 | 46 |
| 47 class RegisterProtocolHandlerBrowserTest : public InProcessBrowserTest { | 47 class RegisterProtocolHandlerBrowserTest : public InProcessBrowserTest { |
| 48 public: | 48 public: |
| 49 RegisterProtocolHandlerBrowserTest() { } | 49 RegisterProtocolHandlerBrowserTest() { } |
| 50 | 50 |
| 51 TestRenderViewContextMenu* CreateContextMenu(GURL url) { | 51 TestRenderViewContextMenu* CreateContextMenu(GURL url) { |
| 52 content::ContextMenuParams params; | 52 content::ContextMenuParams params; |
| 53 params.media_type = WebKit::WebContextMenuData::MediaTypeNone; | 53 params.media_type = blink::WebContextMenuData::MediaTypeNone; |
| 54 params.link_url = url; | 54 params.link_url = url; |
| 55 params.unfiltered_link_url = url; | 55 params.unfiltered_link_url = url; |
| 56 WebContents* web_contents = | 56 WebContents* web_contents = |
| 57 browser()->tab_strip_model()->GetActiveWebContents(); | 57 browser()->tab_strip_model()->GetActiveWebContents(); |
| 58 params.page_url = web_contents->GetController().GetActiveEntry()->GetURL(); | 58 params.page_url = web_contents->GetController().GetActiveEntry()->GetURL(); |
| 59 #if defined(OS_MACOSX) | 59 #if defined(OS_MACOSX) |
| 60 params.writing_direction_default = 0; | 60 params.writing_direction_default = 0; |
| 61 params.writing_direction_left_to_right = 0; | 61 params.writing_direction_left_to_right = 0; |
| 62 params.writing_direction_right_to_left = 0; | 62 params.writing_direction_right_to_left = 0; |
| 63 #endif // OS_MACOSX | 63 #endif // OS_MACOSX |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 ASSERT_TRUE(test_server()->Start()); | 105 ASSERT_TRUE(test_server()->Start()); |
| 106 GURL handler_url = test_server()->GetURL("files/custom_handler_foo.html"); | 106 GURL handler_url = test_server()->GetURL("files/custom_handler_foo.html"); |
| 107 AddProtocolHandler("foo", handler_url, | 107 AddProtocolHandler("foo", handler_url, |
| 108 UTF8ToUTF16(std::string("Test foo Handler"))); | 108 UTF8ToUTF16(std::string("Test foo Handler"))); |
| 109 | 109 |
| 110 ui_test_utils::NavigateToURL(browser(), GURL("foo:test")); | 110 ui_test_utils::NavigateToURL(browser(), GURL("foo:test")); |
| 111 | 111 |
| 112 ASSERT_EQ(handler_url, | 112 ASSERT_EQ(handler_url, |
| 113 browser()->tab_strip_model()->GetActiveWebContents()->GetURL()); | 113 browser()->tab_strip_model()->GetActiveWebContents()->GetURL()); |
| 114 } | 114 } |
| OLD | NEW |