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