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/intents/web_intents_registry.h" | 5 #include "chrome/browser/intents/web_intents_registry.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 DCHECK(wds_.get()); | 444 DCHECK(wds_.get()); |
445 wds_->AddDefaultWebIntentService(default_service); | 445 wds_->AddDefaultWebIntentService(default_service); |
446 } | 446 } |
447 | 447 |
448 void WebIntentsRegistry::UnregisterDefaultIntentService( | 448 void WebIntentsRegistry::UnregisterDefaultIntentService( |
449 const DefaultWebIntentService& default_service) { | 449 const DefaultWebIntentService& default_service) { |
450 DCHECK(wds_.get()); | 450 DCHECK(wds_.get()); |
451 wds_->RemoveDefaultWebIntentService(default_service); | 451 wds_->RemoveDefaultWebIntentService(default_service); |
452 } | 452 } |
453 | 453 |
| 454 void WebIntentsRegistry::UnregisterServiceDefaults(const GURL& service_url) { |
| 455 DCHECK(wds_.get()); |
| 456 wds_->RemoveWebIntentServiceDefaults(service_url); |
| 457 } |
| 458 |
454 void WebIntentsRegistry::GetDefaultIntentService( | 459 void WebIntentsRegistry::GetDefaultIntentService( |
455 const string16& action, | 460 const string16& action, |
456 const string16& type, | 461 const string16& type, |
457 const GURL& invoking_url, | 462 const GURL& invoking_url, |
458 const DefaultQueryCallback& callback) { | 463 const DefaultQueryCallback& callback) { |
459 DCHECK(!callback.is_null()); | 464 DCHECK(!callback.is_null()); |
460 | 465 |
461 const QueryParams params(action, type); | 466 const QueryParams params(action, type); |
462 | 467 |
463 ResultsHandler handler = base::Bind( | 468 ResultsHandler handler = base::Bind( |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 void WebIntentsRegistry::ReleaseQuery(QueryAdapter* query) { | 539 void WebIntentsRegistry::ReleaseQuery(QueryAdapter* query) { |
535 QueryVector::iterator it = std::find( | 540 QueryVector::iterator it = std::find( |
536 pending_queries_.begin(), pending_queries_.end(), query); | 541 pending_queries_.begin(), pending_queries_.end(), query); |
537 if (it != pending_queries_.end()) { | 542 if (it != pending_queries_.end()) { |
538 pending_queries_.erase(it); | 543 pending_queries_.erase(it); |
539 delete query; | 544 delete query; |
540 } else { | 545 } else { |
541 NOTREACHED(); | 546 NOTREACHED(); |
542 } | 547 } |
543 } | 548 } |
OLD | NEW |