OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Implementation of the MalwareDetails class. | 5 // Implementation of the MalwareDetails class. |
6 | 6 |
7 #include "chrome/browser/safe_browsing/malware_details.h" | 7 #include "chrome/browser/safe_browsing/malware_details.h" |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 static const uint32 kMaxDomNodes = 500; | 32 static const uint32 kMaxDomNodes = 500; |
33 | 33 |
34 // static | 34 // static |
35 MalwareDetailsFactory* MalwareDetails::factory_ = NULL; | 35 MalwareDetailsFactory* MalwareDetails::factory_ = NULL; |
36 | 36 |
37 // The default MalwareDetailsFactory. Global, made a singleton so we | 37 // The default MalwareDetailsFactory. Global, made a singleton so we |
38 // don't leak it. | 38 // don't leak it. |
39 class MalwareDetailsFactoryImpl | 39 class MalwareDetailsFactoryImpl |
40 : public MalwareDetailsFactory { | 40 : public MalwareDetailsFactory { |
41 public: | 41 public: |
42 MalwareDetails* CreateMalwareDetails( | 42 virtual MalwareDetails* CreateMalwareDetails( |
43 SafeBrowsingUIManager* ui_manager, | 43 SafeBrowsingUIManager* ui_manager, |
44 WebContents* web_contents, | 44 WebContents* web_contents, |
45 const SafeBrowsingUIManager::UnsafeResource& unsafe_resource) { | 45 const SafeBrowsingUIManager::UnsafeResource& unsafe_resource) OVERRIDE { |
46 return new MalwareDetails(ui_manager, web_contents, unsafe_resource); | 46 return new MalwareDetails(ui_manager, web_contents, unsafe_resource); |
47 } | 47 } |
48 | 48 |
49 private: | 49 private: |
50 friend struct base::DefaultLazyInstanceTraits< | 50 friend struct base::DefaultLazyInstanceTraits< |
51 MalwareDetailsFactoryImpl>; | 51 MalwareDetailsFactoryImpl>; |
52 | 52 |
53 MalwareDetailsFactoryImpl() { } | 53 MalwareDetailsFactoryImpl() { } |
54 | 54 |
55 DISALLOW_COPY_AND_ASSIGN(MalwareDetailsFactoryImpl); | 55 DISALLOW_COPY_AND_ASSIGN(MalwareDetailsFactoryImpl); |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 | 305 |
306 // Send the report, using the SafeBrowsingService. | 306 // Send the report, using the SafeBrowsingService. |
307 std::string serialized; | 307 std::string serialized; |
308 if (!report_->SerializeToString(&serialized)) { | 308 if (!report_->SerializeToString(&serialized)) { |
309 DLOG(ERROR) << "Unable to serialize the malware report."; | 309 DLOG(ERROR) << "Unable to serialize the malware report."; |
310 return; | 310 return; |
311 } | 311 } |
312 | 312 |
313 ui_manager_->SendSerializedMalwareDetails(serialized); | 313 ui_manager_->SendSerializedMalwareDetails(serialized); |
314 } | 314 } |
OLD | NEW |