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

Unified Diff: ios/chrome/browser/ui/native_content_controller.h

Issue 1058933002: [iOS] Upstream //ios/chrome/browser/ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@upstreamMemory
Patch Set: Review comments Created 5 years, 9 months 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
« no previous file with comments | « ios/chrome/browser/ui/file_locations.mm ('k') | ios/chrome/browser/ui/native_content_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/native_content_controller.h
diff --git a/ios/chrome/browser/ui/native_content_controller.h b/ios/chrome/browser/ui/native_content_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..f084d2dbf21b6fe16e392b884f639d336b9d4fd7
--- /dev/null
+++ b/ios/chrome/browser/ui/native_content_controller.h
@@ -0,0 +1,46 @@
+// Copyright 2012 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_NATIVE_CONTENT_CONTROLLER_H_
+#define IOS_CHROME_BROWSER_UI_NATIVE_CONTENT_CONTROLLER_H_
+
+#import <Foundation/Foundation.h>
+
+#import "ios/web/public/web_state/crw_native_content.h"
+#include "url/gurl.h"
+
+@class UIView;
+
+// Abstract base class for controllers that implement the behavior for native
+// views that are presented inside the web content area. Automatically removes
+// |view| from the view hierarchy when it is destroyed. Subclasses are
+// responsible for setting the view (usually through loading a nib) and the
+// page title.
+@interface NativeContentController : NSObject<CRWNativeContent> {
+ @protected
+ UIView* _view; // Top-level view.
+ NSString* _title;
+ GURL _url;
+}
+
+@property(nonatomic, retain) IBOutlet UIView* view;
+@property(nonatomic, copy) NSString* title;
+@property(nonatomic, readonly, assign) const GURL& url;
+
+// Initializer that attempts to load the nib specified in |nibName| for
+// |url|, which may be nil.
+- (instancetype)initWithNibName:(NSString*)nibName url:(const GURL&)url;
+
+// Initializer with the |url| to be loaded.
+- (instancetype)initWithURL:(const GURL&)url;
+
+// Called when memory is low and this is not the foreground tab. Release
+// anything (such as views) that can be easily re-created to free up RAM.
+// Subclasses that override this method should always call
+// [super handleLowMemory].
+- (void)handleLowMemory;
+
+@end
+
+#endif // IOS_CHROME_BROWSER_UI_NATIVE_CONTENT_CONTROLLER_H_
« no previous file with comments | « ios/chrome/browser/ui/file_locations.mm ('k') | ios/chrome/browser/ui/native_content_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698