OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/error_page/renderer/net_error_helper_core.h" | 5 #include "components/error_page/renderer/net_error_helper_core.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 NavigationCorrectionsLoadFinished( | 267 NavigationCorrectionsLoadFinished( |
268 SuggestionsToResponse(corrections, num_corrections)); | 268 SuggestionsToResponse(corrections, num_corrections)); |
269 } | 269 } |
270 | 270 |
271 void NavigationCorrectionsLoadFailure() { | 271 void NavigationCorrectionsLoadFailure() { |
272 NavigationCorrectionsLoadFinished(""); | 272 NavigationCorrectionsLoadFinished(""); |
273 } | 273 } |
274 | 274 |
275 void NavigationCorrectionsLoadFinished(const std::string& result) { | 275 void NavigationCorrectionsLoadFinished(const std::string& result) { |
276 url_being_fetched_ = GURL(); | 276 url_being_fetched_ = GURL(); |
277 core()->OnNavigationCorrectionsFetched(result, "en", false); | 277 core()->OnNavigationCorrectionsFetched(result, false); |
278 } | 278 } |
279 | 279 |
280 void DoErrorLoadOfURL(net::Error error, const GURL& url) { | 280 void DoErrorLoadOfURL(net::Error error, const GURL& url) { |
281 core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME, | 281 core()->OnStartLoad(NetErrorHelperCore::MAIN_FRAME, |
282 NetErrorHelperCore::NON_ERROR_PAGE); | 282 NetErrorHelperCore::NON_ERROR_PAGE); |
283 std::string html; | 283 std::string html; |
284 core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME, | 284 core()->GetErrorHTML(NetErrorHelperCore::MAIN_FRAME, |
285 NetErrorForURL(error, url), false /* is_failed_post */, | 285 NetErrorForURL(error, url), false /* is_failed_post */, |
286 false /* is_ignoring_cache */, &html); | 286 false /* is_ignoring_cache */, &html); |
287 EXPECT_FALSE(html.empty()); | 287 EXPECT_FALSE(html.empty()); |
(...skipping 2293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2581 DoErrorLoad(net::ERR_INTERNET_DISCONNECTED); | 2581 DoErrorLoad(net::ERR_INTERNET_DISCONNECTED); |
2582 EXPECT_TRUE(last_has_offline_pages()); | 2582 EXPECT_TRUE(last_has_offline_pages()); |
2583 EXPECT_EQ(0, show_offline_pages_count()); | 2583 EXPECT_EQ(0, show_offline_pages_count()); |
2584 core()->ExecuteButtonPress(NetErrorHelperCore::SHOW_OFFLINE_PAGES_BUTTON); | 2584 core()->ExecuteButtonPress(NetErrorHelperCore::SHOW_OFFLINE_PAGES_BUTTON); |
2585 EXPECT_EQ(1, show_offline_pages_count()); | 2585 EXPECT_EQ(1, show_offline_pages_count()); |
2586 } | 2586 } |
2587 #endif // defined(OS_ANDROID) | 2587 #endif // defined(OS_ANDROID) |
2588 | 2588 |
2589 } // namespace | 2589 } // namespace |
2590 } // namespace error_page | 2590 } // namespace error_page |
OLD | NEW |