diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-31 18:27:35 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-31 18:27:35 +0000 |
commit | 512f48a97b576510c5a92e604772d99e49cac8cc (patch) | |
tree | e6492e9cd687be340838a4504e16f02571fcdb5e /chrome/browser/autofill | |
parent | bf9623686789f3265a8cda250d12c627eb707320 (diff) | |
download | chromium_src-512f48a97b576510c5a92e604772d99e49cac8cc.zip chromium_src-512f48a97b576510c5a92e604772d99e49cac8cc.tar.gz chromium_src-512f48a97b576510c5a92e604772d99e49cac8cc.tar.bz2 |
Per the Chromium style guide/dos-and-donts doc, don't inline non-"cheap
accessor" functions in non-test code.
This also attempts to put function declarations into some kind of consistent
order that's also compliant with the Google style guide:
* Constructors/destructors,
* Statics,
* Virtuals,
* Accessors,
* Other non-virtuals
There are a couple of minor changes to the names of some functions to try and be
consistent about "inlined functions are named unix_hacker()-style, out-of-line
functions aren't", and to make a few functions static that weren't; otherwise,
no code change.
BUG=none
TEST=none
R=isherman@chromium.org, pfeldman@chromium.org, xians@chromium.org
Review URL: https://codereview.chromium.org/19820004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214781 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autofill')
-rw-r--r-- | chrome/browser/autofill/autofill_interactive_uitest.cc | 57 |
1 files changed, 30 insertions, 27 deletions
diff --git a/chrome/browser/autofill/autofill_interactive_uitest.cc b/chrome/browser/autofill/autofill_interactive_uitest.cc index 75d7a80..7f55cb6 100644 --- a/chrome/browser/autofill/autofill_interactive_uitest.cc +++ b/chrome/browser/autofill/autofill_interactive_uitest.cc @@ -75,6 +75,7 @@ class AutofillManagerTestDelegateImpl public: AutofillManagerTestDelegateImpl() {} + // autofill::AutofillManagerTestDelegate: virtual void DidPreviewFormData() OVERRIDE { LOG(INFO) << "DidPreviewFormData"; loop_runner_->Quit(); @@ -125,15 +126,6 @@ class WindowedPersonalDataManagerObserver infobar_service_->RemoveInfoBar(infobar_service_->infobar_at(0)); } - void Wait() { - if (!alerted_) { - has_run_message_loop_ = true; - content::RunMessageLoop(); - } - PersonalDataManagerFactory::GetForProfile(browser_->profile())-> - RemoveObserver(this); - } - // PersonalDataManagerObserver: virtual void OnPersonalDataChanged() OVERRIDE { if (has_run_message_loop_) { @@ -161,6 +153,15 @@ class WindowedPersonalDataManagerObserver confirm_infobar->Accept(); } + void Wait() { + if (!alerted_) { + has_run_message_loop_ = true; + content::RunMessageLoop(); + } + PersonalDataManagerFactory::GetForProfile(browser_->profile())-> + RemoveObserver(this); + } + private: bool alerted_; bool has_run_message_loop_; @@ -180,6 +181,7 @@ class TestAutofillExternalDelegate : public AutofillExternalDelegate { } virtual ~TestAutofillExternalDelegate() {} + // AutofillExternalDelegate: virtual void OnPopupShown(content::KeyboardListener* listener) OVERRIDE { AutofillExternalDelegate::OnPopupShown(listener); keyboard_listener_ = listener; @@ -206,6 +208,7 @@ class AutofillInteractiveTest : public InProcessBrowserTest { protected: AutofillInteractiveTest() {} + // InProcessBrowserTest: virtual void SetUpOnMainThread() OVERRIDE { // Don't want Keychain coming up on Mac. test::DisableSystemServices(browser()->profile()); @@ -233,10 +236,24 @@ class AutofillInteractiveTest : public InProcessBrowserTest { autofill_manager->delegate()->HideAutofillPopup(); } - PersonalDataManager* personal_data_manager() { + PersonalDataManager* GetPersonalDataManager() { return PersonalDataManagerFactory::GetForProfile(browser()->profile()); } + content::RenderViewHost* GetRenderViewHost() { + return browser()->tab_strip_model()->GetActiveWebContents()-> + GetRenderViewHost(); + } + + TestAutofillExternalDelegate* GetExternalDelegate() { + content::WebContents* web_contents = + browser()->tab_strip_model()->GetActiveWebContents(); + AutofillDriverImpl* autofill_driver = + AutofillDriverImpl::FromWebContents(web_contents); + return static_cast<TestAutofillExternalDelegate*>( + autofill_driver->autofill_external_delegate()); + } + void CreateTestProfile() { AutofillProfile profile; test::SetProfileInfo( @@ -245,7 +262,7 @@ class AutofillInteractiveTest : public InProcessBrowserTest { "Basement", "Austin", "Texas", "78744", "US", "5125551234"); WindowedPersonalDataManagerObserver observer(browser()); - personal_data_manager()->AddProfile(profile); + GetPersonalDataManager()->AddProfile(profile); // AddProfile is asynchronous. Wait for it to finish before continuing the // tests. @@ -263,11 +280,6 @@ class AutofillInteractiveTest : public InProcessBrowserTest { EXPECT_EQ(expected_value, value); } - RenderViewHost* render_view_host() { - return browser()->tab_strip_model()->GetActiveWebContents()-> - GetRenderViewHost(); - } - void FocusFirstNameField() { LOG(WARNING) << "Clicking on the tab."; content::SimulateMouseClick( @@ -278,7 +290,7 @@ class AutofillInteractiveTest : public InProcessBrowserTest { LOG(WARNING) << "Focusing the first name field."; bool result = false; ASSERT_TRUE(content::ExecuteScriptAndExtractBool( - render_view_host(), + GetRenderViewHost(), "if (document.readyState === 'complete')" " document.getElementById('firstname').focus();" "else" @@ -315,19 +327,10 @@ class AutofillInteractiveTest : public InProcessBrowserTest { content::NativeWebKeyboardEvent event; event.windowsKeyCode = key; test_delegate_.Reset(); - external_delegate()->keyboard_listener()->HandleKeyPressEvent(event); + GetExternalDelegate()->keyboard_listener()->HandleKeyPressEvent(event); test_delegate_.Wait(); } - TestAutofillExternalDelegate* external_delegate() { - content::WebContents* web_contents = - browser()->tab_strip_model()->GetActiveWebContents(); - AutofillDriverImpl* autofill_driver = - AutofillDriverImpl::FromWebContents(web_contents); - return static_cast<TestAutofillExternalDelegate*>( - autofill_driver->autofill_external_delegate()); - } - AutofillManagerTestDelegateImpl test_delegate_; }; |