Commit 4af2926f authored by yusukes's avatar yusukes Committed by Commit bot

Rename OnAppsUpdated to OnIntentFiltersUpdated

Previously, ArcIntentHelperBridge::OnIntentFiltersUpdated() called
OnAppsUpdated() for each observer, but this was probably just confusing.
This CL renames the observer method to fix the inconsistency and to
make it easier to maintain the ArcServiceManager::Observer interface.

This is a follow-up CL for
https://codereview.chromium.org/2487623002/.

BUG=672840
TEST=try

Review-Url: https://codereview.chromium.org/2579083002
Cr-Commit-Position: refs/heads/master@{#439008}
parent f3a1be2a
......@@ -401,7 +401,7 @@ EventRouter::EventRouter(Profile* profile)
EventRouter::~EventRouter() = default;
void EventRouter::OnAppsUpdated() {
void EventRouter::OnIntentFiltersUpdated() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
BroadcastEvent(profile_,
extensions::events::FILE_MANAGER_PRIVATE_ON_APPS_UPDATED,
......
......@@ -68,7 +68,7 @@ class EventRouter : public KeyedService,
~EventRouter() override;
// arc::ArcServiceManager::Observer overrides.
void OnAppsUpdated() override;
void OnIntentFiltersUpdated() override;
// KeyedService overrides.
void Shutdown() override;
......
......@@ -33,7 +33,7 @@ class ArcServiceManager::IntentHelperObserverImpl
~IntentHelperObserverImpl() override = default;
private:
void OnAppsUpdated() override;
void OnIntentFiltersUpdated() override;
ArcServiceManager* const manager_;
DISALLOW_COPY_AND_ASSIGN(IntentHelperObserverImpl);
......@@ -43,10 +43,10 @@ ArcServiceManager::IntentHelperObserverImpl::IntentHelperObserverImpl(
ArcServiceManager* manager)
: manager_(manager) {}
void ArcServiceManager::IntentHelperObserverImpl::OnAppsUpdated() {
void ArcServiceManager::IntentHelperObserverImpl::OnIntentFiltersUpdated() {
DCHECK(manager_->thread_checker_.CalledOnValidThread());
for (auto& observer : manager_->observer_list_)
observer.OnAppsUpdated();
observer.OnIntentFiltersUpdated();
}
ArcServiceManager::ArcServiceManager(
......
......@@ -28,8 +28,8 @@ class ArcServiceManager {
public:
class Observer {
public:
// Called when app's intent filter is updated.
virtual void OnAppsUpdated() = 0;
// Called when intent filters are added or removed.
virtual void OnIntentFiltersUpdated() = 0;
protected:
virtual ~Observer() = default;
......
......@@ -178,7 +178,7 @@ void ArcIntentHelperBridge::OnIntentFiltersUpdated(
activity_resolver_->UpdateIntentFilters(std::move(filters));
for (auto& observer : observer_list_)
observer.OnAppsUpdated();
observer.OnIntentFiltersUpdated();
}
} // namespace arc
......@@ -143,7 +143,7 @@ TEST_F(ArcIntentHelperTest, TestObserver) {
class FakeObserver : public ArcIntentHelperObserver {
public:
FakeObserver() = default;
void OnAppsUpdated() override { updated_ = true; }
void OnIntentFiltersUpdated() override { updated_ = true; }
bool IsUpdated() { return updated_; }
void Reset() { updated_ = false; }
......
......@@ -9,9 +9,9 @@ namespace arc {
class ArcIntentHelperObserver {
public:
// Called when app's intent filter is updated.
virtual void OnAppsUpdated() = 0;
virtual ~ArcIntentHelperObserver() = default;
// Called when intent filters are added or removed.
virtual void OnIntentFiltersUpdated() = 0;
};
} // namespace arc
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment