| 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 <memory> | 10 #include <memory> |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 const char kNavigationCorrectionFingerprint[] = "RandumStuff"; | 49 const char kNavigationCorrectionFingerprint[] = "RandumStuff"; |
| 50 | 50 |
| 51 struct NavigationCorrection { | 51 struct NavigationCorrection { |
| 52 const char* correction_type; | 52 const char* correction_type; |
| 53 const char* url_correction; | 53 const char* url_correction; |
| 54 const char* click_type; | 54 const char* click_type; |
| 55 const char* click_data; | 55 const char* click_data; |
| 56 bool is_porn; | 56 bool is_porn; |
| 57 bool is_soft_porn; | 57 bool is_soft_porn; |
| 58 | 58 |
| 59 base::Value* ToValue() const { | 59 std::unique_ptr<base::DictionaryValue> ToValue() const { |
| 60 base::DictionaryValue* dict = new base::DictionaryValue(); | 60 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| 61 dict->SetString("correctionType", correction_type); | 61 dict->SetString("correctionType", correction_type); |
| 62 dict->SetString("urlCorrection", url_correction); | 62 dict->SetString("urlCorrection", url_correction); |
| 63 dict->SetString("clickType", click_type); | 63 dict->SetString("clickType", click_type); |
| 64 dict->SetString("clickData", click_data); | 64 dict->SetString("clickData", click_data); |
| 65 dict->SetBoolean("isPorn", is_porn); | 65 dict->SetBoolean("isPorn", is_porn); |
| 66 dict->SetBoolean("isSoftPorn", is_soft_porn); | 66 dict->SetBoolean("isSoftPorn", is_soft_porn); |
| 67 return dict; | 67 return dict; |
| 68 } | 68 } |
| 69 }; | 69 }; |
| 70 | 70 |
| (...skipping 2510 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 |