Chromium Code Reviews (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out

Unified Diff: ios/chrome/app/application_delegate/app_state.h

Issue 2580363002: Upstream Chrome on iOS source code [1/11]. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/chrome/app/application_delegate/app_state.h
diff --git a/ios/chrome/app/application_delegate/app_state.h b/ios/chrome/app/application_delegate/app_state.h
new file mode 100644
index 0000000000000000000000000000000000000000..52aff1d69a87ab08387913c612277d99f2538453
--- /dev/null
+++ b/ios/chrome/app/application_delegate/app_state.h
@@ -0,0 +1,91 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+#import <UIKit/UIKit.h>
+@protocol AppNavigation;
+@protocol BrowserLauncher;
+@protocol BrowserViewInformation;
+@protocol TabOpening;
+@protocol TabSwitching;
+@protocol StartupInformation;
+@class DeviceSharingManager;
+@class MainApplicationDelegate;
+@class MemoryWarningHelper;
+@class MetricsMediator;
+@class TabModel;
+// Represents the application state and responds to application state changes
+// and system events.
+@interface AppState : NSObject
+- (instancetype)init NS_UNAVAILABLE;
+- (instancetype)
+ startupInformation:(id<StartupInformation>)startupInformation
+ applicationDelegate:(MainApplicationDelegate*)applicationDelegate
+// YES if the user has ever interacted with the application. May be NO if the
+// application has been woken up by the system for background work.
+@property(nonatomic, readonly) BOOL userInteracted;
+// Window for the application, it is not set during the initialization method.
+// Set the property before calling methods related to it.
+@property(nonatomic, assign) UIWindow* window;
+// Saves the launchOptions to be used from -newTabFromLaunchOptions. If the
+// application is in background, initialize the browser to basic. If not, launch
+// the browser.
+// Returns whether additional delegate handling should be performed (call to
+// -performActionForShortcutItem or -openURL by the system for example)
+- (BOOL)requiresHandlingAfterLaunchWithOptions:(NSDictionary*)launchOptions
+ stateBackground:(BOOL)stateBackground;
+// Whether the application is in Safe Mode.
+- (BOOL)isInSafeMode;
+// Logs duration of the session in the main tab model and records that chrome is
+// no longer in cold start.
+- (void)willResignActiveTabModel;
+// Called when the application is getting terminated. It stops all outgoing
+// requests, config updates, clears the device sharing manager and stops the
+// mainChrome instance.
+- (void)applicationWillTerminate:(UIApplication*)application
+ applicationNavigation:(id<AppNavigation>)appNavigation;
+// Resumes the session: reinitializing metrics and opening new tab if necessary.
+// User sessions are defined in terms of BecomeActive/ResignActive so that
+// session boundaries include things like turning the screen off or getting a
+// phone call, not just switching apps.
+- (void)resumeSessionWithTabOpener:(id<TabOpening>)tabOpener
+ tabSwitcher:(id<TabSwitching>)tabSwitcher;
+// Called when going into the background. iOS already broadcasts, so
+// stakeholders can register for it directly.
+- (void)applicationDidEnterBackground:(UIApplication*)application
+ memoryHelper:(MemoryWarningHelper*)memoryHelper
+ tabSwitcherIsActive:(BOOL)tabSwitcherIsActive;
+// Called when returning to the foreground. Resets and uploads the metrics.
+// Starts the browser to foreground if needed.
+- (void)applicationWillEnterForeground:(UIApplication*)application
+ metricsMediator:(MetricsMediator*)metricsMediator
+ memoryHelper:(MemoryWarningHelper*)memoryHelper
+ tabOpener:(id<TabOpening>)tabOpener
+ appNavigation:(id<AppNavigation>)appNavigation;
+// Sets the return value for -didFinishLaunchingWithOptions that determines if
+// UIKit should make followup delegate calls such as
+// -performActionForShortcutItem or -openURL.
+- (void)launchFromURLHandled:(BOOL)URLHandled;
« no previous file with comments | « ios/chrome/app/application_delegate/app_navigation.h ('k') | ios/chrome/app/application_delegate/ » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698