OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
7 #include "chrome/browser/ui/browser_tabstrip.h" | 8 #include "chrome/browser/ui/browser_tabstrip.h" |
8 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 9 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
9 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
10 #include "chrome/test/base/in_process_browser_test.h" | 11 #include "chrome/test/base/in_process_browser_test.h" |
11 #include "chrome/test/base/testing_pref_service_syncable.h" | 12 #include "chrome/test/base/testing_pref_service_syncable.h" |
12 #include "components/autofill/browser/autofill_manager.h" | 13 #include "components/autofill/browser/autofill_manager.h" |
13 #include "components/autofill/browser/test_autofill_external_delegate.h" | 14 #include "components/autofill/browser/test_autofill_external_delegate.h" |
14 #include "components/autofill/browser/test_autofill_manager_delegate.h" | 15 #include "components/autofill/browser/test_autofill_manager_delegate.h" |
15 #include "content/public/browser/navigation_controller.h" | 16 #include "content/public/browser/navigation_controller.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 TestingPrefServiceSyncable prefs_; | 52 TestingPrefServiceSyncable prefs_; |
52 | 53 |
53 DISALLOW_COPY_AND_ASSIGN(MockAutofillManagerDelegate); | 54 DISALLOW_COPY_AND_ASSIGN(MockAutofillManagerDelegate); |
54 }; | 55 }; |
55 | 56 |
56 // Subclass AutofillManager so we can create AutofillManager instance. | 57 // Subclass AutofillManager so we can create AutofillManager instance. |
57 class TestAutofillManager : public AutofillManager { | 58 class TestAutofillManager : public AutofillManager { |
58 public: | 59 public: |
59 TestAutofillManager(content::WebContents* web_contents, | 60 TestAutofillManager(content::WebContents* web_contents, |
60 autofill::AutofillManagerDelegate* delegate) | 61 autofill::AutofillManagerDelegate* delegate) |
61 : AutofillManager(web_contents, delegate) {} | 62 : AutofillManager(web_contents, |
| 63 delegate, |
| 64 g_browser_process->GetApplicationLocale()) {} |
62 virtual ~TestAutofillManager() {} | 65 virtual ~TestAutofillManager() {} |
63 | 66 |
64 private: | 67 private: |
65 DISALLOW_COPY_AND_ASSIGN(TestAutofillManager); | 68 DISALLOW_COPY_AND_ASSIGN(TestAutofillManager); |
66 }; | 69 }; |
67 | 70 |
68 // Subclass AutofillExternalDelegate so we can create an | 71 // Subclass AutofillExternalDelegate so we can create an |
69 // AutofillExternalDelegate instance. | 72 // AutofillExternalDelegate instance. |
70 class TestAutofillExternalDelegate : public AutofillExternalDelegate { | 73 class TestAutofillExternalDelegate : public AutofillExternalDelegate { |
71 public: | 74 public: |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 content::Source<content::NavigationController>( | 149 content::Source<content::NavigationController>( |
147 &(web_contents_->GetController()))); | 150 &(web_contents_->GetController()))); |
148 browser()->OpenURL(content::OpenURLParams( | 151 browser()->OpenURL(content::OpenURLParams( |
149 GURL(chrome::kChromeUIBookmarksURL), content::Referrer(), | 152 GURL(chrome::kChromeUIBookmarksURL), content::Referrer(), |
150 CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false)); | 153 CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false)); |
151 browser()->OpenURL(content::OpenURLParams( | 154 browser()->OpenURL(content::OpenURLParams( |
152 GURL(chrome::kChromeUIAboutURL), content::Referrer(), | 155 GURL(chrome::kChromeUIAboutURL), content::Referrer(), |
153 CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false)); | 156 CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false)); |
154 observer.Wait(); | 157 observer.Wait(); |
155 } | 158 } |
OLD | NEW |