| Index: chrome/browser/ui/webui/history2_ui.cc
|
| diff --git a/chrome/browser/ui/webui/history2_ui.cc b/chrome/browser/ui/webui/history2_ui.cc
|
| index b343c3836b8ccd7e10467bf0a141f09a9f366bba..bffb3541162c10253fe49e9a52b6f9f757161c3c 100644
|
| --- a/chrome/browser/ui/webui/history2_ui.cc
|
| +++ b/chrome/browser/ui/webui/history2_ui.cc
|
| @@ -96,13 +96,14 @@ BrowsingHistoryHandler2::~BrowsingHistoryHandler2() {
|
|
|
| WebUIMessageHandler* BrowsingHistoryHandler2::Attach(WebUI* web_ui) {
|
| // Create our favicon data source.
|
| - Profile* profile = web_ui->GetProfile();
|
| + Profile* profile =
|
| + Profile::FromBrowserContext(web_ui->tab_contents()->browser_context());
|
| profile->GetChromeURLDataManager()->AddDataSource(
|
| new FaviconSource(profile, FaviconSource::FAVICON));
|
|
|
| // Get notifications when history is cleared.
|
| registrar_.Add(this, chrome::NOTIFICATION_HISTORY_URLS_DELETED,
|
| - Source<Profile>(web_ui->GetProfile()->GetOriginalProfile()));
|
| + Source<Profile>(profile->GetOriginalProfile()));
|
| return WebUIMessageHandler::Attach(web_ui);
|
| }
|
|
|
| @@ -135,8 +136,9 @@ void BrowsingHistoryHandler2::HandleGetHistory(const ListValue* args) {
|
| // Need to remember the query string for our results.
|
| search_text_ = string16();
|
|
|
| - HistoryService* hs =
|
| - web_ui_->GetProfile()->GetHistoryService(Profile::EXPLICIT_ACCESS);
|
| + Profile* profile =
|
| + Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context());
|
| + HistoryService* hs = profile->GetHistoryService(Profile::EXPLICIT_ACCESS);
|
| hs->QueryHistory(search_text_,
|
| options,
|
| &cancelable_search_consumer_,
|
| @@ -160,8 +162,9 @@ void BrowsingHistoryHandler2::HandleSearchHistory(const ListValue* args) {
|
|
|
| // Need to remember the query string for our results.
|
| search_text_ = query;
|
| - HistoryService* hs =
|
| - web_ui_->GetProfile()->GetHistoryService(Profile::EXPLICIT_ACCESS);
|
| + Profile* profile =
|
| + Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context());
|
| + HistoryService* hs = profile->GetHistoryService(Profile::EXPLICIT_ACCESS);
|
| hs->QueryHistory(search_text_,
|
| options,
|
| &cancelable_search_consumer_,
|
| @@ -197,8 +200,9 @@ void BrowsingHistoryHandler2::HandleRemoveURLsOnOneDay(const ListValue* args) {
|
| urls.insert(GURL(string16_value));
|
| }
|
|
|
| - HistoryService* hs =
|
| - web_ui_->GetProfile()->GetHistoryService(Profile::EXPLICIT_ACCESS);
|
| + Profile* profile =
|
| + Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context());
|
| + HistoryService* hs = profile->GetHistoryService(Profile::EXPLICIT_ACCESS);
|
| hs->ExpireHistoryBetween(
|
| urls, begin_time, end_time, &cancelable_delete_consumer_,
|
| NewCallback(this, &BrowsingHistoryHandler2::RemoveComplete));
|
| @@ -207,7 +211,9 @@ void BrowsingHistoryHandler2::HandleRemoveURLsOnOneDay(const ListValue* args) {
|
| void BrowsingHistoryHandler2::HandleClearBrowsingData(const ListValue* args) {
|
| // TODO(beng): This is an improper direct dependency on Browser. Route this
|
| // through some sort of delegate.
|
| - Browser* browser = BrowserList::FindBrowserWithProfile(web_ui_->GetProfile());
|
| + Profile* profile =
|
| + Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context());
|
| + Browser* browser = BrowserList::FindBrowserWithProfile(profile);
|
| if (browser)
|
| browser->OpenClearBrowsingDataDialog();
|
| }
|
| @@ -254,8 +260,10 @@ void BrowsingHistoryHandler2::QueryComplete(
|
| base::TimeFormatShortDate(page.visit_time()));
|
| page_value->SetString("snippet", page.snippet().text());
|
| }
|
| + Profile* profile =
|
| + Profile::FromBrowserContext(web_ui_->tab_contents()->browser_context());
|
| page_value->SetBoolean("starred",
|
| - web_ui_->GetProfile()->GetBookmarkModel()->IsBookmarked(page.url()));
|
| + profile->GetBookmarkModel()->IsBookmarked(page.url()));
|
| results_value.Append(page_value);
|
| }
|
|
|
|
|