Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(534)

Unified Diff: chrome/browser/ui/webui/history_ui.cc

Issue 7554008: Removal of Profile from content part 6. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Profile helper function, rebase Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/history2_ui.cc ('k') | chrome/browser/ui/webui/media/media_internals_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..1508b4bd09e03a8c358f0ed21824d299cfadc489 100644
--- a/chrome/browser/ui/webui/history_ui.cc
+++ b/chrome/browser/ui/webui/history_ui.cc
@@ -133,7 +133,7 @@ BrowsingHistoryHandler::~BrowsingHistoryHandler() {
WebUIMessageHandler* BrowsingHistoryHandler::Attach(WebUI* web_ui) {
// Create our favicon data source.
- Profile* profile = web_ui->GetProfile();
+ Profile* profile = Profile::FromWebUI(web_ui);
profile->GetChromeURLDataManager()->AddDataSource(
new FaviconSource(profile, FaviconSource::FAVICON));
@@ -173,7 +173,7 @@ void BrowsingHistoryHandler::HandleGetHistory(const ListValue* args) {
search_text_ = string16();
HistoryService* hs =
- web_ui_->GetProfile()->GetHistoryService(Profile::EXPLICIT_ACCESS);
+ Profile::FromWebUI(web_ui_)->GetHistoryService(Profile::EXPLICIT_ACCESS);
hs->QueryHistory(search_text_,
options,
&cancelable_search_consumer_,
@@ -198,7 +198,7 @@ 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::FromWebUI(web_ui_)->GetHistoryService(Profile::EXPLICIT_ACCESS);
hs->QueryHistory(search_text_,
options,
&cancelable_search_consumer_,
@@ -235,7 +235,7 @@ void BrowsingHistoryHandler::HandleRemoveURLsOnOneDay(const ListValue* args) {
}
HistoryService* hs =
- web_ui_->GetProfile()->GetHistoryService(Profile::EXPLICIT_ACCESS);
+ Profile::FromWebUI(web_ui_)->GetHistoryService(Profile::EXPLICIT_ACCESS);
hs->ExpireHistoryBetween(
urls, begin_time, end_time, &cancelable_delete_consumer_,
NewCallback(this, &BrowsingHistoryHandler::RemoveComplete));
@@ -244,7 +244,8 @@ 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::FromWebUI(web_ui_);
+ Browser* browser = BrowserList::FindBrowserWithProfile(profile);
if (browser)
browser->OpenClearBrowsingDataDialog();
}
@@ -291,8 +292,9 @@ void BrowsingHistoryHandler::QueryComplete(
base::TimeFormatShortDate(page.visit_time()));
page_value->SetString("snippet", page.snippet().text());
}
+ Profile* profile = Profile::FromWebUI(web_ui_);
page_value->SetBoolean("starred",
- web_ui_->GetProfile()->GetBookmarkModel()->IsBookmarked(page.url()));
+ profile->GetBookmarkModel()->IsBookmarked(page.url()));
results_value.Append(page_value);
}
« no previous file with comments | « chrome/browser/ui/webui/history2_ui.cc ('k') | chrome/browser/ui/webui/media/media_internals_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698