OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "components/autofill/browser/autocheckout/whitelist_manager.h" | 5 #include "components/autofill/browser/autocheckout/whitelist_manager.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/metrics/field_trial.h" |
10 #include "base/string_util.h" | 11 #include "base/string_util.h" |
11 #include "base/strings/string_split.h" | 12 #include "base/strings/string_split.h" |
12 #include "components/autofill/common/autofill_switches.h" | 13 #include "components/autofill/common/autofill_switches.h" |
13 #include "content/public/browser/browser_context.h" | 14 #include "content/public/browser/browser_context.h" |
14 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
15 #include "net/base/load_flags.h" | 16 #include "net/base/load_flags.h" |
16 #include "net/http/http_status_code.h" | 17 #include "net/http/http_status_code.h" |
17 #include "net/url_request/url_fetcher.h" | 18 #include "net/url_request/url_fetcher.h" |
18 #include "net/url_request/url_request_context_getter.h" | 19 #include "net/url_request/url_request_context_getter.h" |
19 | 20 |
(...skipping 14 matching lines...) Expand all Loading... |
34 } // namespace | 35 } // namespace |
35 | 36 |
36 | 37 |
37 namespace autofill { | 38 namespace autofill { |
38 namespace autocheckout { | 39 namespace autocheckout { |
39 | 40 |
40 WhitelistManager::WhitelistManager() | 41 WhitelistManager::WhitelistManager() |
41 : callback_is_pending_(false), | 42 : callback_is_pending_(false), |
42 experimental_form_filling_enabled_( | 43 experimental_form_filling_enabled_( |
43 CommandLine::ForCurrentProcess()->HasSwitch( | 44 CommandLine::ForCurrentProcess()->HasSwitch( |
44 switches::kEnableExperimentalFormFilling)), | 45 switches::kEnableExperimentalFormFilling) || |
| 46 base::FieldTrialList::FindFullName("Autocheckout") == "Yes"), |
45 bypass_autocheckout_whitelist_( | 47 bypass_autocheckout_whitelist_( |
46 CommandLine::ForCurrentProcess()->HasSwitch( | 48 CommandLine::ForCurrentProcess()->HasSwitch( |
47 switches::kBypassAutocheckoutWhitelist)) { | 49 switches::kBypassAutocheckoutWhitelist)) { |
48 } | 50 } |
49 | 51 |
50 WhitelistManager::~WhitelistManager() {} | 52 WhitelistManager::~WhitelistManager() {} |
51 | 53 |
52 void WhitelistManager::Init(net::URLRequestContextGetter* context_getter) { | 54 void WhitelistManager::Init(net::URLRequestContextGetter* context_getter) { |
53 DCHECK(context_getter); | 55 DCHECK(context_getter); |
54 context_getter_ = context_getter; | 56 context_getter_ = context_getter; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // Chrome can ignore them and continue to work. | 142 // Chrome can ignore them and continue to work. |
141 if (!fields[0].empty()) | 143 if (!fields[0].empty()) |
142 new_url_prefixes.push_back(fields[0]); | 144 new_url_prefixes.push_back(fields[0]); |
143 } | 145 } |
144 } | 146 } |
145 url_prefixes_ = new_url_prefixes; | 147 url_prefixes_ = new_url_prefixes; |
146 } | 148 } |
147 | 149 |
148 } // namespace autocheckout | 150 } // namespace autocheckout |
149 } // namespace autofill | 151 } // namespace autofill |
OLD | NEW |