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

Unified Diff: ios/chrome/browser/ui/webui/history/browsing_history_handler.cc

Issue 1841653003: Drop |languages| from {Format,Elide}Url* and IDNToUnicode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typo in elide_url.cc Created 4 years, 8 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
Index: ios/chrome/browser/ui/webui/history/browsing_history_handler.cc
diff --git a/ios/chrome/browser/ui/webui/history/browsing_history_handler.cc b/ios/chrome/browser/ui/webui/history/browsing_history_handler.cc
index 37c52034e2eb02ad8dc39377df9d9c196834bbfd..da8d6d2823c2121d4651f9a393542c9215a88939 100644
--- a/ios/chrome/browser/ui/webui/history/browsing_history_handler.cc
+++ b/ios/chrome/browser/ui/webui/history/browsing_history_handler.cc
@@ -26,7 +26,6 @@
#include "components/history/core/browser/top_sites.h"
#include "components/history/core/browser/web_history_service.h"
#include "components/keyed_service/core/service_access_type.h"
-#include "components/prefs/pref_service.h"
#include "components/strings/grit/components_strings.h"
#include "components/sync_driver/device_info.h"
#include "components/sync_driver/device_info_tracker.h"
@@ -39,7 +38,6 @@
#include "ios/chrome/browser/history/history_utils.h"
#include "ios/chrome/browser/history/top_sites_factory.h"
#include "ios/chrome/browser/history/web_history_service_factory.h"
-#include "ios/chrome/browser/pref_names.h"
#include "ios/chrome/browser/sync/ios_chrome_profile_sync_service_factory.h"
#include "ios/chrome/browser/ui/show_privacy_settings_util.h"
#include "ios/chrome/browser/ui/webui/history/favicon_source.h"
@@ -143,8 +141,7 @@ BrowsingHistoryHandler::HistoryEntry::HistoryEntry(
const std::string& client_id,
bool is_search_result,
const base::string16& snippet,
- bool blocked_visit,
- const std::string& accept_languages) {
+ bool blocked_visit) {
this->entry_type = entry_type;
this->url = url;
this->title = title;
@@ -154,7 +151,6 @@ BrowsingHistoryHandler::HistoryEntry::HistoryEntry(
this->is_search_result = is_search_result;
this->snippet = snippet;
this->blocked_visit = blocked_visit;
- this->accept_languages = accept_languages;
}
BrowsingHistoryHandler::HistoryEntry::HistoryEntry()
@@ -193,8 +189,7 @@ scoped_ptr<base::DictionaryValue> BrowsingHistoryHandler::HistoryEntry::ToValue(
scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue());
SetUrlAndTitle(result.get());
- base::string16 domain =
- url_formatter::IDNToUnicode(url.host(), accept_languages);
+ base::string16 domain = url_formatter::IDNToUnicode(url.host());
// When the domain is empty, use the scheme instead. This allows for a
// sensible treatment of e.g. file: URLs when group by domain is on.
if (domain.empty())
@@ -611,15 +606,14 @@ void BrowsingHistoryHandler::QueryComplete(const base::string16& search_text,
history::QueryResults* results) {
DCHECK_EQ(0U, query_results_.size());
query_results_.reserve(results->size());
- const std::string accept_languages = GetAcceptLanguages();
for (size_t i = 0; i < results->size(); ++i) {
history::URLResult const& page = (*results)[i];
// TODO(dubroy): Use sane time (crbug.com/146090) here when it's ready.
- query_results_.push_back(HistoryEntry(
- HistoryEntry::LOCAL_ENTRY, page.url(), page.title(), page.visit_time(),
- std::string(), !search_text.empty(), page.snippet().text(),
- page.blocked_visit(), accept_languages));
+ query_results_.push_back(
+ HistoryEntry(HistoryEntry::LOCAL_ENTRY, page.url(), page.title(),
+ page.visit_time(), std::string(), !search_text.empty(),
+ page.snippet().text(), page.blocked_visit()));
}
// The items which are to be written into results_info_value_ are also
@@ -653,7 +647,6 @@ void BrowsingHistoryHandler::WebHistoryQueryComplete(
const base::DictionaryValue* results_value) {
base::TimeDelta delta = base::TimeTicks::Now() - start_time;
UMA_HISTOGRAM_TIMES("WebHistory.ResponseTime", delta);
- const std::string accept_languages = GetAcceptLanguages();
// If the response came in too late, do nothing.
// TODO(dubroy): Maybe show a banner, and prompt the user to reload?
@@ -720,7 +713,7 @@ void BrowsingHistoryHandler::WebHistoryQueryComplete(
web_history_query_results_.push_back(
HistoryEntry(HistoryEntry::REMOTE_ENTRY, gurl, title, time,
client_id, !search_text.empty(), base::string16(),
- /* blocked_visit */ false, accept_languages));
+ /* blocked_visit */ false));
}
}
}
@@ -803,12 +796,6 @@ static bool DeletionsDiffer(const history::URLRows& deleted_rows,
return false;
}
-std::string BrowsingHistoryHandler::GetAcceptLanguages() const {
- ios::ChromeBrowserState* browser_state =
- ios::ChromeBrowserState::FromWebUIIOS(web_ui());
- return browser_state->GetPrefs()->GetString(prefs::kAcceptLanguages);
-}
-
void BrowsingHistoryHandler::OnURLsDeleted(
history::HistoryService* history_service,
bool all_history,
« no previous file with comments | « ios/chrome/browser/ui/webui/history/browsing_history_handler.h ('k') | ios/web/navigation/navigation_item_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698