| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_IMPL_H_ |
| 6 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_IMPL_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" |
| 10 #include "chrome/browser/safe_browsing/ui_manager.h" |
| 11 #include "chrome/common/safe_browsing.mojom.h" |
| 12 #include "components/safe_browsing_db/database_manager.h" |
| 13 #include "ipc/ipc_message.h" |
| 14 |
| 15 namespace service_manager { |
| 16 struct BindSourceInfo; |
| 17 } |
| 18 |
| 19 namespace safe_browsing { |
| 20 |
| 21 // This class implements the Mojo interface for renderers to perform safe |
| 22 // browsing URL checks. |
| 23 class SafeBrowsingImpl : public chrome::mojom::SafeBrowsing { |
| 24 public: |
| 25 SafeBrowsingImpl(scoped_refptr<SafeBrowsingDatabaseManager> database_manager, |
| 26 scoped_refptr<SafeBrowsingUIManager> ui_manager, |
| 27 int render_process_id); |
| 28 ~SafeBrowsingImpl() override; |
| 29 |
| 30 static void Create( |
| 31 scoped_refptr<SafeBrowsingDatabaseManager> database_manager, |
| 32 scoped_refptr<SafeBrowsingUIManager> ui_manager, |
| 33 int render_process_id, |
| 34 const service_manager::BindSourceInfo& source_info, |
| 35 chrome::mojom::SafeBrowsingRequest request); |
| 36 |
| 37 private: |
| 38 // chrome::mojom::SafeBrowsing implementation. |
| 39 void CreateCheckerAndCheck( |
| 40 int32_t render_frame_id, |
| 41 chrome::mojom::SafeBrowsingUrlCheckerRequest request, |
| 42 const GURL& url, |
| 43 int32_t load_flags, |
| 44 content::ResourceType resource_type, |
| 45 const CreateCheckerAndCheckCallback& callback) override; |
| 46 |
| 47 scoped_refptr<SafeBrowsingDatabaseManager> database_manager_; |
| 48 scoped_refptr<SafeBrowsingUIManager> ui_manager_; |
| 49 int render_process_id_ = MSG_ROUTING_NONE; |
| 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingImpl); |
| 52 }; |
| 53 |
| 54 } // namespace safe_browsing |
| 55 |
| 56 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_IMPL_H_ |
| OLD | NEW |