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

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: 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
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..bba53b49b9db9aebed8617b1e35e607b7e479c12
--- /dev/null
+++ b/ios/chrome/browser/ui/native_content_controller.h
@@ -0,0 +1,45 @@
+// 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_
sdefresne 2015/04/02 17:20:28 style: empty line before #include guard
+#define IOS_CHROME_BROWSER_UI_NATIVE_CONTENT_CONTROLLER_H_
+
+#import <UIKit/UIKit.h>
+
+#include "base/mac/objc_property_releaser.h"
+#import "ios/web/public/web_state/crw_native_content.h"
+#include "url/gurl.h"
+
+// 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> {
sdefresne 2015/04/02 17:20:28 Can you use the occasion to move the ivar to the .
droger 2015/04/03 08:59:07 No. These are @protected and used by subclasses. I
+ @protected
+ UIView* view_; // Top-level view.
+ NSString* title_;
+ GURL url_;
+ base::mac::ObjCPropertyReleaser propertyReleaser_NativeContentController_;
+}
+
+@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_

Powered by Google App Engine
This is Rietveld 408576698