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 "chrome/browser/custom_handlers/protocol_handler_registry.h" | 5 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 class FakeProtocolClientWorker | 110 class FakeProtocolClientWorker |
111 : public ShellIntegration::DefaultProtocolClientWorker { | 111 : public ShellIntegration::DefaultProtocolClientWorker { |
112 public: | 112 public: |
113 FakeProtocolClientWorker(ShellIntegration::DefaultWebClientObserver* observer, | 113 FakeProtocolClientWorker(ShellIntegration::DefaultWebClientObserver* observer, |
114 const std::string& protocol, | 114 const std::string& protocol, |
115 bool force_failure) | 115 bool force_failure) |
116 : ShellIntegration::DefaultProtocolClientWorker(observer, protocol), | 116 : ShellIntegration::DefaultProtocolClientWorker(observer, protocol), |
117 force_failure_(force_failure) {} | 117 force_failure_(force_failure) {} |
118 | 118 |
119 private: | 119 private: |
| 120 virtual ~FakeProtocolClientWorker() {} |
| 121 |
120 virtual ShellIntegration::DefaultWebClientState CheckIsDefault() { | 122 virtual ShellIntegration::DefaultWebClientState CheckIsDefault() { |
121 if (force_failure_) { | 123 if (force_failure_) { |
122 return ShellIntegration::NOT_DEFAULT_WEB_CLIENT; | 124 return ShellIntegration::NOT_DEFAULT_WEB_CLIENT; |
123 } else { | 125 } else { |
124 return ShellIntegration::IS_DEFAULT_WEB_CLIENT; | 126 return ShellIntegration::IS_DEFAULT_WEB_CLIENT; |
125 } | 127 } |
126 } | 128 } |
127 | 129 |
128 virtual void SetAsDefault() {} | 130 virtual void SetAsDefault() {} |
129 | 131 |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 GURL("http://other.com/%s"), "test"); | 789 GURL("http://other.com/%s"), "test"); |
788 ASSERT_EQ(ph1.url().GetOrigin() == ph2.url().GetOrigin(), | 790 ASSERT_EQ(ph1.url().GetOrigin() == ph2.url().GetOrigin(), |
789 ph1.IsSameOrigin(ph2)); | 791 ph1.IsSameOrigin(ph2)); |
790 ASSERT_EQ(ph1.url().GetOrigin() == ph2.url().GetOrigin(), | 792 ASSERT_EQ(ph1.url().GetOrigin() == ph2.url().GetOrigin(), |
791 ph2.IsSameOrigin(ph1)); | 793 ph2.IsSameOrigin(ph1)); |
792 ASSERT_EQ(ph2.url().GetOrigin() == ph3.url().GetOrigin(), | 794 ASSERT_EQ(ph2.url().GetOrigin() == ph3.url().GetOrigin(), |
793 ph2.IsSameOrigin(ph3)); | 795 ph2.IsSameOrigin(ph3)); |
794 ASSERT_EQ(ph3.url().GetOrigin() == ph2.url().GetOrigin(), | 796 ASSERT_EQ(ph3.url().GetOrigin() == ph2.url().GetOrigin(), |
795 ph3.IsSameOrigin(ph2)); | 797 ph3.IsSameOrigin(ph2)); |
796 } | 798 } |
OLD | NEW |