| 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 #include "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "chrome/browser/browser_process.h" | 6 #include "chrome/browser/browser_process.h" |
| 7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
| 8 #include "chrome/browser/ui/browser_tabstrip.h" | 8 #include "chrome/browser/ui/browser_tabstrip.h" |
| 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 10 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 ASSERT_TRUE(web_contents_ != NULL); | 85 ASSERT_TRUE(web_contents_ != NULL); |
| 86 Observe(web_contents_); | 86 Observe(web_contents_); |
| 87 AutofillManager::RegisterProfilePrefs(manager_delegate_.GetPrefRegistry()); | 87 AutofillManager::RegisterProfilePrefs(manager_delegate_.GetPrefRegistry()); |
| 88 | 88 |
| 89 autofill_driver_.reset( | 89 autofill_driver_.reset( |
| 90 new TestContentAutofillDriver(web_contents_, &manager_delegate_)); | 90 new TestContentAutofillDriver(web_contents_, &manager_delegate_)); |
| 91 } | 91 } |
| 92 | 92 |
| 93 // Normally the WebContents will automatically delete the driver, but here | 93 // Normally the WebContents will automatically delete the driver, but here |
| 94 // the driver is owned by this test, so we have to manually destroy. | 94 // the driver is owned by this test, so we have to manually destroy. |
| 95 virtual void WebContentsDestroyed(content::WebContents* web_contents) | 95 virtual void WebContentsDestroyed() |
| 96 OVERRIDE { | 96 OVERRIDE { |
| 97 DCHECK_EQ(web_contents_, web_contents); | 97 DCHECK_EQ(web_contents_, web_contents()); |
| 98 autofill_driver_.reset(); | 98 autofill_driver_.reset(); |
| 99 } | 99 } |
| 100 | 100 |
| 101 virtual void WasHidden() OVERRIDE { | 101 virtual void WasHidden() OVERRIDE { |
| 102 if (!web_contents_hidden_callback_.is_null()) | 102 if (!web_contents_hidden_callback_.is_null()) |
| 103 web_contents_hidden_callback_.Run(); | 103 web_contents_hidden_callback_.Run(); |
| 104 } | 104 } |
| 105 | 105 |
| 106 virtual void NavigationEntryCommitted( | 106 virtual void NavigationEntryCommitted( |
| 107 const content::LoadCommittedDetails& load_details) OVERRIDE { | 107 const content::LoadCommittedDetails& load_details) OVERRIDE { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 browser()->OpenURL(content::OpenURLParams(GURL(chrome::kChromeUIAboutURL), | 154 browser()->OpenURL(content::OpenURLParams(GURL(chrome::kChromeUIAboutURL), |
| 155 content::Referrer(), | 155 content::Referrer(), |
| 156 CURRENT_TAB, | 156 CURRENT_TAB, |
| 157 content::PAGE_TRANSITION_TYPED, | 157 content::PAGE_TRANSITION_TYPED, |
| 158 false)); | 158 false)); |
| 159 runner->Run(); | 159 runner->Run(); |
| 160 nav_entry_committed_callback_.Reset(); | 160 nav_entry_committed_callback_.Reset(); |
| 161 } | 161 } |
| 162 | 162 |
| 163 } // namespace autofill | 163 } // namespace autofill |
| OLD | NEW |