Commit 76d91043 authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

[ios] Fix uses of ios::ChromeBrowserState in /ios/chrome/app

The ChromeBrowserState has been moved from the "ios" namespace
to the global namespace by http://crrev.com/c/2014913. Fix the
uses from ios::ChromeBrowserState to ChromeBrowserState.

Also remove includes of chrome_browser_state_forward.h and use
a simple forward declaration instead (since the old name is no
longer necessary).

This CL was uploaded by git cl split.

R=rohitrao@chromium.org

Bug: 1042208
Change-Id: Ia115175df1261886f83273d1997459ebc434a284
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2017510
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#735270}
parent 3a46d85c
...@@ -243,7 +243,7 @@ class MainControllerAuthenticationServiceDelegate ...@@ -243,7 +243,7 @@ class MainControllerAuthenticationServiceDelegate
: public AuthenticationServiceDelegate { : public AuthenticationServiceDelegate {
public: public:
MainControllerAuthenticationServiceDelegate( MainControllerAuthenticationServiceDelegate(
ios::ChromeBrowserState* browser_state, ChromeBrowserState* browser_state,
id<BrowsingDataCommands> dispatcher); id<BrowsingDataCommands> dispatcher);
~MainControllerAuthenticationServiceDelegate() override; ~MainControllerAuthenticationServiceDelegate() override;
...@@ -251,7 +251,7 @@ class MainControllerAuthenticationServiceDelegate ...@@ -251,7 +251,7 @@ class MainControllerAuthenticationServiceDelegate
void ClearBrowsingData(ProceduralBlock completion) override; void ClearBrowsingData(ProceduralBlock completion) override;
private: private:
ios::ChromeBrowserState* browser_state_ = nullptr; ChromeBrowserState* browser_state_ = nullptr;
__weak id<BrowsingDataCommands> dispatcher_ = nil; __weak id<BrowsingDataCommands> dispatcher_ = nil;
DISALLOW_COPY_AND_ASSIGN(MainControllerAuthenticationServiceDelegate); DISALLOW_COPY_AND_ASSIGN(MainControllerAuthenticationServiceDelegate);
...@@ -259,7 +259,7 @@ class MainControllerAuthenticationServiceDelegate ...@@ -259,7 +259,7 @@ class MainControllerAuthenticationServiceDelegate
MainControllerAuthenticationServiceDelegate:: MainControllerAuthenticationServiceDelegate::
MainControllerAuthenticationServiceDelegate( MainControllerAuthenticationServiceDelegate(
ios::ChromeBrowserState* browser_state, ChromeBrowserState* browser_state,
id<BrowsingDataCommands> dispatcher) id<BrowsingDataCommands> dispatcher)
: browser_state_(browser_state), dispatcher_(dispatcher) {} : browser_state_(browser_state), dispatcher_(dispatcher) {}
...@@ -339,8 +339,7 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData( ...@@ -339,8 +339,7 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
@property(nonatomic, strong) BrowserViewWrangler* browserViewWrangler; @property(nonatomic, strong) BrowserViewWrangler* browserViewWrangler;
// The ChromeBrowserState associated with the main (non-OTR) browsing mode. // The ChromeBrowserState associated with the main (non-OTR) browsing mode.
@property(nonatomic, assign) @property(nonatomic, assign) ChromeBrowserState* mainBrowserState; // Weak.
ios::ChromeBrowserState* mainBrowserState; // Weak.
// The main coordinator, lazily created the first time it is accessed. Manages // The main coordinator, lazily created the first time it is accessed. Manages
// the main view controller. This property should not be accessed before the // the main view controller. This property should not be accessed before the
...@@ -352,8 +351,8 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData( ...@@ -352,8 +351,8 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
// Switch all global states for the given mode (normal or incognito). // Switch all global states for the given mode (normal or incognito).
- (void)switchGlobalStateToMode:(ApplicationMode)mode; - (void)switchGlobalStateToMode:(ApplicationMode)mode;
// Updates the local storage, cookie store, and sets the global state. // Updates the local storage, cookie store, and sets the global state.
- (void)changeStorageFromBrowserState:(ios::ChromeBrowserState*)oldState - (void)changeStorageFromBrowserState:(ChromeBrowserState*)oldState
toBrowserState:(ios::ChromeBrowserState*)newState; toBrowserState:(ChromeBrowserState*)newState;
// Returns the set of the sessions ids of the tabs in the given |tabModel|. // Returns the set of the sessions ids of the tabs in the given |tabModel|.
- (NSMutableSet*)liveSessionsForTabModel:(TabModel*)tabModel; - (NSMutableSet*)liveSessionsForTabModel:(TabModel*)tabModel;
// Purge the unused snapshots. // Purge the unused snapshots.
...@@ -410,7 +409,7 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData( ...@@ -410,7 +409,7 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
// Handles the notification that first run modal dialog UI completed. // Handles the notification that first run modal dialog UI completed.
- (void)handleFirstRunUIDidFinish; - (void)handleFirstRunUIDidFinish;
// Performs synchronous browser state initialization steps. // Performs synchronous browser state initialization steps.
- (void)initializeBrowserState:(ios::ChromeBrowserState*)browserState; - (void)initializeBrowserState:(ChromeBrowserState*)browserState;
// Helper methods to initialize the application to a specific stage. // Helper methods to initialize the application to a specific stage.
// Setting |_browserInitializationStage| to a specific stage requires the // Setting |_browserInitializationStage| to a specific stage requires the
// corresponding function to return YES. // corresponding function to return YES.
...@@ -561,7 +560,7 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData( ...@@ -561,7 +560,7 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
_browserStateManager = _browserStateManager =
GetApplicationContext()->GetChromeBrowserStateManager(); GetApplicationContext()->GetChromeBrowserStateManager();
ios::ChromeBrowserState* chromeBrowserState = ChromeBrowserState* chromeBrowserState =
_browserStateManager->GetLastUsedBrowserState(); _browserStateManager->GetLastUsedBrowserState();
// The CrashRestoreHelper must clean up the old browser state information // The CrashRestoreHelper must clean up the old browser state information
...@@ -683,7 +682,7 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData( ...@@ -683,7 +682,7 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
tests_hook::RunTestsIfPresent(); tests_hook::RunTestsIfPresent();
} }
- (void)initializeBrowserState:(ios::ChromeBrowserState*)browserState { - (void)initializeBrowserState:(ChromeBrowserState*)browserState {
DCHECK(!browserState->IsOffTheRecord()); DCHECK(!browserState->IsOffTheRecord());
search_engines::UpdateSearchEnginesIfNeeded( search_engines::UpdateSearchEnginesIfNeeded(
browserState->GetPrefs(), browserState->GetPrefs(),
...@@ -1204,7 +1203,7 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData( ...@@ -1204,7 +1203,7 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
experimental_flags::AlwaysDisplayFirstRun()) && experimental_flags::AlwaysDisplayFirstRun()) &&
!tests_hook::DisableFirstRun(); !tests_hook::DisableFirstRun();
ios::ChromeBrowserState* browserState = ChromeBrowserState* browserState =
(launchMode == ApplicationMode::INCOGNITO) (launchMode == ApplicationMode::INCOGNITO)
? self.mainBrowserState->GetOffTheRecordChromeBrowserState() ? self.mainBrowserState->GetOffTheRecordChromeBrowserState()
: self.mainBrowserState; : self.mainBrowserState;
...@@ -1406,8 +1405,8 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData( ...@@ -1406,8 +1405,8 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
[standardDefaults synchronize]; [standardDefaults synchronize];
} }
- (void)changeStorageFromBrowserState:(ios::ChromeBrowserState*)oldState - (void)changeStorageFromBrowserState:(ChromeBrowserState*)oldState
toBrowserState:(ios::ChromeBrowserState*)newState { toBrowserState:(ChromeBrowserState*)newState {
ApplicationMode mode = newState->IsOffTheRecord() ? ApplicationMode::INCOGNITO ApplicationMode mode = newState->IsOffTheRecord() ? ApplicationMode::INCOGNITO
: ApplicationMode::NORMAL; : ApplicationMode::NORMAL;
[self switchGlobalStateToMode:mode]; [self switchGlobalStateToMode:mode];
...@@ -1421,7 +1420,7 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData( ...@@ -1421,7 +1420,7 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
return self.interfaceProvider.currentInterface.browser; return self.interfaceProvider.currentInterface.browser;
} }
- (ios::ChromeBrowserState*)currentBrowserState { - (ChromeBrowserState*)currentBrowserState {
return self.currentBVC.browserState; return self.currentBVC.browserState;
} }
...@@ -1472,7 +1471,7 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData( ...@@ -1472,7 +1471,7 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
#pragma mark - BrowsingDataCommands #pragma mark - BrowsingDataCommands
- (void)removeBrowsingDataForBrowserState:(ios::ChromeBrowserState*)browserState - (void)removeBrowsingDataForBrowserState:(ChromeBrowserState*)browserState
timePeriod:(browsing_data::TimePeriod)timePeriod timePeriod:(browsing_data::TimePeriod)timePeriod
removeMask:(BrowsingDataRemoveMask)removeMask removeMask:(BrowsingDataRemoveMask)removeMask
completionBlock:(ProceduralBlock)completionBlock { completionBlock:(ProceduralBlock)completionBlock {
......
...@@ -10,12 +10,12 @@ ...@@ -10,12 +10,12 @@
#import "base/ios/block_types.h" #import "base/ios/block_types.h"
#include "components/browsing_data/core/browsing_data_utils.h" #include "components/browsing_data/core/browsing_data_utils.h"
#include "ios/chrome/app/startup/chrome_app_startup_parameters.h" #include "ios/chrome/app/startup/chrome_app_startup_parameters.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state_forward.h"
#include "ios/chrome/browser/browsing_data/browsing_data_remove_mask.h" #include "ios/chrome/browser/browsing_data/browsing_data_remove_mask.h"
#import "ios/chrome/browser/crash_report/crash_restore_helper.h" #import "ios/chrome/browser/crash_report/crash_restore_helper.h"
@class BrowserViewController; @class BrowserViewController;
@class BrowserViewWrangler; @class BrowserViewWrangler;
class ChromeBrowserState;
@class TabGridCoordinator; @class TabGridCoordinator;
@protocol BrowserInterfaceProvider; @protocol BrowserInterfaceProvider;
@protocol TabSwitcher; @protocol TabSwitcher;
...@@ -47,15 +47,15 @@ class AppUrlLoadingService; ...@@ -47,15 +47,15 @@ class AppUrlLoadingService;
- (BrowserViewWrangler*)browserViewWrangler; - (BrowserViewWrangler*)browserViewWrangler;
- (id<TabSwitcher>)tabSwitcher; - (id<TabSwitcher>)tabSwitcher;
- (TabModel*)currentTabModel; - (TabModel*)currentTabModel;
- (ios::ChromeBrowserState*)mainBrowserState; - (ChromeBrowserState*)mainBrowserState;
- (ios::ChromeBrowserState*)currentBrowserState; - (ChromeBrowserState*)currentBrowserState;
- (BrowserViewController*)currentBVC; - (BrowserViewController*)currentBVC;
- (BrowserViewController*)mainBVC; - (BrowserViewController*)mainBVC;
- (BrowserViewController*)otrBVC; - (BrowserViewController*)otrBVC;
- (TabGridCoordinator*)mainCoordinator; - (TabGridCoordinator*)mainCoordinator;
- (id<BrowserInterfaceProvider>)interfaceProvider; - (id<BrowserInterfaceProvider>)interfaceProvider;
- (void)removeBrowsingDataForBrowserState:(ios::ChromeBrowserState*)browserState - (void)removeBrowsingDataForBrowserState:(ChromeBrowserState*)browserState
timePeriod:(browsing_data::TimePeriod)timePeriod timePeriod:(browsing_data::TimePeriod)timePeriod
removeMask:(BrowsingDataRemoveMask)removeMask removeMask:(BrowsingDataRemoveMask)removeMask
completionBlock:(ProceduralBlock)completionBlock; completionBlock:(ProceduralBlock)completionBlock;
......
...@@ -7,16 +7,16 @@ ...@@ -7,16 +7,16 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#include "ios/chrome/browser/browser_state/chrome_browser_state_forward.h" class ChromeBrowserState;
// Notify the scheduler of the Content Suggestions services of the app lifecycle // Notify the scheduler of the Content Suggestions services of the app lifecycle
// events. // events.
@interface ContentSuggestionsSchedulerNotifications : NSObject @interface ContentSuggestionsSchedulerNotifications : NSObject
// Notifies that the application is launching from cold state. // Notifies that the application is launching from cold state.
+ (void)notifyColdStart:(ios::ChromeBrowserState*)browserState; + (void)notifyColdStart:(ChromeBrowserState*)browserState;
// Notifies that the application has been foregrounded. // Notifies that the application has been foregrounded.
+ (void)notifyForeground:(ios::ChromeBrowserState*)browserState; + (void)notifyForeground:(ChromeBrowserState*)browserState;
@end @end
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
@implementation ContentSuggestionsSchedulerNotifications @implementation ContentSuggestionsSchedulerNotifications
+ (void)notifyColdStart:(ios::ChromeBrowserState*)browserState { + (void)notifyColdStart:(ChromeBrowserState*)browserState {
ntp_snippets::ContentSuggestionsService* contentSuggestionsService = ntp_snippets::ContentSuggestionsService* contentSuggestionsService =
IOSChromeContentSuggestionsServiceFactory::GetForBrowserState( IOSChromeContentSuggestionsServiceFactory::GetForBrowserState(
browserState); browserState);
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
->OnBrowserColdStart(); ->OnBrowserColdStart();
} }
+ (void)notifyForeground:(ios::ChromeBrowserState*)browserState { + (void)notifyForeground:(ChromeBrowserState*)browserState {
ntp_snippets::ContentSuggestionsService* contentSuggestionsService = ntp_snippets::ContentSuggestionsService* contentSuggestionsService =
IOSChromeContentSuggestionsServiceFactory::GetForBrowserState( IOSChromeContentSuggestionsServiceFactory::GetForBrowserState(
browserState); browserState);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#include "ios/chrome/browser/browser_state/chrome_browser_state_forward.h" class ChromeBrowserState;
// Class handling all startup tasks. // Class handling all startup tasks.
@interface StartupTasks : NSObject @interface StartupTasks : NSObject
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
// Asynchronously finishes the browser state initialization by starting the // Asynchronously finishes the browser state initialization by starting the
// deferred task runners. // deferred task runners.
+ (void)scheduleDeferredBrowserStateInitialization: + (void)scheduleDeferredBrowserStateInitialization:
(ios::ChromeBrowserState*)browserState; (ChromeBrowserState*)browserState;
// Starts Omaha and, if first run, sets install time. For official builds only. // Starts Omaha and, if first run, sets install time. For official builds only.
- (void)initializeOmaha; - (void)initializeOmaha;
// Donate initial Intents. // Donate initial Intents.
......
...@@ -40,7 +40,7 @@ NSString* const kStartProfileStartupTaskRunners = ...@@ -40,7 +40,7 @@ NSString* const kStartProfileStartupTaskRunners =
// Performs browser state initialization tasks that don't need to happen // Performs browser state initialization tasks that don't need to happen
// synchronously at startup. // synchronously at startup.
+ (void)performDeferredInitializationForBrowserState: + (void)performDeferredInitializationForBrowserState:
(ios::ChromeBrowserState*)browserState; (ChromeBrowserState*)browserState;
// Called when UIApplicationWillResignActiveNotification is received. // Called when UIApplicationWillResignActiveNotification is received.
- (void)applicationWillResignActiveNotification:(NSNotification*)notification; - (void)applicationWillResignActiveNotification:(NSNotification*)notification;
...@@ -51,7 +51,7 @@ NSString* const kStartProfileStartupTaskRunners = ...@@ -51,7 +51,7 @@ NSString* const kStartProfileStartupTaskRunners =
#pragma mark - Public methods. #pragma mark - Public methods.
+ (void)scheduleDeferredBrowserStateInitialization: + (void)scheduleDeferredBrowserStateInitialization:
(ios::ChromeBrowserState*)browserState { (ChromeBrowserState*)browserState {
DCHECK(browserState); DCHECK(browserState);
// Schedule the start of the profile deferred task runners. // Schedule the start of the profile deferred task runners.
[[DeferredInitializationRunner sharedInstance] [[DeferredInitializationRunner sharedInstance]
...@@ -100,7 +100,7 @@ NSString* const kStartProfileStartupTaskRunners = ...@@ -100,7 +100,7 @@ NSString* const kStartProfileStartupTaskRunners =
#pragma mark - Private methods. #pragma mark - Private methods.
+ (void)performDeferredInitializationForBrowserState: + (void)performDeferredInitializationForBrowserState:
(ios::ChromeBrowserState*)browserState { (ChromeBrowserState*)browserState {
ios::StartupTaskRunnerServiceFactory::GetForBrowserState(browserState) ios::StartupTaskRunnerServiceFactory::GetForBrowserState(browserState)
->StartDeferredTaskRunners(); ->StartDeferredTaskRunners();
ReadingListDownloadServiceFactory::GetForBrowserState(browserState) ReadingListDownloadServiceFactory::GetForBrowserState(browserState)
......
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