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

Unified Diff: components/autofill/content/browser/autofill_driver_impl.h

Issue 17450010: Create AutofillDriverImpl unit test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nits Created 7 years, 6 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/browser/autofill_driver_impl.h
diff --git a/components/autofill/content/browser/autofill_driver_impl.h b/components/autofill/content/browser/autofill_driver_impl.h
index ffce5effb0c6b8e155c949371df090a65ef40d9b..5a3d41d4361d09208946cc40bb14c6e82d09cfd1 100644
--- a/components/autofill/content/browser/autofill_driver_impl.h
+++ b/components/autofill/content/browser/autofill_driver_impl.h
@@ -54,7 +54,7 @@ class AutofillDriverImpl : public AutofillDriver,
void SetAutofillExternalDelegate(
scoped_ptr<AutofillExternalDelegate> delegate);
- AutofillManager* autofill_manager() { return &autofill_manager_; }
+ AutofillManager* autofill_manager() { return autofill_manager_.get(); }
private:
AutofillDriverImpl(
@@ -71,13 +71,20 @@ class AutofillDriverImpl : public AutofillDriver,
const content::FrameNavigateParams& params) OVERRIDE;
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+ // Sets the manager to |manager|. Takes ownership of |manager|.
+ void set_autofill_manager(scoped_ptr<AutofillManager> manager) {
+ autofill_manager_.reset(manager.release());
Ilya Sherman 2013/06/20 00:07:16 nit: Can you use .Pass() instead of .release() her
blundell 2013/06/21 12:55:23 Done.
+ }
+
// AutofillExternalDelegate instance that this object instantiates in the
// case where the autofill native UI is enabled.
scoped_ptr<AutofillExternalDelegate> autofill_external_delegate_;
// AutofillManager instance via which this object drives the shared Autofill
// code.
- AutofillManager autofill_manager_;
+ scoped_ptr<AutofillManager> autofill_manager_;
+
+ friend class AutofillDriverImplTest;
Ilya Sherman 2013/06/20 00:07:16 Please don't add a friend class; instead, move set
blundell 2013/06/21 12:55:23 Done.
};
} // namespace autofill

Powered by Google App Engine
This is Rietveld 408576698