| 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/activity_icon_loader.h" | 5 #include "components/arc/intent_helper/activity_icon_loader.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include <tuple> | 9 #include <tuple> |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 mojom::IntentHelperInstance* GetIntentHelperInstance( | 30 mojom::IntentHelperInstance* GetIntentHelperInstance( |
| 31 ActivityIconLoader::GetResult* out_error_code) { | 31 ActivityIconLoader::GetResult* out_error_code) { |
| 32 DCHECK(out_error_code); | 32 DCHECK(out_error_code); |
| 33 ArcBridgeService* bridge_service = arc::ArcBridgeService::Get(); | 33 ArcBridgeService* bridge_service = arc::ArcBridgeService::Get(); |
| 34 if (!bridge_service) { | 34 if (!bridge_service) { |
| 35 VLOG(2) << "ARC bridge is not ready."; | 35 VLOG(2) << "ARC bridge is not ready."; |
| 36 *out_error_code = ActivityIconLoader::GetResult::FAILED_ARC_NOT_SUPPORTED; | 36 *out_error_code = ActivityIconLoader::GetResult::FAILED_ARC_NOT_SUPPORTED; |
| 37 return nullptr; | 37 return nullptr; |
| 38 } | 38 } |
| 39 mojom::IntentHelperInstance* intent_helper_instance = | 39 mojom::IntentHelperInstance* intent_helper_instance = |
| 40 bridge_service->intent_helper_instance(); | 40 bridge_service->intent_helper()->instance(); |
| 41 if (!intent_helper_instance) { | 41 if (!intent_helper_instance) { |
| 42 VLOG(2) << "ARC intent helper instance is not ready."; | 42 VLOG(2) << "ARC intent helper instance is not ready."; |
| 43 *out_error_code = ActivityIconLoader::GetResult::FAILED_ARC_NOT_READY; | 43 *out_error_code = ActivityIconLoader::GetResult::FAILED_ARC_NOT_READY; |
| 44 return nullptr; | 44 return nullptr; |
| 45 } | 45 } |
| 46 if (bridge_service->intent_helper_version() < kMinInstanceVersion) { | 46 if (bridge_service->intent_helper()->version() < kMinInstanceVersion) { |
| 47 VLOG(1) << "ARC intent helper instance is too old."; | 47 VLOG(1) << "ARC intent helper instance is too old."; |
| 48 *out_error_code = ActivityIconLoader::GetResult::FAILED_ARC_NOT_SUPPORTED; | 48 *out_error_code = ActivityIconLoader::GetResult::FAILED_ARC_NOT_SUPPORTED; |
| 49 return nullptr; | 49 return nullptr; |
| 50 } | 50 } |
| 51 return intent_helper_instance; | 51 return intent_helper_instance; |
| 52 } | 52 } |
| 53 | 53 |
| 54 ui::ScaleFactor GetSupportedScaleFactor() { | 54 ui::ScaleFactor GetSupportedScaleFactor() { |
| 55 std::vector<ui::ScaleFactor> scale_factors = ui::GetSupportedScaleFactors(); | 55 std::vector<ui::ScaleFactor> scale_factors = ui::GetSupportedScaleFactors(); |
| 56 DCHECK(!scale_factors.empty()); | 56 DCHECK(!scale_factors.empty()); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 cached_icons_.erase(kv.first); | 213 cached_icons_.erase(kv.first); |
| 214 cached_icons_.insert(std::make_pair(kv.first, kv.second)); | 214 cached_icons_.insert(std::make_pair(kv.first, kv.second)); |
| 215 } | 215 } |
| 216 | 216 |
| 217 // Merge the results that were obtained from cache before doing IPC. | 217 // Merge the results that were obtained from cache before doing IPC. |
| 218 result->insert(cached_result->begin(), cached_result->end()); | 218 result->insert(cached_result->begin(), cached_result->end()); |
| 219 cb.Run(std::move(result)); | 219 cb.Run(std::move(result)); |
| 220 } | 220 } |
| 221 | 221 |
| 222 } // namespace arc | 222 } // namespace arc |
| OLD | NEW |