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

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

Issue 2416633002: Remove FOR_EACH_OBSERVER from arc/ since it's being deprecated (Closed)
Patch Set: remove braces Created 4 years, 2 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 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 <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 gfx::Image icon; 125 gfx::Image icon;
126 const ActivityIconLoader::ActivityName activity( 126 const ActivityIconLoader::ActivityName activity(
127 handlers_[i]->package_name, handlers_[i]->activity_name); 127 handlers_[i]->package_name, handlers_[i]->activity_name);
128 const auto it = icons_.find(activity); 128 const auto it = icons_.find(activity);
129 if (it != icons_.end()) 129 if (it != icons_.end())
130 icon = it->second.icon16; 130 icon = it->second.icon16;
131 // Use the handler's index as an ID. 131 // Use the handler's index as an ID.
132 ash::LinkHandlerInfo handler = {handlers_[i]->name.get(), icon, i}; 132 ash::LinkHandlerInfo handler = {handlers_[i]->name.get(), icon, i};
133 handlers.push_back(handler); 133 handlers.push_back(handler);
134 } 134 }
135 FOR_EACH_OBSERVER(Observer, observer_list_, ModelChanged(handlers)); 135 for (auto& observer : observer_list_)
136 observer.ModelChanged(handlers);
136 } 137 }
137 138
138 // static 139 // static
139 GURL LinkHandlerModelImpl::RewriteUrlFromQueryIfAvailableForTesting( 140 GURL LinkHandlerModelImpl::RewriteUrlFromQueryIfAvailableForTesting(
140 const GURL& url) { 141 const GURL& url) {
141 return RewriteUrlFromQueryIfAvailable(url); 142 return RewriteUrlFromQueryIfAvailable(url);
142 } 143 }
143 144
144 // static 145 // static
145 GURL LinkHandlerModelImpl::RewriteUrlFromQueryIfAvailable(const GURL& url) { 146 GURL LinkHandlerModelImpl::RewriteUrlFromQueryIfAvailable(const GURL& url) {
(...skipping 11 matching lines...) Expand all
157 if (!GetQueryValue(url, kKeyToFind, &value)) 158 if (!GetQueryValue(url, kKeyToFind, &value))
158 return url; 159 return url;
159 160
160 const GURL new_url(value); 161 const GURL new_url(value);
161 if (!new_url.is_valid()) 162 if (!new_url.is_valid())
162 return url; 163 return url;
163 return new_url; 164 return new_url;
164 } 165 }
165 166
166 } // namespace arc 167 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698