Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: components/arc/arc_service_manager.cc

Issue 2487623002: Notify Files App when ARC++ app is installed/removed (Closed)
Patch Set: Fixed BrowserTest.Title. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/arc_service_manager.h" 5 #include "components/arc/arc_service_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/sequenced_task_runner.h" 10 #include "base/sequenced_task_runner.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 ArcBridgeService* ArcServiceManager::arc_bridge_service() { 59 ArcBridgeService* ArcServiceManager::arc_bridge_service() {
60 DCHECK(thread_checker_.CalledOnValidThread()); 60 DCHECK(thread_checker_.CalledOnValidThread());
61 return arc_bridge_service_.get(); 61 return arc_bridge_service_.get();
62 } 62 }
63 63
64 void ArcServiceManager::AddService(std::unique_ptr<ArcService> service) { 64 void ArcServiceManager::AddService(std::unique_ptr<ArcService> service) {
65 DCHECK(thread_checker_.CalledOnValidThread()); 65 DCHECK(thread_checker_.CalledOnValidThread());
66 services_.emplace_back(std::move(service)); 66 services_.emplace_back(std::move(service));
67 } 67 }
68 68
69 void ArcServiceManager::AddObserver(Observer* observer) {
70 observer_list_.AddObserver(observer);
71 }
72
73 void ArcServiceManager::RemoveObserver(Observer* observer) {
74 observer_list_.RemoveObserver(observer);
75 }
76
77 void ArcServiceManager::OnAppsUpdated() {
78 for (auto& observer : observer_list_)
79 observer.OnAppsUpdated();
80 }
81
69 void ArcServiceManager::Shutdown() { 82 void ArcServiceManager::Shutdown() {
70 icon_loader_ = nullptr; 83 icon_loader_ = nullptr;
71 activity_resolver_ = nullptr; 84 activity_resolver_ = nullptr;
72 services_.clear(); 85 services_.clear();
73 arc_bridge_service_->OnShutdown(); 86 arc_bridge_service_->OnShutdown();
74 } 87 }
75 88
76 // static 89 // static
77 void ArcServiceManager::SetArcBridgeServiceForTesting( 90 void ArcServiceManager::SetArcBridgeServiceForTesting(
78 std::unique_ptr<ArcBridgeService> arc_bridge_service) { 91 std::unique_ptr<ArcBridgeService> arc_bridge_service) {
79 if (g_arc_bridge_service_for_testing) 92 if (g_arc_bridge_service_for_testing)
80 delete g_arc_bridge_service_for_testing; 93 delete g_arc_bridge_service_for_testing;
81 g_arc_bridge_service_for_testing = arc_bridge_service.release(); 94 g_arc_bridge_service_for_testing = arc_bridge_service.release();
82 } 95 }
83 96
84 } // namespace arc 97 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698