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

Unified Diff: ash/sysui/app_list_presenter_mus.cc

Issue 2335833002: mash: Port ash_sysui app list presenter to mojo:ash. (Closed)
Patch Set: Reorder ShellDelegateMus members. Created 4 years, 3 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/sysui/app_list_presenter_mus.h ('k') | ash/sysui/manifest.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/sysui/app_list_presenter_mus.cc
diff --git a/ash/sysui/app_list_presenter_mus.cc b/ash/sysui/app_list_presenter_mus.cc
deleted file mode 100644
index fb86591de19a5e2d7e49285de6360d84375009e3..0000000000000000000000000000000000000000
--- a/ash/sysui/app_list_presenter_mus.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ash/sysui/app_list_presenter_mus.h"
-
-#include "services/shell/public/cpp/connector.h"
-
-namespace ash {
-namespace {
-
-// TODO(mfomitchev): Remove when http://crbug.com/607300 is fixed.
-// This method should not exist. Sys_ui has different display ids because it
-// uses ScreenAsh instead of ScreenMus.
-int64_t GetMusDisplayId(int64_t sysui_display_id) {
- return 1;
-}
-
-bool HasConnection(app_list::mojom::AppListPresenterPtr* interface_ptr) {
- return interface_ptr->is_bound() && !interface_ptr->encountered_error();
-}
-
-} // namespace
-
-AppListPresenterMus::AppListPresenterMus(::shell::Connector* connector)
- : connector_(connector) {
- ConnectIfNeeded();
-}
-
-AppListPresenterMus::~AppListPresenterMus() {}
-
-void AppListPresenterMus::Show(int64_t display_id) {
- display_id = GetMusDisplayId(display_id);
- presenter_->Show(display_id);
-}
-
-void AppListPresenterMus::Dismiss() {
- ConnectIfNeeded();
- presenter_->Dismiss();
-}
-
-void AppListPresenterMus::ToggleAppList(int64_t display_id) {
- display_id = GetMusDisplayId(display_id);
- ConnectIfNeeded();
- presenter_->ToggleAppList(display_id);
-}
-
-bool AppListPresenterMus::IsVisible() const {
- return false;
-}
-
-bool AppListPresenterMus::GetTargetVisibility() const {
- // TODO(mfomitchev): we have GetTargetVisibility() in mojom, but this
- // shouldn't be a synchronous method. We should go through the call sites and
- // either teach them to use a callback, or perhaps use a visibility observer.
- // NOTIMPLEMENTED();
- return false;
-}
-
-bool AppListPresenterMus::ConnectIfNeeded() {
- if (HasConnection(&presenter_))
- return true;
- connector_->ConnectToInterface("exe:chrome", &presenter_);
- CHECK(HasConnection(&presenter_))
- << "Could not connect to app_list::mojom::AppListPresenter.";
- return true;
-}
-
-} // namespace ash
« no previous file with comments | « ash/sysui/app_list_presenter_mus.h ('k') | ash/sysui/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698