Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Side by Side Diff: chrome/browser/extensions/api/autofill_private/autofill_private_event_router.cc

Issue 2030803002: Fix newly introduced flake in ExtensionPreferenceApiTest.Standard (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/extensions/api/autofill_private/autofill_private_event_ router.h" 5 #include "chrome/browser/extensions/api/autofill_private/autofill_private_event_ router.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 AutofillPrivateEventRouter::~AutofillPrivateEventRouter() { 45 AutofillPrivateEventRouter::~AutofillPrivateEventRouter() {
46 } 46 }
47 47
48 void AutofillPrivateEventRouter::Shutdown() { 48 void AutofillPrivateEventRouter::Shutdown() {
49 if (personal_data_) 49 if (personal_data_)
50 personal_data_->RemoveObserver(this); 50 personal_data_->RemoveObserver(this);
51 } 51 }
52 52
53 void AutofillPrivateEventRouter::OnPersonalDataChanged() { 53 void AutofillPrivateEventRouter::OnPersonalDataChanged() {
54 DCHECK(personal_data_ && personal_data_->IsDataLoaded()); 54 DCHECK(personal_data_);
stevenjb 2016/06/08 00:25:53 Looking at personal_data_manager.cc, it is not cle
hcarmona 2016/06/08 14:21:06 Done.
55
56 // Ignore any updates before data is loaded. This can happen in tests.
57 if (!personal_data_->IsDataLoaded())
58 return;
55 59
56 autofill_util::AddressEntryList addressList = 60 autofill_util::AddressEntryList addressList =
57 extensions::autofill_util::GenerateAddressList(*personal_data_); 61 extensions::autofill_util::GenerateAddressList(*personal_data_);
58 std::unique_ptr<base::ListValue> args( 62 std::unique_ptr<base::ListValue> args(
59 api::autofill_private::OnAddressListChanged::Create(addressList) 63 api::autofill_private::OnAddressListChanged::Create(addressList)
60 .release()); 64 .release());
61 std::unique_ptr<Event> extension_event( 65 std::unique_ptr<Event> extension_event(
62 new Event(events::AUTOFILL_PRIVATE_ON_ADDRESS_LIST_CHANGED, 66 new Event(events::AUTOFILL_PRIVATE_ON_ADDRESS_LIST_CHANGED,
63 api::autofill_private::OnAddressListChanged::kEventName, 67 api::autofill_private::OnAddressListChanged::kEventName,
64 std::move(args))); 68 std::move(args)));
(...skipping 10 matching lines...) Expand all
75 std::move(args))); 79 std::move(args)));
76 event_router_->BroadcastEvent(std::move(extension_event)); 80 event_router_->BroadcastEvent(std::move(extension_event));
77 } 81 }
78 82
79 AutofillPrivateEventRouter* AutofillPrivateEventRouter::Create( 83 AutofillPrivateEventRouter* AutofillPrivateEventRouter::Create(
80 content::BrowserContext* context) { 84 content::BrowserContext* context) {
81 return new AutofillPrivateEventRouter(context); 85 return new AutofillPrivateEventRouter(context);
82 } 86 }
83 87
84 } // namespace extensions 88 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698