| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |