Skip to content

Commit

Permalink
[Cros-SR Logging] Adds GetClient to AppListController interface
Browse files Browse the repository at this point in the history
Adds GetClient() method to AppListController interface that enables
us to notify Chrome from Ash side.
E.g. AppListController::Get()->GetClient()->SomeAction()

Bug: 972817
Change-Id: I3205848e152943295f070c1dfec499b85f3616b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1659664
Commit-Queue: Thanh Nguyen <thanhdng@chromium.org>
Reviewed-by: Jia Meng <jiameng@chromium.org>
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#669556}
  • Loading branch information
Thanh Nguyen authored and Commit Bot committed Jun 17, 2019
1 parent d585fa3 commit e38ced6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ash/app_list/app_list_controller_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ void AppListControllerImpl::SetClient(app_list::AppListClient* client) {
client_ = client;
}

app_list::AppListClient* AppListControllerImpl::GetClient() {
DCHECK(client_);
return client_;
}

app_list::AppListModel* AppListControllerImpl::GetModel() {
return model_.get();
}
Expand Down
1 change: 1 addition & 0 deletions ash/app_list/app_list_controller_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class ASH_EXPORT AppListControllerImpl

// app_list::AppListController:
void SetClient(app_list::AppListClient* client) override;
app_list::AppListClient* GetClient() override;
void AddItem(std::unique_ptr<ash::AppListItemMetadata> app_item) override;
void AddItemToFolder(std::unique_ptr<ash::AppListItemMetadata> app_item,
const std::string& folder_id) override;
Expand Down
3 changes: 3 additions & 0 deletions ash/public/cpp/app_list/app_list_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class ASH_PUBLIC_EXPORT AppListController {
// Sets a client to handle calls from Ash.
virtual void SetClient(AppListClient* client) = 0;

// Gets the client that handles calls from Ash.
virtual AppListClient* GetClient() = 0;

// Adds an item to AppListModel.
virtual void AddItem(std::unique_ptr<ash::AppListItemMetadata> app_item) = 0;

Expand Down

0 comments on commit e38ced6

Please sign in to comment.