Commit f00421f4 authored by droger's avatar droger Committed by Commit bot

[iOS] Unfork ChromeBrowserStateManager

This CL renames the methods so that they are consistently using
"BrowserState" instead of a mix of "BrowserState" and
"ChromeBrowserState".

Review URL: https://codereview.chromium.org/1463833002

Cr-Commit-Position: refs/heads/master@{#361080}
parent 882f4f9f
...@@ -87,7 +87,7 @@ void ApplicationContextImpl::OnAppEnterForeground() { ...@@ -87,7 +87,7 @@ void ApplicationContextImpl::OnAppEnterForeground() {
variations_service->OnAppEnterForeground(); variations_service->OnAppEnterForeground();
std::vector<ios::ChromeBrowserState*> loaded_browser_state = std::vector<ios::ChromeBrowserState*> loaded_browser_state =
GetChromeBrowserStateManager()->GetLoadedChromeBrowserStates(); GetChromeBrowserStateManager()->GetLoadedBrowserStates();
for (ios::ChromeBrowserState* browser_state : loaded_browser_state) { for (ios::ChromeBrowserState* browser_state : loaded_browser_state) {
browser_state->SetExitType(ios::ChromeBrowserState::EXIT_CRASHED); browser_state->SetExitType(ios::ChromeBrowserState::EXIT_CRASHED);
} }
...@@ -97,7 +97,7 @@ void ApplicationContextImpl::OnAppEnterBackground() { ...@@ -97,7 +97,7 @@ void ApplicationContextImpl::OnAppEnterBackground() {
DCHECK(thread_checker_.CalledOnValidThread()); DCHECK(thread_checker_.CalledOnValidThread());
// Mark all the ChromeBrowserStates as clean and persist history. // Mark all the ChromeBrowserStates as clean and persist history.
std::vector<ios::ChromeBrowserState*> loaded_browser_state = std::vector<ios::ChromeBrowserState*> loaded_browser_state =
GetChromeBrowserStateManager()->GetLoadedChromeBrowserStates(); GetChromeBrowserStateManager()->GetLoadedBrowserStates();
for (ios::ChromeBrowserState* browser_state : loaded_browser_state) { for (ios::ChromeBrowserState* browser_state : loaded_browser_state) {
if (history::HistoryService* history_service = if (history::HistoryService* history_service =
ios::HistoryServiceFactory::GetForBrowserStateIfExists( ios::HistoryServiceFactory::GetForBrowserStateIfExists(
......
...@@ -74,5 +74,5 @@ std::vector<ios::ChromeBrowserState*> ...@@ -74,5 +74,5 @@ std::vector<ios::ChromeBrowserState*>
IOSChromeSigninStatusMetricsProviderDelegate::GetLoadedChromeBrowserStates() { IOSChromeSigninStatusMetricsProviderDelegate::GetLoadedChromeBrowserStates() {
return GetApplicationContext() return GetApplicationContext()
->GetChromeBrowserStateManager() ->GetChromeBrowserStateManager()
->GetLoadedChromeBrowserStates(); ->GetLoadedBrowserStates();
} }
...@@ -28,7 +28,7 @@ void StartSyncOnUIThread(const base::FilePath& browser_state_path, ...@@ -28,7 +28,7 @@ void StartSyncOnUIThread(const base::FilePath& browser_state_path,
} }
ios::ChromeBrowserState* browser_state = ios::ChromeBrowserState* browser_state =
browser_state_manager->GetChromeBrowserState(browser_state_path); browser_state_manager->GetBrowserState(browser_state_path);
if (!browser_state) { if (!browser_state) {
DVLOG(2) << "ChromeBrowserState not found, can't start sync."; DVLOG(2) << "ChromeBrowserState not found, can't start sync.";
return; return;
......
...@@ -32,14 +32,13 @@ class ChromeBrowserStateManager { ...@@ -32,14 +32,13 @@ class ChromeBrowserStateManager {
// Returns the ChromeBrowserState associated with |path|, creating one if // Returns the ChromeBrowserState associated with |path|, creating one if
// necessary. // necessary.
virtual ChromeBrowserState* GetChromeBrowserState( virtual ChromeBrowserState* GetBrowserState(const base::FilePath& path) = 0;
const base::FilePath& path) = 0;
// Returns the BrowserStateInfoCache associated with this manager. // Returns the BrowserStateInfoCache associated with this manager.
virtual BrowserStateInfoCache* GetBrowserStateInfoCache() = 0; virtual BrowserStateInfoCache* GetBrowserStateInfoCache() = 0;
// Returns the list of loaded ChromeBrowserStates. // Returns the list of loaded ChromeBrowserStates.
virtual std::vector<ChromeBrowserState*> GetLoadedChromeBrowserStates() = 0; virtual std::vector<ChromeBrowserState*> GetLoadedBrowserStates() = 0;
protected: protected:
ChromeBrowserStateManager() {} ChromeBrowserStateManager() {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment