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

Side by Side Diff: components/arc/intent_helper/link_handler_model_impl.cc

Issue 2034543003: Retry icon fetching after intent_helper is ready (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments 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 | « components/arc/intent_helper/activity_icon_loader_unittest.cc ('k') | 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/arc/intent_helper/link_handler_model_impl.h" 5 #include "components/arc/intent_helper/link_handler_model_impl.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 mojo::Array<mojom::UrlHandlerInfoPtr> handlers) { 108 mojo::Array<mojom::UrlHandlerInfoPtr> handlers) {
109 handlers_ = std::move(handlers); 109 handlers_ = std::move(handlers);
110 110
111 bool icon_info_notified = false; 111 bool icon_info_notified = false;
112 if (icon_loader_) { 112 if (icon_loader_) {
113 std::vector<ActivityIconLoader::ActivityName> activities; 113 std::vector<ActivityIconLoader::ActivityName> activities;
114 for (size_t i = 0; i < handlers_.size(); ++i) { 114 for (size_t i = 0; i < handlers_.size(); ++i) {
115 activities.emplace_back(handlers_[i]->package_name, 115 activities.emplace_back(handlers_[i]->package_name,
116 handlers_[i]->activity_name); 116 handlers_[i]->activity_name);
117 } 117 }
118 icon_info_notified = icon_loader_->GetActivityIcons( 118 const ActivityIconLoader::GetResult result = icon_loader_->GetActivityIcons(
119 activities, base::Bind(&LinkHandlerModelImpl::NotifyObserver, 119 activities, base::Bind(&LinkHandlerModelImpl::NotifyObserver,
120 weak_ptr_factory_.GetWeakPtr())); 120 weak_ptr_factory_.GetWeakPtr()));
121 icon_info_notified = ActivityIconLoader::HasIconsReadyCallbackRun(result);
121 } 122 }
122 123
123 if (!icon_info_notified) { 124 if (!icon_info_notified) {
124 // Call NotifyObserver() without icon information, unless 125 // Call NotifyObserver() without icon information, unless
125 // GetActivityIcons has already called it. Otherwise if we delay the 126 // GetActivityIcons has already called it. Otherwise if we delay the
126 // notification waiting for all icons, context menu may flicker. 127 // notification waiting for all icons, context menu may flicker.
127 NotifyObserver(nullptr); 128 NotifyObserver(nullptr);
128 } 129 }
129 } 130 }
130 131
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 if (!GetQueryValue(url, kKeyToFind, &value)) 173 if (!GetQueryValue(url, kKeyToFind, &value))
173 return url; 174 return url;
174 175
175 const GURL new_url(value); 176 const GURL new_url(value);
176 if (!new_url.is_valid()) 177 if (!new_url.is_valid())
177 return url; 178 return url;
178 return new_url; 179 return new_url;
179 } 180 }
180 181
181 } // namespace arc 182 } // namespace arc
OLDNEW
« no previous file with comments | « components/arc/intent_helper/activity_icon_loader_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698