Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Unified Diff: components/autofill/content/renderer/test_password_generation_agent.h

Issue 151503006: Re-land r248110 with ASAN error fixed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Punctuation Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/autofill/content/renderer/test_password_generation_agent.h
diff --git a/components/autofill/content/renderer/test_password_generation_agent.h b/components/autofill/content/renderer/test_password_generation_agent.h
new file mode 100644
index 0000000000000000000000000000000000000000..e711ab0dc3f825e89257d72c42d040ef38e1c636
--- /dev/null
+++ b/components/autofill/content/renderer/test_password_generation_agent.h
@@ -0,0 +1,44 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_TEST_PASSWORD_GENERATION_AGENT_H_
+#define COMPONENTS_AUTOFILL_CONTENT_RENDERER_TEST_PASSWORD_GENERATION_AGENT_H_
+
+#include <vector>
+
+#include "base/memory/scoped_vector.h"
+#include "components/autofill/content/renderer/password_generation_agent.h"
+#include "ipc/ipc_message.h"
+
+namespace autofill {
+
+class TestPasswordGenerationAgent : public PasswordGenerationAgent {
+ public:
+ explicit TestPasswordGenerationAgent(content::RenderView* render_view);
+ virtual ~TestPasswordGenerationAgent();
+
+ // content::RenderViewObserver implementation:
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+ virtual bool Send(IPC::Message* message) OVERRIDE;
+
+ // Access messages that would have been sent to the browser.
+ const std::vector<IPC::Message*>& messages() const { return messages_.get(); }
+
+ // Clear outgoing message queue.
+ void clear_messages() { messages_.clear(); }
+
+ // PasswordGenreationAgent implementation:
+ // Always return true to allow loading of data URLs.
+ virtual bool ShouldAnalyzeDocument(
+ const blink::WebDocument& document) const OVERRIDE;
+
+ private:
+ ScopedVector<IPC::Message> messages_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestPasswordGenerationAgent);
+};
+
+} // namespace autofill
+
+#endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_TEST_PASSWORD_AUTOFILL_AGENT_H_

Powered by Google App Engine
This is Rietveld 408576698