| 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/arc_intent_helper_bridge.h" | 5 #include "components/arc/intent_helper/arc_intent_helper_bridge.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/common/new_window_controller.h" | 9 #include "ash/common/new_window_controller.h" |
| 10 #include "ash/common/shell_delegate.h" | 10 #include "ash/common/shell_delegate.h" |
| 11 #include "ash/common/wallpaper/wallpaper_controller.h" | 11 #include "ash/common/wallpaper/wallpaper_controller.h" |
| 12 #include "ash/common/wm_shell.h" | 12 #include "ash/common/wm_shell.h" |
| 13 #include "ash/shell.h" | 13 #include "ash/shell.h" |
| 14 #include "base/command_line.h" | |
| 15 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 16 #include "components/arc/arc_bridge_service.h" | 15 #include "components/arc/arc_bridge_service.h" |
| 17 #include "components/arc/arc_service_manager.h" | 16 #include "components/arc/arc_service_manager.h" |
| 18 #include "components/arc/arc_util.h" | 17 #include "components/arc/arc_util.h" |
| 19 #include "components/arc/intent_helper/activity_icon_loader.h" | 18 #include "components/arc/intent_helper/activity_icon_loader.h" |
| 20 #include "components/arc/intent_helper/link_handler_model_impl.h" | 19 #include "components/arc/intent_helper/link_handler_model_impl.h" |
| 21 #include "components/arc/intent_helper/local_activity_resolver.h" | 20 #include "components/arc/intent_helper/local_activity_resolver.h" |
| 22 #include "ui/base/layout.h" | 21 #include "ui/base/layout.h" |
| 23 #include "url/gurl.h" | 22 #include "url/gurl.h" |
| 24 | 23 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 // availability. This happens only before MessageLoop starts or after | 138 // availability. This happens only before MessageLoop starts or after |
| 140 // MessageLoop stops, practically. | 139 // MessageLoop stops, practically. |
| 141 // Also, returning FAILED_ARC_NOT_READY looks problematic at the moment, | 140 // Also, returning FAILED_ARC_NOT_READY looks problematic at the moment, |
| 142 // because ArcProcessTask::StartIconLoading accesses to | 141 // because ArcProcessTask::StartIconLoading accesses to |
| 143 // ArcServiceManager::Get() return value, which can be nullptr. | 142 // ArcServiceManager::Get() return value, which can be nullptr. |
| 144 if (!IsArcAvailable()) { | 143 if (!IsArcAvailable()) { |
| 145 VLOG(2) << "ARC bridge is not supported."; | 144 VLOG(2) << "ARC bridge is not supported."; |
| 146 if (out_error_code) | 145 if (out_error_code) |
| 147 *out_error_code = GetResult::FAILED_ARC_NOT_SUPPORTED; | 146 *out_error_code = GetResult::FAILED_ARC_NOT_SUPPORTED; |
| 148 } else { | 147 } else { |
| 149 VLOG(2) << "ARC bridge is not ready."; | 148 VLOG(2) << "ARC service is not ready."; |
| 150 if (out_error_code) | 149 if (out_error_code) |
| 151 *out_error_code = GetResult::FAILED_ARC_NOT_READY; | 150 *out_error_code = GetResult::FAILED_ARC_NOT_READY; |
| 152 } | 151 } |
| 153 return false; | 152 return false; |
| 154 } | 153 } |
| 155 | 154 |
| 156 auto* intent_helper_holder = | 155 auto* intent_helper_holder = |
| 157 arc_service_manager->arc_bridge_service()->intent_helper(); | 156 arc_service_manager->arc_bridge_service()->intent_helper(); |
| 158 if (!intent_helper_holder->has_instance()) { | 157 if (!intent_helper_holder->has_instance()) { |
| 159 VLOG(2) << "ARC intent helper instance is not ready."; | 158 VLOG(2) << "ARC intent helper instance is not ready."; |
| 160 if (out_error_code) | 159 if (out_error_code) |
| 161 *out_error_code = GetResult::FAILED_ARC_NOT_READY; | 160 *out_error_code = GetResult::FAILED_ARC_NOT_READY; |
| 162 return false; | 161 return false; |
| 163 } | 162 } |
| 164 | 163 |
| 165 return true; | 164 return true; |
| 166 } | 165 } |
| 167 | 166 |
| 168 void ArcIntentHelperBridge::OnIntentFiltersUpdated( | 167 void ArcIntentHelperBridge::OnIntentFiltersUpdated( |
| 169 std::vector<IntentFilter> filters) { | 168 std::vector<IntentFilter> filters) { |
| 170 DCHECK(thread_checker_.CalledOnValidThread()); | 169 DCHECK(thread_checker_.CalledOnValidThread()); |
| 171 activity_resolver_->UpdateIntentFilters(std::move(filters)); | 170 activity_resolver_->UpdateIntentFilters(std::move(filters)); |
| 172 | 171 |
| 173 for (auto& observer : observer_list_) | 172 for (auto& observer : observer_list_) |
| 174 observer.OnIntentFiltersUpdated(); | 173 observer.OnIntentFiltersUpdated(); |
| 175 } | 174 } |
| 176 | 175 |
| 177 } // namespace arc | 176 } // namespace arc |
| OLD | NEW |