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

Unified Diff: ios/chrome/browser/web/web_controller_provider_impl.mm

Issue 2612433002: Remove CRWWebControllerProvider (Closed)
Patch Set: Remove DEPS Created 3 years, 12 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/web/web_controller_provider_impl.h ('k') | ios/public/provider/web/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/web/web_controller_provider_impl.mm
diff --git a/ios/chrome/browser/web/web_controller_provider_impl.mm b/ios/chrome/browser/web/web_controller_provider_impl.mm
deleted file mode 100644
index 240efb493c3b754b801d046e24c2b633046cce29..0000000000000000000000000000000000000000
--- a/ios/chrome/browser/web/web_controller_provider_impl.mm
+++ /dev/null
@@ -1,72 +0,0 @@
-// 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.
-
-#include "ios/chrome/browser/web/web_controller_provider_impl.h"
-
-#include "base/memory/ptr_util.h"
-#include "base/strings/sys_string_conversions.h"
-#import "ios/web/public/navigation_manager.h"
-#import "ios/web/web_state/ui/crw_web_controller.h"
-#import "ios/web/web_state/web_state_impl.h"
-#include "url/gurl.h"
-
-#if !defined(__has_feature) || !__has_feature(objc_arc)
-#error "This file requires ARC support."
-#endif
-
-WebControllerProviderImpl::WebControllerProviderImpl(
- web::BrowserState* browser_state)
- : ios::WebControllerProvider(browser_state),
- web_state_impl_(base::MakeUnique<web::WebStateImpl>(browser_state)),
- suppresses_dialogs_(false) {
- DCHECK(browser_state);
- web_state_impl_->GetNavigationManagerImpl().InitializeSession(nil, nil, NO,
- -1);
- [web_state_impl_->GetWebController() setWebUsageEnabled:YES];
-}
-
-WebControllerProviderImpl::~WebControllerProviderImpl() {}
-
-bool WebControllerProviderImpl::SuppressesDialogs() const {
- return suppresses_dialogs_;
-}
-
-void WebControllerProviderImpl::SetSuppressesDialogs(
- bool should_suppress_dialogs) {
- if (suppresses_dialogs_ != should_suppress_dialogs) {
- suppresses_dialogs_ = should_suppress_dialogs;
- [web_state_impl_->GetWebController()
- setShouldSuppressDialogs:suppresses_dialogs_];
- }
-}
-
-void WebControllerProviderImpl::LoadURL(const GURL& url) {
- if (!url.is_valid())
- return;
-
- [web_state_impl_->GetWebController()
- loadWithParams:web::NavigationManager::WebLoadParams(url)];
- [web_state_impl_->GetWebController() triggerPendingLoad];
- last_requested_url_ = url;
-}
-
-web::WebState* WebControllerProviderImpl::GetWebState() const {
- return web_state_impl_.get();
-}
-
-void WebControllerProviderImpl::InjectScript(
- const std::string& script,
- web::JavaScriptResultBlock completion) {
- if (web_state_impl_ &&
- web_state_impl_->GetVisibleURL() == last_requested_url_) {
- // Only inject the script if the web controller has finished loading the
- // last requested url.
- NSString* scriptString = base::SysUTF8ToNSString(script);
- [web_state_impl_->GetWebController() executeJavaScript:scriptString
- completionHandler:completion];
- } else if (completion) {
- // If the web controller isn't ready, call the |completion| immediately.
- completion(nil, nil);
- }
-}
« no previous file with comments | « ios/chrome/browser/web/web_controller_provider_impl.h ('k') | ios/public/provider/web/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698