Index: chrome/browser/ui/webui/history_ui.cc |
diff --git a/chrome/browser/ui/webui/history_ui.cc b/chrome/browser/ui/webui/history_ui.cc |
index 4019b184c9357e3e973a449e844591b60b38d00b..0010516ccffd9842262f018a95e53e686fd7784b 100644 |
--- a/chrome/browser/ui/webui/history_ui.cc |
+++ b/chrome/browser/ui/webui/history_ui.cc |
@@ -133,7 +133,8 @@ BrowsingHistoryHandler::~BrowsingHistoryHandler() { |
WebUIMessageHandler* BrowsingHistoryHandler::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)); |
@@ -172,8 +173,9 @@ void BrowsingHistoryHandler::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()); |
jam
2011/08/09 16:11:19
nit: given how many times I see this line so far,
|
+ HistoryService* hs = profile->GetHistoryService(Profile::EXPLICIT_ACCESS); |
hs->QueryHistory(search_text_, |
options, |
&cancelable_search_consumer_, |
@@ -197,8 +199,9 @@ void BrowsingHistoryHandler::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_, |
@@ -234,8 +237,9 @@ void BrowsingHistoryHandler::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, &BrowsingHistoryHandler::RemoveComplete)); |
@@ -244,7 +248,9 @@ void BrowsingHistoryHandler::HandleRemoveURLsOnOneDay(const ListValue* args) { |
void BrowsingHistoryHandler::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(); |
} |
@@ -291,8 +297,10 @@ void BrowsingHistoryHandler::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); |
} |