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

Side by Side Diff: chrome/browser/ui/cocoa/passwords/account_avatar_fetcher_manager.mm

Issue 2606293002: Remove ScopedVector from chrome/browser/ui. (Closed)
Patch Set: view Created 3 years, 11 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
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 #import "chrome/browser/ui/cocoa/passwords/account_avatar_fetcher_manager.h" 5 #import "chrome/browser/ui/cocoa/passwords/account_avatar_fetcher_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/mac/foundation_util.h" 9 #include "base/mac/foundation_util.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 AccountAvatarFetcher* fetcher = 72 AccountAvatarFetcher* fetcher =
73 new AccountAvatarFetcher(avatarURL, bridge->AsWeakPtr()); 73 new AccountAvatarFetcher(avatarURL, bridge->AsWeakPtr());
74 bridges_.push_back(std::move(bridge)); 74 bridges_.push_back(std::move(bridge));
75 [self startRequestWithFetcher:fetcher]; 75 [self startRequestWithFetcher:fetcher];
76 } 76 }
77 77
78 - (void)updateAvatar:(NSImage*)image 78 - (void)updateAvatar:(NSImage*)image
79 fromBridge:(AccountAvatarFetcherBridge*)bridge 79 fromBridge:(AccountAvatarFetcherBridge*)bridge
80 forView:(CredentialItemButton*)view { 80 forView:(CredentialItemButton*)view {
81 [view setImage:image]; 81 [view setImage:image];
82 auto it = std::find(bridges_.begin(), bridges_.end(), bridge); 82 auto it = std::find_if(
83 bridges_.begin(), bridges_.end(),
84 [bridge](const std::unique_ptr<AccountAvatarFetcherBridge>& ptr) {
85 return ptr.get() == bridge;
86 });
83 if (it != bridges_.end()) 87 if (it != bridges_.end())
84 bridges_.erase(it); 88 bridges_.erase(it);
Nico 2017/01/03 18:12:35 nit: fwiw I find for (const auto& it = bridges_
Avi (use Gerrit) 2017/01/03 22:54:53 Done.
85 } 89 }
86 90
87 @end 91 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698