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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 virtual ~FakeProtocolClientWorker() {} | 120 virtual ~FakeProtocolClientWorker() {} |
121 | 121 |
122 virtual ShellIntegration::DefaultWebClientState CheckIsDefault() { | 122 virtual ShellIntegration::DefaultWebClientState CheckIsDefault() { |
123 if (force_failure_) { | 123 if (force_failure_) { |
124 return ShellIntegration::NOT_DEFAULT_WEB_CLIENT; | 124 return ShellIntegration::NOT_DEFAULT_WEB_CLIENT; |
125 } else { | 125 } else { |
126 return ShellIntegration::IS_DEFAULT_WEB_CLIENT; | 126 return ShellIntegration::IS_DEFAULT_WEB_CLIENT; |
127 } | 127 } |
128 } | 128 } |
129 | 129 |
130 virtual void SetAsDefault() {} | 130 virtual void SetAsDefault(bool interactive_permitted) {} |
131 | 131 |
132 private: | 132 private: |
133 bool force_failure_; | 133 bool force_failure_; |
134 }; | 134 }; |
135 | 135 |
136 ProtocolHandlerRegistry::DefaultClientObserver* | 136 ProtocolHandlerRegistry::DefaultClientObserver* |
137 FakeDelegate::CreateShellObserver(ProtocolHandlerRegistry* registry) { | 137 FakeDelegate::CreateShellObserver(ProtocolHandlerRegistry* registry) { |
138 return new FakeClientObserver(registry, this); | 138 return new FakeClientObserver(registry, this); |
139 } | 139 } |
140 | 140 |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 ASSERT_EQ(ph3.url().GetOrigin() == ph2.url().GetOrigin(), | 806 ASSERT_EQ(ph3.url().GetOrigin() == ph2.url().GetOrigin(), |
807 ph3.IsSameOrigin(ph2)); | 807 ph3.IsSameOrigin(ph2)); |
808 } | 808 } |
809 | 809 |
810 TEST_F(ProtocolHandlerRegistryTest, TestInstallDefaultHandler) { | 810 TEST_F(ProtocolHandlerRegistryTest, TestInstallDefaultHandler) { |
811 ReloadProtocolHandlerRegistryAndInstallDefaultHandler(); | 811 ReloadProtocolHandlerRegistryAndInstallDefaultHandler(); |
812 std::vector<std::string> protocols; | 812 std::vector<std::string> protocols; |
813 registry()->GetRegisteredProtocols(&protocols); | 813 registry()->GetRegisteredProtocols(&protocols); |
814 ASSERT_EQ(static_cast<size_t>(1), protocols.size()); | 814 ASSERT_EQ(static_cast<size_t>(1), protocols.size()); |
815 } | 815 } |
OLD | NEW |