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/shell_delegate.h" | 9 #include "ash/common/shell_delegate.h" |
10 #include "ash/common/wallpaper/wallpaper_controller.h" | 10 #include "ash/common/wallpaper/wallpaper_controller.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 DCHECK(thread_checker_.CalledOnValidThread()); | 80 DCHECK(thread_checker_.CalledOnValidThread()); |
81 ash::WmShell::Get()->wallpaper_controller()->OpenSetWallpaperPage(); | 81 ash::WmShell::Get()->wallpaper_controller()->OpenSetWallpaperPage(); |
82 } | 82 } |
83 | 83 |
84 void ArcIntentHelperBridge::SetWallpaperDeprecated( | 84 void ArcIntentHelperBridge::SetWallpaperDeprecated( |
85 const std::vector<uint8_t>& jpeg_data) { | 85 const std::vector<uint8_t>& jpeg_data) { |
86 DCHECK(thread_checker_.CalledOnValidThread()); | 86 DCHECK(thread_checker_.CalledOnValidThread()); |
87 LOG(ERROR) << "IntentHelper.SetWallpaper is deprecated"; | 87 LOG(ERROR) << "IntentHelper.SetWallpaper is deprecated"; |
88 } | 88 } |
89 | 89 |
| 90 void ArcIntentHelperBridge::AddObserver(ArcIntentHelperObserver* observer) { |
| 91 observer_list_.AddObserver(observer); |
| 92 } |
| 93 |
| 94 void ArcIntentHelperBridge::RemoveObserver(ArcIntentHelperObserver* observer) { |
| 95 observer_list_.RemoveObserver(observer); |
| 96 } |
| 97 |
90 std::unique_ptr<ash::LinkHandlerModel> ArcIntentHelperBridge::CreateModel( | 98 std::unique_ptr<ash::LinkHandlerModel> ArcIntentHelperBridge::CreateModel( |
91 const GURL& url) { | 99 const GURL& url) { |
92 DCHECK(thread_checker_.CalledOnValidThread()); | 100 DCHECK(thread_checker_.CalledOnValidThread()); |
93 std::unique_ptr<LinkHandlerModelImpl> impl( | 101 std::unique_ptr<LinkHandlerModelImpl> impl( |
94 new LinkHandlerModelImpl(icon_loader_)); | 102 new LinkHandlerModelImpl(icon_loader_)); |
95 if (!impl->Init(url)) | 103 if (!impl->Init(url)) |
96 return nullptr; | 104 return nullptr; |
97 return std::move(impl); | 105 return std::move(impl); |
98 } | 106 } |
99 | 107 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 const std::string& method_name_for_logging, | 166 const std::string& method_name_for_logging, |
159 uint32_t min_instance_version) { | 167 uint32_t min_instance_version) { |
160 return GetIntentHelperInstanceWithErrorCode(method_name_for_logging, | 168 return GetIntentHelperInstanceWithErrorCode(method_name_for_logging, |
161 min_instance_version, nullptr); | 169 min_instance_version, nullptr); |
162 } | 170 } |
163 | 171 |
164 void ArcIntentHelperBridge::OnIntentFiltersUpdated( | 172 void ArcIntentHelperBridge::OnIntentFiltersUpdated( |
165 std::vector<mojom::IntentFilterPtr> filters) { | 173 std::vector<mojom::IntentFilterPtr> filters) { |
166 DCHECK(thread_checker_.CalledOnValidThread()); | 174 DCHECK(thread_checker_.CalledOnValidThread()); |
167 activity_resolver_->UpdateIntentFilters(std::move(filters)); | 175 activity_resolver_->UpdateIntentFilters(std::move(filters)); |
| 176 |
| 177 for (auto& observer : observer_list_) |
| 178 observer.OnAppsUpdated(); |
168 } | 179 } |
169 | 180 |
170 } // namespace arc | 181 } // namespace arc |
OLD | NEW |