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::UnregisterDefaultIntentServicesForServiceURL( |
| 455 const GURL& service_url) { |
| 456 DCHECK(wds_.get()); |
| 457 wds_->RemoveDefaultWebIntentServiceForServiceURL(service_url); |
| 458 } |
| 459 |
454 void WebIntentsRegistry::GetDefaultIntentService( | 460 void WebIntentsRegistry::GetDefaultIntentService( |
455 const string16& action, | 461 const string16& action, |
456 const string16& type, | 462 const string16& type, |
457 const GURL& invoking_url, | 463 const GURL& invoking_url, |
458 const DefaultQueryCallback& callback) { | 464 const DefaultQueryCallback& callback) { |
459 DCHECK(!callback.is_null()); | 465 DCHECK(!callback.is_null()); |
460 | 466 |
461 const QueryParams params(action, type); | 467 const QueryParams params(action, type); |
462 | 468 |
463 ResultsHandler handler = base::Bind( | 469 ResultsHandler handler = base::Bind( |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 void WebIntentsRegistry::ReleaseQuery(QueryAdapter* query) { | 540 void WebIntentsRegistry::ReleaseQuery(QueryAdapter* query) { |
535 QueryVector::iterator it = std::find( | 541 QueryVector::iterator it = std::find( |
536 pending_queries_.begin(), pending_queries_.end(), query); | 542 pending_queries_.begin(), pending_queries_.end(), query); |
537 if (it != pending_queries_.end()) { | 543 if (it != pending_queries_.end()) { |
538 pending_queries_.erase(it); | 544 pending_queries_.erase(it); |
539 delete query; | 545 delete query; |
540 } else { | 546 } else { |
541 NOTREACHED(); | 547 NOTREACHED(); |
542 } | 548 } |
543 } | 549 } |
OLD | NEW |