| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 BLIMP_CLIENT_FEATURE_NAVIGATION_FEATURE_H_ | 5 #ifndef BLIMP_CLIENT_FEATURE_NAVIGATION_FEATURE_H_ |
| 6 #define BLIMP_CLIENT_FEATURE_NAVIGATION_FEATURE_H_ | 6 #define BLIMP_CLIENT_FEATURE_NAVIGATION_FEATURE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // Sets a NavigationMessageDelegate to be notified of all navigation messages | 46 // Sets a NavigationMessageDelegate to be notified of all navigation messages |
| 47 // for |tab_id| from the engine. | 47 // for |tab_id| from the engine. |
| 48 void SetDelegate(int tab_id, NavigationFeatureDelegate* delegate); | 48 void SetDelegate(int tab_id, NavigationFeatureDelegate* delegate); |
| 49 void RemoveDelegate(int tab_id); | 49 void RemoveDelegate(int tab_id); |
| 50 | 50 |
| 51 void NavigateToUrlText(int tab_id, const std::string& url_text); | 51 void NavigateToUrlText(int tab_id, const std::string& url_text); |
| 52 void Reload(int tab_id); | 52 void Reload(int tab_id); |
| 53 void GoForward(int tab_id); | 53 void GoForward(int tab_id); |
| 54 void GoBack(int tab_id); | 54 void GoBack(int tab_id); |
| 55 | 55 |
| 56 private: | |
| 57 // BlimpMessageProcessor implementation. | 56 // BlimpMessageProcessor implementation. |
| 58 void ProcessMessage(std::unique_ptr<BlimpMessage> message, | 57 void ProcessMessage(std::unique_ptr<BlimpMessage> message, |
| 59 const net::CompletionCallback& callback) override; | 58 const net::CompletionCallback& callback) override; |
| 60 | 59 |
| 60 private: |
| 61 NavigationFeatureDelegate* FindDelegate(const int tab_id); | 61 NavigationFeatureDelegate* FindDelegate(const int tab_id); |
| 62 | 62 |
| 63 typedef base::SmallMap<std::map<int, NavigationFeatureDelegate*>> DelegateMap; | 63 typedef base::SmallMap<std::map<int, NavigationFeatureDelegate*>> DelegateMap; |
| 64 | 64 |
| 65 DelegateMap delegates_; | 65 DelegateMap delegates_; |
| 66 | 66 |
| 67 // Used to send BlimpMessage::NAVIGATION messages to the engine. | 67 // Used to send BlimpMessage::NAVIGATION messages to the engine. |
| 68 std::unique_ptr<BlimpMessageProcessor> outgoing_message_processor_; | 68 std::unique_ptr<BlimpMessageProcessor> outgoing_message_processor_; |
| 69 | 69 |
| 70 DISALLOW_COPY_AND_ASSIGN(NavigationFeature); | 70 DISALLOW_COPY_AND_ASSIGN(NavigationFeature); |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 } // namespace client | 73 } // namespace client |
| 74 } // namespace blimp | 74 } // namespace blimp |
| 75 | 75 |
| 76 #endif // BLIMP_CLIENT_FEATURE_NAVIGATION_FEATURE_H_ | 76 #endif // BLIMP_CLIENT_FEATURE_NAVIGATION_FEATURE_H_ |
| OLD | NEW |