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/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 10 matching lines...) Expand all Loading... |
21 using content::WebContents; | 21 using content::WebContents; |
22 | 22 |
23 namespace { | 23 namespace { |
24 | 24 |
25 class TestRenderViewContextMenu : public RenderViewContextMenu { | 25 class TestRenderViewContextMenu : public RenderViewContextMenu { |
26 public: | 26 public: |
27 TestRenderViewContextMenu(WebContents* web_contents, | 27 TestRenderViewContextMenu(WebContents* web_contents, |
28 content::ContextMenuParams params) | 28 content::ContextMenuParams params) |
29 : RenderViewContextMenu(web_contents, params) { } | 29 : RenderViewContextMenu(web_contents, params) { } |
30 | 30 |
31 virtual void PlatformInit() { } | 31 virtual void PlatformInit() OVERRIDE { } |
32 virtual void PlatformCancel() { } | 32 virtual void PlatformCancel() OVERRIDE { } |
33 virtual bool GetAcceleratorForCommandId( | 33 virtual bool GetAcceleratorForCommandId( |
34 int command_id, | 34 int command_id, |
35 ui::Accelerator* accelerator) { | 35 ui::Accelerator* accelerator) OVERRIDE { |
36 return false; | 36 return false; |
37 } | 37 } |
38 | 38 |
39 bool IsItemPresent(int command_id) { | 39 bool IsItemPresent(int command_id) { |
40 return menu_model_.GetIndexOfCommandId(command_id) != -1; | 40 return menu_model_.GetIndexOfCommandId(command_id) != -1; |
41 } | 41 } |
42 }; | 42 }; |
43 | 43 |
44 } // namespace | 44 } // namespace |
45 | 45 |
(...skipping 59 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 |