Index: ios/chrome/browser/ui/browser_view_controller.mm |
diff --git a/ios/chrome/browser/ui/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view_controller.mm |
index 31d9288756f9cc645d642ea12c8233fa411457e2..79574e5cad74dbbd1809dde7e1ca28700a61b25a 100644 |
--- a/ios/chrome/browser/ui/browser_view_controller.mm |
+++ b/ios/chrome/browser/ui/browser_view_controller.mm |
@@ -75,6 +75,7 @@ |
#import "ios/chrome/browser/snapshots/snapshot_overlay.h" |
#import "ios/chrome/browser/snapshots/snapshot_overlay_provider.h" |
#import "ios/chrome/browser/storekit_launcher.h" |
+#import "ios/chrome/browser/suggestions/suggestions_coordinator.h" |
#import "ios/chrome/browser/tabs/tab.h" |
#import "ios/chrome/browser/tabs/tab_dialog_delegate.h" |
#import "ios/chrome/browser/tabs/tab_headers_delegate.h" |
@@ -387,6 +388,9 @@ NSString* const kReadingListSnackbarCategory = @"ReadingListSnackbarCategory"; |
// Used to display the QR Scanner UI. Nil if not visible. |
base::scoped_nsobject<QRScannerViewController> _qrScannerViewController; |
+ // Used to display the Suggestions. |
+ base::scoped_nsobject<SuggestionsCoordinator> _suggestionsCoordinator; |
+ |
// Used to display the Find In Page UI. Nil if not visible. |
base::scoped_nsobject<FindBarControllerIOS> _findBarController; |
@@ -4101,6 +4105,11 @@ class BrowserBookmarkModelBridge : public bookmarks::BookmarkModelObserver { |
[self showQRScanner]; |
} |
break; |
+ case IDC_SHOW_SUGGESTIONS_UI: |
+ if (experimental_flags::IsSuggestionsUIEnabled()) { |
+ [self showSuggestionsUI]; |
+ } |
+ break; |
default: |
// Unknown commands get sent up the responder chain. |
[super chromeExecuteCommand:sender]; |
@@ -4365,6 +4374,14 @@ class BrowserBookmarkModelBridge : public bookmarks::BookmarkModelObserver { |
completion:nil]; |
} |
+- (void)showSuggestionsUI { |
lpromero
2017/01/18 13:32:15
This could be called twice in a row (for example w
gambard
2017/01/18 14:34:47
Fixed in the coordinator.
|
+ if (!_suggestionsCoordinator) { |
+ _suggestionsCoordinator.reset( |
+ [[SuggestionsCoordinator alloc] initWithBaseViewController:self]); |
+ } |
+ [_suggestionsCoordinator start]; |
+} |
+ |
- (void)showNTPPanel:(NewTabPage::PanelIdentifier)panel { |
DCHECK(self.visible || self.dismissingModal); |
GURL url(kChromeUINewTabURL); |