summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreugenebut <eugenebut@chromium.org>2016-03-04 15:13:40 -0800
committerCommit bot <commit-bot@chromium.org>2016-03-04 23:15:03 +0000
commitda5bc9563816fed084050d20e3413ab12ed2a4de (patch)
tree58b580c1eb5ffc8ec10a7a4c13d33d7429c6cf5a
parentdb5c4edb4bb0f9bad9916b6e67393a11bc435305 (diff)
downloadchromium_src-da5bc9563816fed084050d20e3413ab12ed2a4de.zip
chromium_src-da5bc9563816fed084050d20e3413ab12ed2a4de.tar.gz
chromium_src-da5bc9563816fed084050d20e3413ab12ed2a4de.tar.bz2
[ios] Removed CRWWebControllerScripting protocol.
BUG=579697 Review URL: https://codereview.chromium.org/1766553002 Cr-Commit-Position: refs/heads/master@{#379385}
-rw-r--r--ios/web/public/web_state/ui/crw_web_delegate.h24
-rw-r--r--ios/web/web_state/ui/crw_web_controller.h12
-rw-r--r--ios/web/web_state/ui/crw_web_controller.mm20
-rw-r--r--ios/web/web_state/ui/crw_web_controller_unittest.mm6
-rw-r--r--ios/web/web_state/ui/crw_wk_web_view_web_controller.mm4
5 files changed, 16 insertions, 50 deletions
diff --git a/ios/web/public/web_state/ui/crw_web_delegate.h b/ios/web/public/web_state/ui/crw_web_delegate.h
index 5bf73c7..9fc1050 100644
--- a/ios/web/public/web_state/ui/crw_web_delegate.h
+++ b/ios/web/public/web_state/ui/crw_web_delegate.h
@@ -35,26 +35,6 @@ struct WebLoadParams;
// Callback for -presentSSLError:forSSLStatus:onUrl:recoverable:callback:
typedef void (^SSLErrorCallback)(BOOL);
-// Interface to perform cross window scripting on CRWWebController.
-@protocol CRWWebControllerScripting
-
-// Loads the HTML into the page.
-- (void)loadHTML:(NSString*)html;
-
-// Loads HTML in the page and presents it as if it was originating from the
-// URL itself. Should be used only in specific cases, where the injected html
-// is guaranteed to be some derived representation of the original content.
-- (void)loadHTMLForCurrentURL:(NSString*)html;
-
-// Stops loading the page.
-- (void)stopLoading;
-
-// TODO(eugenebut): rename -[CRWWebController close] method to avoid confusion.
-// Asks the delegate to be closed.
-- (void)orderClose;
-
-@end
-
// Methods implemented by the delegate of the CRWWebController.
@protocol CRWWebDelegate<NSObject>
@@ -234,10 +214,6 @@ typedef void (^SSLErrorCallback)(BOOL);
// policy is set via -[CRWWebController setPageDialogsOpenPolicy:] method).
- (void)webControllerDidSuppressDialog:(CRWWebController*)webController;
-// Called to get CRWWebController of a child window by name.
-- (id<CRWWebControllerScripting>)webController:(CRWWebController*)webController
- scriptingInterfaceForWindowNamed:(NSString*)windowName;
-
// Called to retrieve the height of any header that is overlaying on top of the
// web view. This can be used to implement, for e.g. a toolbar that changes
// height dynamically. Returning a non-zero height affects the visible frame
diff --git a/ios/web/web_state/ui/crw_web_controller.h b/ios/web/web_state/ui/crw_web_controller.h
index 34ea9ee..f4eb810 100644
--- a/ios/web/web_state/ui/crw_web_controller.h
+++ b/ios/web/web_state/ui/crw_web_controller.h
@@ -79,7 +79,6 @@ class WebStateImpl;
@interface CRWWebController : NSObject<CRWJSInjectionEvaluator,
CRWRequestTrackerDelegate,
CRWTouchTrackingDelegate,
- CRWWebControllerScripting,
UIGestureRecognizerDelegate>
// Whether or not a UIWebView is allowed to exist in this CRWWebController.
@@ -184,12 +183,19 @@ class WebStateImpl;
// Loads the URL indicated by current session state.
- (void)loadCurrentURL;
-// Loads the HTML into the page.
-- (void)loadHTML:(NSString*)html;
+
// Loads HTML in the page and presents it as if it was originating from an
// application specific URL.
- (void)loadHTML:(NSString*)HTML forAppSpecificURL:(const GURL&)URL;
+// Loads HTML in the page and presents it as if it was originating from the
+// URL itself. Should be used only in specific cases, where the injected html
+// is guaranteed to be some derived representation of the original content.
+- (void)loadHTMLForCurrentURL:(NSString*)HTML;
+
+// Stops loading the page.
+- (void)stopLoading;
+
// Causes the page to start loading immediately if there is a pending load;
// normally if the web view has been paged out for memory reasons, loads are
// started lazily the next time the view is displayed. This can be called to
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm
index cf38e96..4cd999c 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -3741,16 +3741,6 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
}
}
-#pragma mark CRWWebControllerScripting Methods
-
-- (void)loadHTML:(NSString*)html {
- [self loadHTML:html forURL:GURL(url::kAboutBlankURL)];
-}
-
-- (void)loadHTMLForCurrentURL:(NSString*)html {
- [self loadHTML:html forURL:self.currentURL];
-}
-
- (void)loadHTML:(NSString*)html forURL:(const GURL&)url {
// Remove the transient content view.
[self clearTransientContentView];
@@ -3766,6 +3756,10 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
[self loadHTML:HTML forURL:URL];
}
+- (void)loadHTMLForCurrentURL:(NSString*)HTML {
+ [self loadHTML:HTML forURL:self.currentURL];
+}
+
- (void)stopLoading {
web::RecordAction(UserMetricsAction("Stop"));
// Discard the pending and transient entried before notifying the tab model
@@ -3780,12 +3774,6 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
}
}
-- (void)orderClose {
- if (self.sessionController.openedByDOM) {
- [_delegate webPageOrderedClose];
- }
-}
-
#pragma mark -
#pragma mark Testing-Only Methods
diff --git a/ios/web/web_state/ui/crw_web_controller_unittest.mm b/ios/web/web_state/ui/crw_web_controller_unittest.mm
index 0c67d13..92b8bed 100644
--- a/ios/web/web_state/ui/crw_web_controller_unittest.mm
+++ b/ios/web/web_state/ui/crw_web_controller_unittest.mm
@@ -262,12 +262,6 @@ class CRWWebControllerTest : public web::WebTestWithWebController {
referrer:web::Referrer()
transition:ui::PAGE_TRANSITION_TYPED
rendererInitiated:NO];
- // Set up child CRWWebController.
- mockChildWebController_.reset([[OCMockObject
- mockForProtocol:@protocol(CRWWebControllerScripting)] retain]);
- [[[mockDelegate_ stub] andReturn:mockChildWebController_.get()]
- webController:webController_
- scriptingInterfaceForWindowNamed:@"http://www.google.com/#newtab"];
}
void TearDown() override {
diff --git a/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm b/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm
index b209e19..d5f2340 100644
--- a/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm
+++ b/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm
@@ -2005,7 +2005,9 @@ WKWebViewErrorSource WKWebViewErrorSourceFromError(NSError* error) {
}
- (void)webViewDidClose:(WKWebView*)webView {
- [self orderClose];
+ if (self.sessionController.openedByDOM) {
+ [self.delegate webPageOrderedClose];
+ }
}
- (void)webView:(WKWebView*)webView