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 #ifndef IOS_WEB_WEB_STATE_WEB_CONTROLLER_OBSERVER_BRIDGE_H_ | 5 #ifndef IOS_WEB_WEB_STATE_WEB_CONTROLLER_OBSERVER_BRIDGE_H_ |
6 #define IOS_WEB_WEB_STATE_WEB_CONTROLLER_OBSERVER_BRIDGE_H_ | 6 #define IOS_WEB_WEB_STATE_WEB_CONTROLLER_OBSERVER_BRIDGE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
| 10 #import "base/ios/weak_nsobject.h" |
10 #include "ios/web/public/web_state/web_state_observer.h" | 11 #include "ios/web/public/web_state/web_state_observer.h" |
11 | 12 |
12 @class CRWWebController; | 13 @class CRWWebController; |
13 @protocol CRWWebControllerObserver; | 14 @protocol CRWWebControllerObserver; |
14 class GURL; | 15 class GURL; |
15 | 16 |
16 namespace base { | 17 namespace base { |
17 class DictionaryValue; | 18 class DictionaryValue; |
18 } | 19 } |
19 | 20 |
(...skipping 25 matching lines...) Expand all Loading... |
45 | 46 |
46 private: | 47 private: |
47 // WebStateObserver implementation. | 48 // WebStateObserver implementation. |
48 void PageLoaded(PageLoadCompletionStatus load_completion_status) override; | 49 void PageLoaded(PageLoadCompletionStatus load_completion_status) override; |
49 | 50 |
50 // Callback for script commands. | 51 // Callback for script commands. |
51 bool ScriptCommandReceived(const base::DictionaryValue& value, | 52 bool ScriptCommandReceived(const base::DictionaryValue& value, |
52 const GURL& url, | 53 const GURL& url, |
53 bool user_is_interacting); | 54 bool user_is_interacting); |
54 | 55 |
55 id<CRWWebControllerObserver> web_controller_observer_; // Weak. | 56 base::WeakNSProtocol<id<CRWWebControllerObserver>> web_controller_observer_; |
56 CRWWebController* web_controller_; // Weak. | 57 base::WeakNSObject<CRWWebController> web_controller_; |
57 std::string script_command_callback_prefix_; | 58 std::string script_command_callback_prefix_; |
58 | 59 |
59 DISALLOW_COPY_AND_ASSIGN(WebControllerObserverBridge); | 60 DISALLOW_COPY_AND_ASSIGN(WebControllerObserverBridge); |
60 }; | 61 }; |
61 | 62 |
62 } // namespace web | 63 } // namespace web |
63 | 64 |
64 #endif // IOS_WEB_WEB_STATE_WEB_CONTROLLER_OBSERVER_BRIDGE_H_ | 65 #endif // IOS_WEB_WEB_STATE_WEB_CONTROLLER_OBSERVER_BRIDGE_H_ |
OLD | NEW |