Chromium Code Reviews| Index: chrome/browser/intents/register_intent_handler_infobar_delegate.cc |
| diff --git a/chrome/browser/intents/register_intent_handler_infobar_delegate.cc b/chrome/browser/intents/register_intent_handler_infobar_delegate.cc |
| index 4c711e4c95e4a25b67708cf772a0bb007062dca7..7c227ba158d59b45cc9c4ae4cc7f484a83ad6ad1 100644 |
| --- a/chrome/browser/intents/register_intent_handler_infobar_delegate.cc |
| +++ b/chrome/browser/intents/register_intent_handler_infobar_delegate.cc |
| @@ -4,8 +4,11 @@ |
| #include "chrome/browser/intents/register_intent_handler_infobar_delegate.h" |
| +#include "base/bind.h" |
| +#include "base/bind_helpers.h" |
| #include "base/logging.h" |
| #include "base/utf_string_conversions.h" |
| +#include "chrome/browser/infobars/infobar_tab_helper.h" |
| #include "chrome/browser/intents/web_intents_registry.h" |
| #include "chrome/browser/intents/web_intents_registry_factory.h" |
| #include "chrome/browser/profiles/profile.h" |
| @@ -60,3 +63,29 @@ bool RegisterIntentHandlerInfoBarDelegate::LinkClicked( |
| // TODO(jhawkins): Add associated bug for the article here. |
| return false; |
| } |
| + |
| +// Helper continuation for MaybeShowIntentInfoBar. |
| +void CheckProvider( |
|
James Hawkins
2011/10/26 23:50:06
Move to an unnamed namespace.
Greg Billock
2011/10/29 00:03:19
Done.
|
| + InfoBarTabHelper* infobar_helper, |
| + WebIntentsRegistry* registry, |
|
James Hawkins
2011/10/26 23:50:06
Just an FYI: for implementation, parameters may be
Greg Billock
2011/10/29 00:03:19
Moved these up and indented.
On 2011/10/26 23:50:
|
| + const WebIntentServiceData& service, |
| + bool provider_exists) { |
| + if (!provider_exists) { |
|
James Hawkins
2011/10/26 23:50:06
Perhaps this parameter could be removed and the co
Greg Billock
2011/10/29 00:03:19
Hmmm. So the signature is something like NotifyIfI
|
| + infobar_helper->AddInfoBar(new RegisterIntentHandlerInfoBarDelegate( |
| + infobar_helper, registry, service)); |
| + } |
| +} |
| + |
| +// static |
| +void RegisterIntentHandlerInfoBarDelegate::MaybeShowIntentInfoBar( |
| + InfoBarTabHelper* infobar_helper, |
| + WebIntentsRegistry* registry, |
| + const WebIntentServiceData& service) { |
| + DCHECK(infobar_helper); |
| + DCHECK(registry); |
| + registry->IntentProviderExists(service, |
| + base::Bind(&CheckProvider, |
| + base::Unretained(infobar_helper), |
| + base::Unretained(registry), |
| + service)); |
| +} |