| 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_TEST_PASSWORD_GENERATION_AGENT_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_TEST_PASSWORD_GENERATION_AGENT_H_ |
| 6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_TEST_PASSWORD_GENERATION_AGENT_H_ | 6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_TEST_PASSWORD_GENERATION_AGENT_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| 11 #include "components/autofill/content/renderer/password_generation_agent.h" | 11 #include "components/autofill/content/renderer/password_generation_agent.h" |
| 12 #include "ipc/ipc_message.h" | 12 #include "ipc/ipc_message.h" |
| 13 | 13 |
| 14 namespace autofill { | 14 namespace autofill { |
| 15 | 15 |
| 16 class TestPasswordGenerationAgent : public PasswordGenerationAgent { | 16 class TestPasswordGenerationAgent : public PasswordGenerationAgent { |
| 17 public: | 17 public: |
| 18 explicit TestPasswordGenerationAgent(content::RenderView* render_view); | 18 explicit TestPasswordGenerationAgent(content::RenderFrame* render_frame); |
| 19 ~TestPasswordGenerationAgent() override; | 19 ~TestPasswordGenerationAgent() override; |
| 20 | 20 |
| 21 // content::RenderViewObserver implementation: | 21 // content::RenderFrameObserver implementation: |
| 22 bool OnMessageReceived(const IPC::Message& message) override; | 22 bool OnMessageReceived(const IPC::Message& message) override; |
| 23 bool Send(IPC::Message* message) override; | 23 bool Send(IPC::Message* message) override; |
| 24 | 24 |
| 25 // Access messages that would have been sent to the browser. | 25 // Access messages that would have been sent to the browser. |
| 26 const std::vector<IPC::Message*>& messages() const { return messages_.get(); } | 26 const std::vector<IPC::Message*>& messages() const { return messages_.get(); } |
| 27 | 27 |
| 28 // Clear outgoing message queue. | 28 // Clear outgoing message queue. |
| 29 void clear_messages() { messages_.clear(); } | 29 void clear_messages() { messages_.clear(); } |
| 30 | 30 |
| 31 // PasswordGenreationAgent implementation: | 31 // PasswordGenreationAgent implementation: |
| 32 // Always return true to allow loading of data URLs. | 32 // Always return true to allow loading of data URLs. |
| 33 bool ShouldAnalyzeDocument(const blink::WebDocument& document) const override; | 33 bool ShouldAnalyzeDocument() const override; |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 ScopedVector<IPC::Message> messages_; | 36 ScopedVector<IPC::Message> messages_; |
| 37 | 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(TestPasswordGenerationAgent); | 38 DISALLOW_COPY_AND_ASSIGN(TestPasswordGenerationAgent); |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 } // namespace autofill | 41 } // namespace autofill |
| 42 | 42 |
| 43 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_TEST_PASSWORD_AUTOFILL_AGENT_H_ | 43 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_TEST_PASSWORD_AUTOFILL_AGENT_H_ |
| OLD | NEW |