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

Unified Diff: ios/web/shell/view_controller.mm

Issue 1851003003: [ios] Added web// public API to let embedder observe loading progress. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Self review Created 4 years, 8 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/web/shell/view_controller.mm
diff --git a/ios/web/shell/view_controller.mm b/ios/web/shell/view_controller.mm
index 5bf37c5942e9dfc12e58a73d464024360385af2c..b1c2a1308abbb0c653c2cd5025f13747577d293e 100644
--- a/ios/web/shell/view_controller.mm
+++ b/ios/web/shell/view_controller.mm
@@ -18,6 +18,7 @@
#include "ios/web/public/referrer.h"
#import "ios/web/public/web_controller_factory.h"
#include "ios/web/public/web_state/web_state.h"
+#import "ios/web/public/web_state/web_state_delegate_bridge.h"
#import "ios/web/public/web_state/web_state_observer_bridge.h"
#include "ios/web/shell/shell_browser_state.h"
#include "ios/web/web_state/ui/crw_web_controller.h"
@@ -30,10 +31,11 @@ NSString* const kWebShellAddressFieldAccessibilityLabel = @"Address field";
using web::NavigationManager;
-@interface ViewController ()<CRWWebStateObserver> {
+@interface ViewController ()<CRWWebStateDelegate, CRWWebStateObserver> {
web::BrowserState* _browserState;
base::scoped_nsobject<CRWWebController> _webController;
std::unique_ptr<web::WebStateObserverBridge> _webStateObserver;
+ std::unique_ptr<web::WebStateDelegateBridge> _webStateDelegate;
base::mac::ObjCPropertyReleaser _propertyReleaser_ViewController;
}
@@ -118,6 +120,8 @@ using web::NavigationManager;
[_webController setWebUsageEnabled:YES];
_webStateObserver.reset(new web::WebStateObserverBridge(self.webState, self));
+ _webStateDelegate.reset(new web::WebStateDelegateBridge(self));
+ self.webState->SetDelegate(_webStateDelegate.get());
UIView* view = self.webState->GetView();
[view setFrame:[_containerView bounds]];

Powered by Google App Engine
This is Rietveld 408576698