Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_BROWSER_AUTOFILL_DRIVER_IMPL_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_DRIVER_IMPL_H_ |
| 6 #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_DRIVER_IMPL_H_ | 6 #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_DRIVER_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 | 47 |
| 48 AutofillExternalDelegate* autofill_external_delegate() { | 48 AutofillExternalDelegate* autofill_external_delegate() { |
| 49 return autofill_external_delegate_.get(); | 49 return autofill_external_delegate_.get(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 // Sets the external delegate to |delegate| both within this class and in the | 52 // Sets the external delegate to |delegate| both within this class and in the |
| 53 // shared Autofill code. Takes ownership of |delegate|. | 53 // shared Autofill code. Takes ownership of |delegate|. |
| 54 void SetAutofillExternalDelegate( | 54 void SetAutofillExternalDelegate( |
| 55 scoped_ptr<AutofillExternalDelegate> delegate); | 55 scoped_ptr<AutofillExternalDelegate> delegate); |
| 56 | 56 |
| 57 AutofillManager* autofill_manager() { return &autofill_manager_; } | 57 AutofillManager* autofill_manager() { return autofill_manager_.get(); } |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 AutofillDriverImpl( | 60 AutofillDriverImpl( |
| 61 content::WebContents* web_contents, | 61 content::WebContents* web_contents, |
| 62 autofill::AutofillManagerDelegate* delegate, | 62 autofill::AutofillManagerDelegate* delegate, |
| 63 const std::string& app_locale, | 63 const std::string& app_locale, |
| 64 AutofillManager::AutofillDownloadManagerState enable_download_manager, | 64 AutofillManager::AutofillDownloadManagerState enable_download_manager, |
| 65 bool enable_native_ui); | 65 bool enable_native_ui); |
| 66 virtual ~AutofillDriverImpl(); | 66 virtual ~AutofillDriverImpl(); |
| 67 | 67 |
| 68 // content::WebContentsObserver: | 68 // content::WebContentsObserver: |
| 69 virtual void DidNavigateMainFrame( | 69 virtual void DidNavigateMainFrame( |
| 70 const content::LoadCommittedDetails& details, | 70 const content::LoadCommittedDetails& details, |
| 71 const content::FrameNavigateParams& params) OVERRIDE; | 71 const content::FrameNavigateParams& params) OVERRIDE; |
| 72 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 72 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 73 | 73 |
| 74 // Sets the manager to |manager|. Takes ownership of |manager|. | |
| 75 void set_autofill_manager(scoped_ptr<AutofillManager> manager) { | |
| 76 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.
| |
| 77 } | |
| 78 | |
| 74 // AutofillExternalDelegate instance that this object instantiates in the | 79 // AutofillExternalDelegate instance that this object instantiates in the |
| 75 // case where the autofill native UI is enabled. | 80 // case where the autofill native UI is enabled. |
| 76 scoped_ptr<AutofillExternalDelegate> autofill_external_delegate_; | 81 scoped_ptr<AutofillExternalDelegate> autofill_external_delegate_; |
| 77 | 82 |
| 78 // AutofillManager instance via which this object drives the shared Autofill | 83 // AutofillManager instance via which this object drives the shared Autofill |
| 79 // code. | 84 // code. |
| 80 AutofillManager autofill_manager_; | 85 scoped_ptr<AutofillManager> autofill_manager_; |
| 86 | |
| 87 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.
| |
| 81 }; | 88 }; |
| 82 | 89 |
| 83 } // namespace autofill | 90 } // namespace autofill |
| 84 | 91 |
| 85 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_DRIVER_IMPL_H_ | 92 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_AUTOFILL_DRIVER_IMPL_H_ |
| OLD | NEW |