OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_RENDERER_SAVE_PASSWORD_PROGRESS_LOG GER_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_RENDERER_SAVE_PASSWORD_PROGRESS_LOG GER_H_ |
6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_RENDERER_SAVE_PASSWORD_PROGRESS_LOG GER_H_ | 6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_RENDERER_SAVE_PASSWORD_PROGRESS_LOG GER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "components/autofill/content/public/interfaces/autofill_driver.mojom.h" | |
11 #include "components/autofill/core/common/save_password_progress_logger.h" | 12 #include "components/autofill/core/common/save_password_progress_logger.h" |
12 | 13 |
13 class PasswordManagerClient; | |
14 | |
15 namespace blink { | 14 namespace blink { |
16 class WebFormControlElement; | 15 class WebFormControlElement; |
17 } | 16 } |
18 | 17 |
19 namespace IPC { | |
20 class Sender; | |
21 } | |
22 | |
23 namespace autofill { | 18 namespace autofill { |
24 | 19 |
25 // This is the SavePasswordProgressLogger specialization for the renderer code, | 20 // This is the SavePasswordProgressLogger specialization for the renderer code, |
26 // which sends logs to the browser process over IPC. | 21 // which sends logs to the browser process over IPC. |
27 class RendererSavePasswordProgressLogger : public SavePasswordProgressLogger { | 22 class RendererSavePasswordProgressLogger : public SavePasswordProgressLogger { |
28 public: | 23 public: |
29 // The logger will use |sender| and |routing_id| to send a | 24 // The logger will use |password_manager_driver| to send logs to the browser. |
30 // AutofillHostMsg_RecordSavePasswordProgress message with the logs to the | 25 // The |password_manager_driver| needs to outlive the constructed logger. |
31 // browser. The |sender| needs to outlive the constructed logger. | 26 RendererSavePasswordProgressLogger( |
32 RendererSavePasswordProgressLogger(IPC::Sender* sender, int routing_id); | 27 mojom::PasswordManagerDriver* password_manager_driver); |
33 ~RendererSavePasswordProgressLogger() override; | 28 ~RendererSavePasswordProgressLogger() override; |
34 | 29 |
35 void LogElementName(StringID label, | 30 void LogElementName(StringID label, |
36 const blink::WebFormControlElement& element); | 31 const blink::WebFormControlElement& element); |
37 | 32 |
38 protected: | 33 protected: |
39 // SavePasswordProgressLogger: | 34 // SavePasswordProgressLogger: |
40 void SendLog(const std::string& log) override; | 35 void SendLog(const std::string& log) override; |
41 | 36 |
42 private: | 37 private: |
43 // Used by SendLog to send the IPC message with logs. |sender_| needs to | 38 // Used by SendLog to send the IPC message with logs. |
vabr (Chromium)
2016/08/09 17:36:17
nit: To avoid confusion, I would drop "IPC message
leonhsl(Using Gerrit)
2016/08/10 13:22:02
Done and thanks.
| |
44 // outlive the logger. | 39 // |password_manager_driver_| needs to outlive the logger. |
45 IPC::Sender* const sender_; | 40 mojom::PasswordManagerDriver* password_manager_driver_; |
46 const int routing_id_; | |
47 | 41 |
48 DISALLOW_COPY_AND_ASSIGN(RendererSavePasswordProgressLogger); | 42 DISALLOW_COPY_AND_ASSIGN(RendererSavePasswordProgressLogger); |
49 }; | 43 }; |
50 | 44 |
51 } // namespace autofill | 45 } // namespace autofill |
52 | 46 |
53 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_RENDERER_SAVE_PASSWORD_PROGRESS_ LOGGER_H_ | 47 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_RENDERER_SAVE_PASSWORD_PROGRESS_ LOGGER_H_ |
OLD | NEW |