| 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/new_window_controller.h" | 9 #include "ash/new_window_controller.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // static | 23 // static |
| 24 const char ArcIntentHelperBridge::kArcServiceName[] = | 24 const char ArcIntentHelperBridge::kArcServiceName[] = |
| 25 "arc::ArcIntentHelperBridge"; | 25 "arc::ArcIntentHelperBridge"; |
| 26 | 26 |
| 27 // static | 27 // static |
| 28 const char ArcIntentHelperBridge::kArcIntentHelperPackageName[] = | 28 const char ArcIntentHelperBridge::kArcIntentHelperPackageName[] = |
| 29 "org.chromium.arc.intent_helper"; | 29 "org.chromium.arc.intent_helper"; |
| 30 | 30 |
| 31 ArcIntentHelperBridge::ArcIntentHelperBridge( | 31 ArcIntentHelperBridge::ArcIntentHelperBridge( |
| 32 ArcBridgeService* bridge_service, | 32 ArcBridgeService* bridge_service, |
| 33 const scoped_refptr<LocalActivityResolver>& activity_resolver) | 33 const scoped_refptr<LocalActivityResolver>& activity_resolver, |
| 34 const base::Callback<void()> first_run_function) |
| 34 : ArcService(bridge_service), | 35 : ArcService(bridge_service), |
| 35 binding_(this), | 36 binding_(this), |
| 36 activity_resolver_(activity_resolver) { | 37 activity_resolver_(activity_resolver), |
| 38 start_first_run_function_(first_run_function) { |
| 37 DCHECK(thread_checker_.CalledOnValidThread()); | 39 DCHECK(thread_checker_.CalledOnValidThread()); |
| 38 arc_bridge_service()->intent_helper()->AddObserver(this); | 40 arc_bridge_service()->intent_helper()->AddObserver(this); |
| 39 } | 41 } |
| 40 | 42 |
| 41 ArcIntentHelperBridge::~ArcIntentHelperBridge() { | 43 ArcIntentHelperBridge::~ArcIntentHelperBridge() { |
| 42 DCHECK(thread_checker_.CalledOnValidThread()); | 44 DCHECK(thread_checker_.CalledOnValidThread()); |
| 43 arc_bridge_service()->intent_helper()->RemoveObserver(this); | 45 arc_bridge_service()->intent_helper()->RemoveObserver(this); |
| 44 } | 46 } |
| 45 | 47 |
| 46 void ArcIntentHelperBridge::OnInstanceReady() { | 48 void ArcIntentHelperBridge::OnInstanceReady() { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 DCHECK(thread_checker_.CalledOnValidThread()); | 82 DCHECK(thread_checker_.CalledOnValidThread()); |
| 81 ash::Shell::Get()->wallpaper_controller()->OpenSetWallpaperPage(); | 83 ash::Shell::Get()->wallpaper_controller()->OpenSetWallpaperPage(); |
| 82 } | 84 } |
| 83 | 85 |
| 84 void ArcIntentHelperBridge::SetWallpaperDeprecated( | 86 void ArcIntentHelperBridge::SetWallpaperDeprecated( |
| 85 const std::vector<uint8_t>& jpeg_data) { | 87 const std::vector<uint8_t>& jpeg_data) { |
| 86 DCHECK(thread_checker_.CalledOnValidThread()); | 88 DCHECK(thread_checker_.CalledOnValidThread()); |
| 87 LOG(ERROR) << "IntentHelper.SetWallpaper is deprecated"; | 89 LOG(ERROR) << "IntentHelper.SetWallpaper is deprecated"; |
| 88 } | 90 } |
| 89 | 91 |
| 92 void ArcIntentHelperBridge::OnVoiceInteractionOobeSetupCompleted() { |
| 93 DCHECK(thread_checker_.CalledOnValidThread()); |
| 94 start_first_run_function_.Run(); |
| 95 } |
| 96 |
| 90 ArcIntentHelperBridge::GetResult ArcIntentHelperBridge::GetActivityIcons( | 97 ArcIntentHelperBridge::GetResult ArcIntentHelperBridge::GetActivityIcons( |
| 91 const std::vector<ActivityName>& activities, | 98 const std::vector<ActivityName>& activities, |
| 92 const OnIconsReadyCallback& callback) { | 99 const OnIconsReadyCallback& callback) { |
| 93 DCHECK(thread_checker_.CalledOnValidThread()); | 100 DCHECK(thread_checker_.CalledOnValidThread()); |
| 94 return icon_loader_.GetActivityIcons(activities, callback); | 101 return icon_loader_.GetActivityIcons(activities, callback); |
| 95 } | 102 } |
| 96 | 103 |
| 97 void ArcIntentHelperBridge::AddObserver(ArcIntentHelperObserver* observer) { | 104 void ArcIntentHelperBridge::AddObserver(ArcIntentHelperObserver* observer) { |
| 98 observer_list_.AddObserver(observer); | 105 observer_list_.AddObserver(observer); |
| 99 } | 106 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 void ArcIntentHelperBridge::OnIntentFiltersUpdated( | 140 void ArcIntentHelperBridge::OnIntentFiltersUpdated( |
| 134 std::vector<IntentFilter> filters) { | 141 std::vector<IntentFilter> filters) { |
| 135 DCHECK(thread_checker_.CalledOnValidThread()); | 142 DCHECK(thread_checker_.CalledOnValidThread()); |
| 136 activity_resolver_->UpdateIntentFilters(std::move(filters)); | 143 activity_resolver_->UpdateIntentFilters(std::move(filters)); |
| 137 | 144 |
| 138 for (auto& observer : observer_list_) | 145 for (auto& observer : observer_list_) |
| 139 observer.OnIntentFiltersUpdated(); | 146 observer.OnIntentFiltersUpdated(); |
| 140 } | 147 } |
| 141 | 148 |
| 142 } // namespace arc | 149 } // namespace arc |
| OLD | NEW |