summaryrefslogtreecommitdiffstats
path: root/ios
diff options
context:
space:
mode:
authorsdefresne <sdefresne@chromium.org>2015-11-25 07:16:40 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-25 15:17:35 +0000
commiteeff6f5697ea6cb528d0eb108062ea894a38812d (patch)
tree313791132009974935455eb6606f99be1f96e04c /ios
parent805432bfefef5a9e23c87838e500b44b8ad666f8 (diff)
downloadchromium_src-eeff6f5697ea6cb528d0eb108062ea894a38812d.zip
chromium_src-eeff6f5697ea6cb528d0eb108062ea894a38812d.tar.gz
chromium_src-eeff6f5697ea6cb528d0eb108062ea894a38812d.tar.bz2
Simplify IOSChromeMainParts implementation.
Avoid unnecessary cast from ApplicationContextImpl to its base class by using the same visibility for inherited methods. Change SetApplicationLocale visibility as it is never called outside of the constructor and pass the application locale to constructor. BUG=None Review URL: https://codereview.chromium.org/1475643007 Cr-Commit-Position: refs/heads/master@{#361658}
Diffstat (limited to 'ios')
-rw-r--r--ios/chrome/browser/application_context_impl.cc14
-rw-r--r--ios/chrome/browser/application_context_impl.h8
2 files changed, 12 insertions, 10 deletions
diff --git a/ios/chrome/browser/application_context_impl.cc b/ios/chrome/browser/application_context_impl.cc
index 63f26b2..a70f8a9 100644
--- a/ios/chrome/browser/application_context_impl.cc
+++ b/ios/chrome/browser/application_context_impl.cc
@@ -68,13 +68,6 @@ void ApplicationContextImpl::RegisterPrefs(PrefRegistrySimple* registry) {
registry->RegisterBooleanPref(prefs::kMetricsReportingWifiOnly, true);
}
-void ApplicationContextImpl::SetApplicationLocale(const std::string& locale) {
- DCHECK(thread_checker_.CalledOnValidThread());
- application_locale_ = locale;
- translate::TranslateDownloadManager::GetInstance()->set_application_locale(
- application_locale_);
-}
-
void ApplicationContextImpl::OnAppEnterForeground() {
DCHECK(thread_checker_.CalledOnValidThread());
@@ -184,6 +177,13 @@ ApplicationContextImpl::GetNetworkTimeTracker() {
return network_time_tracker_.get();
}
+void ApplicationContextImpl::SetApplicationLocale(const std::string& locale) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ application_locale_ = locale;
+ translate::TranslateDownloadManager::GetInstance()->set_application_locale(
+ application_locale_);
+}
+
void ApplicationContextImpl::CreateLocalState() {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(!created_local_state_ && !local_state_);
diff --git a/ios/chrome/browser/application_context_impl.h b/ios/chrome/browser/application_context_impl.h
index 3f674ea..eec6483 100644
--- a/ios/chrome/browser/application_context_impl.h
+++ b/ios/chrome/browser/application_context_impl.h
@@ -30,9 +30,6 @@ class ApplicationContextImpl : public ApplicationContext {
// Registers local state prefs.
static void RegisterPrefs(PrefRegistrySimple* registry);
- private:
- // Sets the locale used by the application.
- void SetApplicationLocale(const std::string& locale);
// ApplicationContext implementation.
void OnAppEnterForeground() override;
@@ -48,6 +45,11 @@ class ApplicationContextImpl : public ApplicationContext {
net_log::ChromeNetLog* GetNetLog() override;
network_time::NetworkTimeTracker* GetNetworkTimeTracker() override;
+ private:
+ // Sets the locale used by the application.
+ void SetApplicationLocale(const std::string& locale);
+
+ // Create the local state.
void CreateLocalState();
base::ThreadChecker thread_checker_;