OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_APP_MAIN_CONTROLLER_PRIVATE_H_ |
| 6 #define IOS_CHROME_APP_MAIN_CONTROLLER_PRIVATE_H_ |
| 7 |
| 8 #import "base/ios/block_types.h" |
| 9 #include "components/browsing_data/core/browsing_data_utils.h" |
| 10 #import "ios/chrome/app/application_delegate/browser_launcher.h" |
| 11 #import "ios/chrome/app/main_controller.h" |
| 12 |
| 13 @class BrowserViewController; |
| 14 @class DeviceSharingManager; |
| 15 class GURL; |
| 16 @class SettingsNavigationController; |
| 17 @class SigninInteractionController; |
| 18 @class TabModel; |
| 19 @protocol TabSwitcher; |
| 20 |
| 21 namespace ios { |
| 22 class ChromeBrowserState; |
| 23 } |
| 24 |
| 25 // Private methods and protocols that are made visible here for tests. |
| 26 @interface MainController () |
| 27 |
| 28 // YES if the last time the app was launched was with a previous version. |
| 29 @property(nonatomic, readonly) BOOL isFirstLaunchAfterUpgrade; |
| 30 |
| 31 // Presents a promo's navigation controller. |
| 32 - (void)showPromo:(UIViewController*)promo; |
| 33 |
| 34 // Removes browsing data from |browserState| for datatypes in |mask|. |
| 35 // |browserState| cannot be null and must not be off the record. |
| 36 // |completionHandler| is called when this operation finishes. |
| 37 - (void)removeBrowsingDataFromBrowserState: |
| 38 (ios::ChromeBrowserState*)browserState |
| 39 mask:(int)mask |
| 40 timePeriod:(browsing_data::TimePeriod)timePeriod |
| 41 completionHandler:(ProceduralBlock)completionHandler; |
| 42 |
| 43 // Dismisses all modal dialogs then call |completion|. |
| 44 - (void)dismissModalDialogsWithCompletion:(ProceduralBlock)completion; |
| 45 |
| 46 @end |
| 47 |
| 48 // Methods that only exist for tests. |
| 49 @interface MainController (TestingOnly) |
| 50 |
| 51 @property(nonatomic, readonly) DeviceSharingManager* deviceSharingManager; |
| 52 @property(nonatomic, retain) |
| 53 UIViewController<TabSwitcher>* tabSwitcherController; |
| 54 @property(nonatomic, readonly) |
| 55 SettingsNavigationController* settingsNavigationController; |
| 56 @property(nonatomic, readonly) |
| 57 SigninInteractionController* signinInteractionController; |
| 58 |
| 59 // The top presented view controller that is not currently being dismissed. |
| 60 @property(nonatomic, readonly) UIViewController* topPresentedViewController; |
| 61 |
| 62 // Tab switcher state. |
| 63 @property(nonatomic, getter=isTabSwitcherActive) BOOL tabSwitcherActive; |
| 64 @property(nonatomic, readonly) BOOL dismissingTabSwitcher; |
| 65 |
| 66 // Sets up MainController for testing; clears history, closes all tabs and |
| 67 // switches to the main BVC. |completionHandler| is called when MainController |
| 68 // is completely set up for testing. |
| 69 - (void)setUpForTestingWithCompletionHandler:(ProceduralBlock)completionHandler; |
| 70 |
| 71 // Sets the internal startup state to indicate that the launch was triggered |
| 72 // by an external app opening the given URL. |
| 73 - (void)setStartupParametersWithURL:(const GURL&)launchURL; |
| 74 |
| 75 // Sets the internal state to indicate that the app has been foregrounded. |
| 76 - (void)setUpAsForegrounded; |
| 77 |
| 78 @end |
| 79 |
| 80 #endif // IOS_CHROME_APP_MAIN_CONTROLLER_PRIVATE_H_ |
OLD | NEW |