Commit f4212466 authored by Sylvain Defresne's avatar Sylvain Defresne Committed by Commit Bot

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

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=olivierrobin@chromium.org

Bug: 1042208
Change-Id: Ib956dacb9e2c63120faec9de2b485130903c87bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2017522Reviewed-by: default avatarOlivier Robin <olivierrobin@chromium.org>
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#735363}
parent c3acc5c5
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
#define IOS_CHROME_APP_SPOTLIGHT_BOOKMARKS_SPOTLIGHT_MANAGER_H_ #define IOS_CHROME_APP_SPOTLIGHT_BOOKMARKS_SPOTLIGHT_MANAGER_H_
#import "ios/chrome/app/spotlight/base_spotlight_manager.h" #import "ios/chrome/app/spotlight/base_spotlight_manager.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state_forward.h"
class ChromeBrowserState;
namespace bookmarks { namespace bookmarks {
class BookmarkNode; class BookmarkNode;
...@@ -29,7 +30,7 @@ class BookmarkModel; ...@@ -29,7 +30,7 @@ class BookmarkModel;
@property(nonatomic, weak) id<BookmarkUpdatedDelegate> delegate; @property(nonatomic, weak) id<BookmarkUpdatedDelegate> delegate;
+ (BookmarksSpotlightManager*)bookmarksSpotlightManagerWithBrowserState: + (BookmarksSpotlightManager*)bookmarksSpotlightManagerWithBrowserState:
(ios::ChromeBrowserState*)browserState; (ChromeBrowserState*)browserState;
// Checks the date of the latest global indexation and reindex all bookmarks if // Checks the date of the latest global indexation and reindex all bookmarks if
// needed. // needed.
......
...@@ -151,7 +151,7 @@ class SpotlightBookmarkModelBridge : public bookmarks::BookmarkModelObserver { ...@@ -151,7 +151,7 @@ class SpotlightBookmarkModelBridge : public bookmarks::BookmarkModelObserver {
@implementation BookmarksSpotlightManager @implementation BookmarksSpotlightManager
+ (BookmarksSpotlightManager*)bookmarksSpotlightManagerWithBrowserState: + (BookmarksSpotlightManager*)bookmarksSpotlightManagerWithBrowserState:
(ios::ChromeBrowserState*)browserState { (ChromeBrowserState*)browserState {
return [[BookmarksSpotlightManager alloc] return [[BookmarksSpotlightManager alloc]
initWithLargeIconService:IOSChromeLargeIconServiceFactory:: initWithLargeIconService:IOSChromeLargeIconServiceFactory::
GetForBrowserState(browserState) GetForBrowserState(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;
// Allows Chrome to add the bookmarks of |bookmarkModel| in the systemwide // Allows Chrome to add the bookmarks of |bookmarkModel| in the systemwide
// Spotlight search index. // Spotlight search index.
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
// |browserState| must not be nil. // |browserState| must not be nil.
// There should be only one SpotlightManager observing |browserState|. // There should be only one SpotlightManager observing |browserState|.
+ (SpotlightManager*)spotlightManagerWithBrowserState: + (SpotlightManager*)spotlightManagerWithBrowserState:
(ios::ChromeBrowserState*)browserState; (ChromeBrowserState*)browserState;
// Resyncs the index if necessary // Resyncs the index if necessary
- (void)resyncIndex; - (void)resyncIndex;
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
ActionsSpotlightManager* _actionsManager; ActionsSpotlightManager* _actionsManager;
} }
- (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState - (instancetype)initWithBrowserState:(ChromeBrowserState*)browserState
NS_DESIGNATED_INITIALIZER; NS_DESIGNATED_INITIALIZER;
@end @end
...@@ -29,14 +29,14 @@ ...@@ -29,14 +29,14 @@
@implementation SpotlightManager @implementation SpotlightManager
+ (SpotlightManager*)spotlightManagerWithBrowserState: + (SpotlightManager*)spotlightManagerWithBrowserState:
(ios::ChromeBrowserState*)browserState { (ChromeBrowserState*)browserState {
if (spotlight::IsSpotlightAvailable()) { if (spotlight::IsSpotlightAvailable()) {
return [[SpotlightManager alloc] initWithBrowserState:browserState]; return [[SpotlightManager alloc] initWithBrowserState:browserState];
} }
return nil; return nil;
} }
- (instancetype)initWithBrowserState:(ios::ChromeBrowserState*)browserState { - (instancetype)initWithBrowserState:(ChromeBrowserState*)browserState {
DCHECK(browserState); DCHECK(browserState);
DCHECK(spotlight::IsSpotlightAvailable()); DCHECK(spotlight::IsSpotlightAvailable());
self = [super init]; self = [super init];
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
#define IOS_CHROME_APP_SPOTLIGHT_TOPSITES_SPOTLIGHT_MANAGER_H_ #define IOS_CHROME_APP_SPOTLIGHT_TOPSITES_SPOTLIGHT_MANAGER_H_
#import "ios/chrome/app/spotlight/base_spotlight_manager.h" #import "ios/chrome/app/spotlight/base_spotlight_manager.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state_forward.h"
class ChromeBrowserState;
// This spotlight manager handles indexing of sites shown on the NTP. Because of // This spotlight manager handles indexing of sites shown on the NTP. Because of
// privacy concerns, only sites shown on the NTP are indexed; therefore, this // privacy concerns, only sites shown on the NTP are indexed; therefore, this
...@@ -17,7 +18,7 @@ ...@@ -17,7 +18,7 @@
@interface TopSitesSpotlightManager : BaseSpotlightManager @interface TopSitesSpotlightManager : BaseSpotlightManager
+ (TopSitesSpotlightManager*)topSitesSpotlightManagerWithBrowserState: + (TopSitesSpotlightManager*)topSitesSpotlightManagerWithBrowserState:
(ios::ChromeBrowserState*)browserState; (ChromeBrowserState*)browserState;
// Reindexes all top sites, batching reindexes by 1 second. // Reindexes all top sites, batching reindexes by 1 second.
- (void)reindexTopSites; - (void)reindexTopSites;
......
...@@ -151,7 +151,7 @@ class SpotlightSuggestionsBridge ...@@ -151,7 +151,7 @@ class SpotlightSuggestionsBridge
@synthesize topSites = _topSites; @synthesize topSites = _topSites;
+ (TopSitesSpotlightManager*)topSitesSpotlightManagerWithBrowserState: + (TopSitesSpotlightManager*)topSitesSpotlightManagerWithBrowserState:
(ios::ChromeBrowserState*)browserState { (ChromeBrowserState*)browserState {
return [[TopSitesSpotlightManager alloc] return [[TopSitesSpotlightManager alloc]
initWithLargeIconService:IOSChromeLargeIconServiceFactory:: initWithLargeIconService:IOSChromeLargeIconServiceFactory::
GetForBrowserState(browserState) 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