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 #include "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h" | 5 #include "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 new AutofillDialogControllerImpl(contents, | 254 new AutofillDialogControllerImpl(contents, |
255 form_structure, | 255 form_structure, |
256 source_url, | 256 source_url, |
257 dialog_type, | 257 dialog_type, |
258 callback); | 258 callback); |
259 return autofill_dialog_controller->weak_ptr_factory_.GetWeakPtr(); | 259 return autofill_dialog_controller->weak_ptr_factory_.GetWeakPtr(); |
260 } | 260 } |
261 | 261 |
262 // static | 262 // static |
263 void AutofillDialogControllerImpl::RegisterUserPrefs( | 263 void AutofillDialogControllerImpl::RegisterUserPrefs( |
264 PrefRegistrySyncable* registry) { | 264 user_prefs::PrefRegistrySyncable* registry) { |
265 registry->RegisterBooleanPref(::prefs::kAutofillDialogPayWithoutWallet, | 265 registry->RegisterBooleanPref( |
266 kPayWithoutWalletDefault, | 266 ::prefs::kAutofillDialogPayWithoutWallet, |
267 PrefRegistrySyncable::SYNCABLE_PREF); | 267 kPayWithoutWalletDefault, |
| 268 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
268 } | 269 } |
269 | 270 |
270 void AutofillDialogControllerImpl::Show() { | 271 void AutofillDialogControllerImpl::Show() { |
271 dialog_shown_timestamp_ = base::Time::Now(); | 272 dialog_shown_timestamp_ = base::Time::Now(); |
272 | 273 |
273 content::NavigationEntry* entry = contents_->GetController().GetActiveEntry(); | 274 content::NavigationEntry* entry = contents_->GetController().GetActiveEntry(); |
274 const GURL& active_url = entry ? entry->GetURL() : contents_->GetURL(); | 275 const GURL& active_url = entry ? entry->GetURL() : contents_->GetURL(); |
275 invoked_from_same_origin_ = active_url.GetOrigin() == source_url_.GetOrigin(); | 276 invoked_from_same_origin_ = active_url.GetOrigin() == source_url_.GetOrigin(); |
276 | 277 |
277 // Log any relevant UI metrics and security exceptions. | 278 // Log any relevant UI metrics and security exceptions. |
(...skipping 2136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2414 url, | 2415 url, |
2415 content::PAGE_TRANSITION_AUTO_BOOKMARK); | 2416 content::PAGE_TRANSITION_AUTO_BOOKMARK); |
2416 params.disposition = NEW_FOREGROUND_TAB; | 2417 params.disposition = NEW_FOREGROUND_TAB; |
2417 chrome::Navigate(¶ms); | 2418 chrome::Navigate(¶ms); |
2418 #else | 2419 #else |
2419 // TODO(estade): use TabModelList? | 2420 // TODO(estade): use TabModelList? |
2420 #endif | 2421 #endif |
2421 } | 2422 } |
2422 | 2423 |
2423 } // namespace autofill | 2424 } // namespace autofill |
OLD | NEW |