| 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/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 delegate_(registry_delegate) {} | 199 delegate_(registry_delegate) {} |
| 200 | 200 |
| 201 void SetDefaultWebClientUIState( | 201 void SetDefaultWebClientUIState( |
| 202 ShellIntegration::DefaultWebClientUIState state) override { | 202 ShellIntegration::DefaultWebClientUIState state) override { |
| 203 ProtocolHandlerRegistry::DefaultClientObserver::SetDefaultWebClientUIState( | 203 ProtocolHandlerRegistry::DefaultClientObserver::SetDefaultWebClientUIState( |
| 204 state); | 204 state); |
| 205 if (state == ShellIntegration::STATE_IS_DEFAULT) { | 205 if (state == ShellIntegration::STATE_IS_DEFAULT) { |
| 206 delegate_->FakeRegisterWithOS(worker_->protocol()); | 206 delegate_->FakeRegisterWithOS(worker_->protocol()); |
| 207 } | 207 } |
| 208 if (state != ShellIntegration::STATE_PROCESSING) { | 208 if (state != ShellIntegration::STATE_PROCESSING) { |
| 209 base::MessageLoop::current()->Quit(); | 209 base::MessageLoop::current()->QuitWhenIdle(); |
| 210 } | 210 } |
| 211 } | 211 } |
| 212 | 212 |
| 213 private: | 213 private: |
| 214 FakeDelegate* delegate_; | 214 FakeDelegate* delegate_; |
| 215 }; | 215 }; |
| 216 | 216 |
| 217 class FakeProtocolClientWorker | 217 class FakeProtocolClientWorker |
| 218 : public ShellIntegration::DefaultProtocolClientWorker { | 218 : public ShellIntegration::DefaultProtocolClientWorker { |
| 219 public: | 219 public: |
| (...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1131 // added to pref. | 1131 // added to pref. |
| 1132 ASSERT_EQ(InPrefIgnoredHandlerCount(), 2); | 1132 ASSERT_EQ(InPrefIgnoredHandlerCount(), 2); |
| 1133 ASSERT_EQ(InMemoryIgnoredHandlerCount(), 4); | 1133 ASSERT_EQ(InMemoryIgnoredHandlerCount(), 4); |
| 1134 | 1134 |
| 1135 registry()->RemoveIgnoredHandler(p2u1); | 1135 registry()->RemoveIgnoredHandler(p2u1); |
| 1136 | 1136 |
| 1137 // p2u1 installed by user and policy, so it is removed from pref alone. | 1137 // p2u1 installed by user and policy, so it is removed from pref alone. |
| 1138 ASSERT_EQ(InPrefIgnoredHandlerCount(), 1); | 1138 ASSERT_EQ(InPrefIgnoredHandlerCount(), 1); |
| 1139 ASSERT_EQ(InMemoryIgnoredHandlerCount(), 4); | 1139 ASSERT_EQ(InMemoryIgnoredHandlerCount(), 4); |
| 1140 } | 1140 } |
| OLD | NEW |