| Index: chrome/browser/ui/intents/web_intent_picker_controller.cc
|
| diff --git a/chrome/browser/ui/intents/web_intent_picker_controller.cc b/chrome/browser/ui/intents/web_intent_picker_controller.cc
|
| index d348e4750e11753a248910e9c3bc1d41572a7532..d955b65220d0172f59282c053cbd78e04d5f23ca 100644
|
| --- a/chrome/browser/ui/intents/web_intent_picker_controller.cc
|
| +++ b/chrome/browser/ui/intents/web_intent_picker_controller.cc
|
| @@ -13,6 +13,7 @@
|
| #include "chrome/browser/profiles/profile.h"
|
| #include "chrome/browser/ui/intents/web_intent_picker.h"
|
| #include "chrome/browser/ui/intents/web_intent_picker_factory.h"
|
| +#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
|
| #include "chrome/browser/webdata/web_data_service.h"
|
| #include "content/browser/tab_contents/tab_contents.h"
|
| #include "content/common/notification_source.h"
|
| @@ -21,17 +22,13 @@
|
| namespace {
|
|
|
| // Gets the favicon service for the profile in |tab_contents|.
|
| -FaviconService* GetFaviconService(TabContents* tab_contents) {
|
| - Profile* profile = Profile::FromBrowserContext(
|
| - tab_contents->browser_context());
|
| - return profile->GetFaviconService(Profile::EXPLICIT_ACCESS);
|
| +FaviconService* GetFaviconService(TabContentsWrapper* wrapper) {
|
| + return wrapper->profile()->GetFaviconService(Profile::EXPLICIT_ACCESS);
|
| }
|
|
|
| // Gets the web intents registry for the profile in |tab_contents|.
|
| -WebIntentsRegistry* GetWebIntentsRegistry(TabContents* tab_contents) {
|
| - Profile* profile = Profile::FromBrowserContext(
|
| - tab_contents->browser_context());
|
| - return WebIntentsRegistryFactory::GetForProfile(profile);
|
| +WebIntentsRegistry* GetWebIntentsRegistry(TabContentsWrapper* wrapper) {
|
| + return WebIntentsRegistryFactory::GetForProfile(wrapper->profile());
|
| }
|
|
|
| } // namespace
|
| @@ -99,18 +96,18 @@ class WebIntentPickerController::FaviconFetcher {
|
| };
|
|
|
| WebIntentPickerController::WebIntentPickerController(
|
| - TabContents* tab_contents,
|
| + TabContentsWrapper* wrapper,
|
| WebIntentPickerFactory* factory)
|
| - : tab_contents_(tab_contents),
|
| + : wrapper_(wrapper),
|
| picker_factory_(factory),
|
| web_intent_data_fetcher_(
|
| new WebIntentDataFetcher(this,
|
| - GetWebIntentsRegistry(tab_contents))),
|
| + GetWebIntentsRegistry(wrapper))),
|
| favicon_fetcher_(
|
| - new FaviconFetcher(this, GetFaviconService(tab_contents))),
|
| + new FaviconFetcher(this, GetFaviconService(wrapper))),
|
| picker_(NULL),
|
| pending_async_count_(0) {
|
| - NavigationController* controller = &tab_contents->controller();
|
| + NavigationController* controller = &wrapper->controller();
|
| registrar_.Add(this, content::NOTIFICATION_LOAD_START,
|
| Source<NavigationController>(controller));
|
| registrar_.Add(this, content::NOTIFICATION_TAB_CLOSING,
|
| @@ -125,7 +122,7 @@ void WebIntentPickerController::ShowDialog(const string16& action,
|
| if (picker_ != NULL)
|
| return;
|
|
|
| - picker_ = picker_factory_->Create(tab_contents_, this);
|
| + picker_ = picker_factory_->Create(wrapper_, this);
|
|
|
| // TODO(binji) Remove this check when there are implementations of the picker
|
| // for windows and mac.
|
|
|