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

Unified Diff: ash/common/new_window_client_proxy.cc

Issue 2549903002: mash: Reverse the responsibilities of the NewWindowClient. (Closed)
Patch Set: jamescook comments 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/common/new_window_client_proxy.h ('k') | ash/common/new_window_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/new_window_client_proxy.cc
diff --git a/ash/common/new_window_client_proxy.cc b/ash/common/new_window_client_proxy.cc
deleted file mode 100644
index 42f0d3082745508fe63a1699171331c320481807..0000000000000000000000000000000000000000
--- a/ash/common/new_window_client_proxy.cc
+++ /dev/null
@@ -1,81 +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/common/new_window_client_proxy.h"
-
-#include "base/logging.h"
-#include "content/public/common/service_names.mojom.h"
-#include "services/service_manager/public/cpp/connector.h"
-
-namespace ash {
-
-NewWindowClientProxy::NewWindowClientProxy(
- service_manager::Connector* connector)
- : connector_(connector) {}
-
-NewWindowClientProxy::~NewWindowClientProxy() {}
-
-void NewWindowClientProxy::NewTab() {
- EnsureInterface();
- client_->NewTab();
-}
-
-void NewWindowClientProxy::NewWindow(bool incognito) {
- EnsureInterface();
- client_->NewWindow(incognito);
-}
-
-void NewWindowClientProxy::OpenFileManager() {
- EnsureInterface();
- client_->OpenFileManager();
-}
-
-void NewWindowClientProxy::OpenCrosh() {
- EnsureInterface();
- client_->OpenCrosh();
-}
-
-void NewWindowClientProxy::OpenGetHelp() {
- EnsureInterface();
- client_->OpenGetHelp();
-}
-
-void NewWindowClientProxy::RestoreTab() {
- EnsureInterface();
- client_->RestoreTab();
-}
-
-void NewWindowClientProxy::ShowKeyboardOverlay() {
- EnsureInterface();
- client_->ShowKeyboardOverlay();
-}
-
-void NewWindowClientProxy::ShowTaskManager() {
- EnsureInterface();
- client_->ShowTaskManager();
-}
-
-void NewWindowClientProxy::OpenFeedbackPage() {
- EnsureInterface();
- client_->OpenFeedbackPage();
-}
-
-void NewWindowClientProxy::EnsureInterface() {
- // |connector_| can be null in unit tests. We check this at first usage
- // instead of during construction because a NewWindowClientProxy is always
- // created and is then replaced with a mock in the unit tests.
- DCHECK(connector_);
-
- if (client_)
- return;
- connector_->ConnectToInterface(content::mojom::kBrowserServiceName, &client_);
- client_.set_connection_error_handler(base::Bind(
- &NewWindowClientProxy::OnClientConnectionError, base::Unretained(this)));
-}
-
-void NewWindowClientProxy::OnClientConnectionError() {
- client_.reset();
-}
-
-} // namespace ash
« no previous file with comments | « ash/common/new_window_client_proxy.h ('k') | ash/common/new_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698