| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import "ios/web/web_state/web_controller_observer_bridge.h" | 5 #import "ios/web/web_state/web_controller_observer_bridge.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #import "ios/web/public/web_state/crw_web_controller_observer.h" | 10 #import "ios/web/public/web_state/crw_web_controller_observer.h" |
| 11 #include "ios/web/public/web_state/web_state.h" | 11 #include "ios/web/public/web_state/web_state.h" |
| 12 | 12 |
| 13 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 14 #error "This file requires ARC support." |
| 15 #endif |
| 16 |
| 13 namespace web { | 17 namespace web { |
| 14 | 18 |
| 15 WebControllerObserverBridge::WebControllerObserverBridge( | 19 WebControllerObserverBridge::WebControllerObserverBridge( |
| 16 id<CRWWebControllerObserver> web_controller_observer, | 20 id<CRWWebControllerObserver> web_controller_observer, |
| 17 WebState* web_state, | 21 WebState* web_state, |
| 18 CRWWebController* web_controller) | 22 CRWWebController* web_controller) |
| 19 : WebStateObserver(web_state), | 23 : WebStateObserver(web_state), |
| 20 web_controller_observer_(web_controller_observer), | 24 web_controller_observer_(web_controller_observer), |
| 21 web_controller_(web_controller) { | 25 web_controller_(web_controller) { |
| 22 DCHECK(web_controller_observer_); | 26 DCHECK(web_controller_observer_); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 51 const GURL& url, | 55 const GURL& url, |
| 52 bool user_is_interacting) { | 56 bool user_is_interacting) { |
| 53 DCHECK(!script_command_callback_prefix_.empty()); | 57 DCHECK(!script_command_callback_prefix_.empty()); |
| 54 return [web_controller_observer_ handleCommand:value | 58 return [web_controller_observer_ handleCommand:value |
| 55 webController:web_controller_ | 59 webController:web_controller_ |
| 56 userIsInteracting:user_is_interacting | 60 userIsInteracting:user_is_interacting |
| 57 originURL:url]; | 61 originURL:url]; |
| 58 } | 62 } |
| 59 | 63 |
| 60 } // namespace web | 64 } // namespace web |
| OLD | NEW |