Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Unified Diff: ios/chrome/browser/ui/reader_mode/reader_mode_controller.h

Issue 2589583003: Upstream Chrome on iOS source code [7/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/browser/ui/reader_mode/reader_mode_controller.h
diff --git a/ios/chrome/browser/ui/reader_mode/reader_mode_controller.h b/ios/chrome/browser/ui/reader_mode/reader_mode_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..9f9bcc26847d6a31d23c49fc5315672292e00541
--- /dev/null
+++ b/ios/chrome/browser/ui/reader_mode/reader_mode_controller.h
@@ -0,0 +1,49 @@
+// Copyright 2015 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.
+
+#ifndef IOS_CHROME_BROWSER_UI_READER_MODE_READER_MODE_CONTROLLER_H_
+#define IOS_CHROME_BROWSER_UI_READER_MODE_READER_MODE_CONTROLLER_H_
+
+#import <UIKit/UIKit.h>
+
+class GURL;
+class ReaderModeChecker;
+
+namespace web {
+class WebState;
+}
+
+@protocol ReaderModeControllerDelegate
+// Called by the controller to retrieve the superview that the reader mode
+// panel should be a subview of. The panel's position is based on the size of
+// the superview, which is presumed to fill the device's screen.
+- (UIView*)superviewForReaderModePanel;
+
+// Called when the distillation finishes.
+- (void)loadReaderModeHTML:(NSString*)html forURL:(const GURL&)url;
+@end
+
+// A reader mode controller can trigger distillations on the current visible
+// page on a web state.
+@interface ReaderModeController : NSObject
+
+- (instancetype)initWithWebState:(web::WebState*)state
+ delegate:(id<ReaderModeControllerDelegate>)delegate
+ NS_DESIGNATED_INITIALIZER;
+
+- (instancetype)init NS_UNAVAILABLE;
+
+// The object that checks if a URL is suitable for reader mode.
+@property(nonatomic, readonly, assign) ReaderModeChecker* checker;
+
+// Starts a distillation, animates a view on screen to show a waiting UI to the
+// user while the distillation is ongoing, and calls the delegate once finished.
+- (void)switchToReaderMode;
+// Removes the waiting view from the superview returned by the delegate.
+- (void)exitReaderMode;
+// Instructs the controller to detach itself from the web state.
+- (void)detachFromWebState;
+@end
+
+#endif // IOS_CHROME_BROWSER_UI_READER_MODE_READER_MODE_CONTROLLER_H_
« no previous file with comments | « ios/chrome/browser/ui/reader_mode/reader_mode_checker.mm ('k') | ios/chrome/browser/ui/reader_mode/reader_mode_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698