| 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 #include "blimp/client/feature/navigation_feature.h" | 5 #include "blimp/client/core/contents/navigation_feature.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "blimp/common/create_blimp_message.h" | 10 #include "blimp/common/create_blimp_message.h" |
| 11 #include "blimp/common/proto/blimp_message.pb.h" | 11 #include "blimp/common/proto/blimp_message.pb.h" |
| 12 #include "blimp/common/proto/navigation.pb.h" | 12 #include "blimp/common/proto/navigation.pb.h" |
| 13 #include "components/url_formatter/url_fixer.h" | 13 #include "components/url_formatter/url_fixer.h" |
| 14 #include "net/base/net_errors.h" | 14 #include "net/base/net_errors.h" |
| 15 #include "url/gurl.h" | 15 #include "url/gurl.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 delegate->OnTitleChanged(tab_id, details.title()); | 120 delegate->OnTitleChanged(tab_id, details.title()); |
| 121 | 121 |
| 122 if (details.has_loading()) | 122 if (details.has_loading()) |
| 123 delegate->OnLoadingChanged(tab_id, details.loading()); | 123 delegate->OnLoadingChanged(tab_id, details.loading()); |
| 124 | 124 |
| 125 if (details.has_favicon()) { | 125 if (details.has_favicon()) { |
| 126 NOTIMPLEMENTED(); | 126 NOTIMPLEMENTED(); |
| 127 } | 127 } |
| 128 | 128 |
| 129 if (details.has_page_load_completed()) { | 129 if (details.has_page_load_completed()) { |
| 130 delegate->OnPageLoadStatusUpdate(tab_id, | 130 delegate->OnPageLoadStatusUpdate(tab_id, details.page_load_completed()); |
| 131 details.page_load_completed()); | |
| 132 } | 131 } |
| 133 } break; | 132 } break; |
| 134 case NavigationMessage::LOAD_URL: | 133 case NavigationMessage::LOAD_URL: |
| 135 case NavigationMessage::GO_BACK: | 134 case NavigationMessage::GO_BACK: |
| 136 case NavigationMessage::GO_FORWARD: | 135 case NavigationMessage::GO_FORWARD: |
| 137 case NavigationMessage::RELOAD: | 136 case NavigationMessage::RELOAD: |
| 138 NOTREACHED() << "Client received unexpected navigation type."; | 137 NOTREACHED() << "Client received unexpected navigation type."; |
| 139 break; | 138 break; |
| 140 case NavigationMessage::UNKNOWN: | 139 case NavigationMessage::UNKNOWN: |
| 141 NOTREACHED(); | 140 NOTREACHED(); |
| 142 } | 141 } |
| 143 | 142 |
| 144 callback.Run(net::OK); | 143 callback.Run(net::OK); |
| 145 } | 144 } |
| 146 | 145 |
| 147 NavigationFeature::NavigationFeatureDelegate* NavigationFeature::FindDelegate( | 146 NavigationFeature::NavigationFeatureDelegate* NavigationFeature::FindDelegate( |
| 148 const int tab_id) { | 147 const int tab_id) { |
| 149 DelegateMap::const_iterator it = delegates_.find(tab_id); | 148 DelegateMap::const_iterator it = delegates_.find(tab_id); |
| 150 if (it != delegates_.end()) | 149 if (it != delegates_.end()) |
| 151 return it->second; | 150 return it->second; |
| 152 return nullptr; | 151 return nullptr; |
| 153 } | 152 } |
| 154 | 153 |
| 155 } // namespace client | 154 } // namespace client |
| 156 } // namespace blimp | 155 } // namespace blimp |
| OLD | NEW |