Add ApplicationLocaleStorage in //components
Currently, application locale string is managed in BrowserProcessImpl,
and there are many CrOS specific components that depend on the locale
string. Due to the dependency, those components need to depend on
browser_process even if they only require locale.
This CL moves the application locale string to a dedicated class, and
let GlobalFeatures own the instance. After this change, we can pass the
reference to classes that require locale.
Bug: 403155091
Change-Id: I24fc2247135726e45b97cb0e68d25c3a1fc4ecb1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6306749
Reviewed-by: Erik Chen <[email protected]>
Reviewed-by: Ted Choc <[email protected]>
Commit-Queue: Jun Ishiguro <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1441953}
diff --git a/chrome/browser/global_features.h b/chrome/browser/global_features.h
index b9b5a4de..098e749 100644
--- a/chrome/browser/global_features.h
+++ b/chrome/browser/global_features.h
@@ -27,6 +27,8 @@
} // namespace glic
#endif
+class ApplicationLocaleStorage;
+
// This class owns the core controllers for features that are globally
// scoped on desktop. It can be subclassed by tests to perform
// dependency injection.
@@ -76,6 +78,10 @@
}
#endif
+ ApplicationLocaleStorage* application_locale_storage() {
+ return application_locale_storage_.get();
+ }
+
protected:
GlobalFeatures();
@@ -105,6 +111,8 @@
glic_background_mode_manager_;
std::unique_ptr<glic::GlicSyntheticTrialManager> synthetic_trial_manager_;
#endif
+
+ std::unique_ptr<ApplicationLocaleStorage> application_locale_storage_;
};
#endif // CHROME_BROWSER_GLOBAL_FEATURES_H_