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

Unified Diff: ash/common/new_window_client_remote.h

Issue 2434463004: mash: Move directly linked NewWindowDelegate to mojom::NewWindowClient. (Closed)
Patch Set: Actually rename the browser test. Created 4 years, 2 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
Index: ash/common/new_window_client_remote.h
diff --git a/ash/common/new_window_client_remote.h b/ash/common/new_window_client_remote.h
new file mode 100644
index 0000000000000000000000000000000000000000..ae2ebd3c583edef80775a0e9219eaa21a3eeebcd
--- /dev/null
+++ b/ash/common/new_window_client_remote.h
@@ -0,0 +1,50 @@
+// 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.
+
+#ifndef ASH_COMMON_NEW_WINDOW_CLIENT_REMOTE_H_
+#define ASH_COMMON_NEW_WINDOW_CLIENT_REMOTE_H_
+
+#include "ash/public/interfaces/new_window.mojom.h"
+#include "base/macros.h"
+
+namespace service_manager {
+class Connector;
+}
+
+namespace ash {
+
+// A NewWindowClient which lazily connects to an exported mojom::NewWindowClient
+// in "service:content_browser" on first use.
+class NewWindowClientRemote : public mojom::NewWindowClient {
+ public:
+ NewWindowClientRemote(service_manager::Connector* connector);
James Cook 2016/10/21 22:22:30 nit: explicit
Elliot Glaysher 2016/10/21 22:45:56 Done.
+ ~NewWindowClientRemote() override;
+
+ // NewWindowClient:
+ void NewTab() override;
+ void NewWindow(bool incognito) override;
+ void OpenFileManager() override;
+ void OpenCrosh() override;
+ void OpenGetHelp() override;
+ void RestoreTab() override;
+ void ShowKeyboardOverlay() override;
+ void ShowTaskManager() override;
+ void OpenFeedbackPage() override;
+
+ private:
+ // Ensures that we have a valid |client_| before we try to use it.
+ void EnsureInterface();
+
+ // Clears |client_| when |client_| has a connection error.
+ void OnClientConnectionError();
+
+ service_manager::Connector* connector_;
+ mojom::NewWindowClientPtr client_;
+
+ DISALLOW_COPY_AND_ASSIGN(NewWindowClientRemote);
+};
+
+} // namespace ash
+
+#endif // ASH_COMMON_NEW_WINDOW_CLIENT_REMOTE_H_

Powered by Google App Engine
This is Rietveld 408576698