blob: 5347f0c95f3bd4207eb7084ead8b32f00e983c48 [file] [log] [blame]
James Cookb0bf8e82017-04-09 17:01:441// Copyright 2016 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef ASH_NEW_WINDOW_CONTROLLER_H_
6#define ASH_NEW_WINDOW_CONTROLLER_H_
7
Evan Stadecae9d302017-10-03 18:52:318#include "ash/ash_export.h"
James Cookb0bf8e82017-04-09 17:01:449#include "ash/public/interfaces/new_window.mojom.h"
10#include "base/macros.h"
11#include "mojo/public/cpp/bindings/associated_binding.h"
James Cook3918d7bb622017-12-14 01:23:0512#include "mojo/public/cpp/bindings/binding_set.h"
James Cookb0bf8e82017-04-09 17:01:4413
14namespace ash {
15
16// Provides the NewWindowController interface to the outside world. This lets a
17// consumer of ash provide a NewWindowClient, which we will dispatch to if one
18// has been provided to us.
Evan Stadecae9d302017-10-03 18:52:3119class ASH_EXPORT NewWindowController : public mojom::NewWindowController {
James Cookb0bf8e82017-04-09 17:01:4420 public:
21 NewWindowController();
22 ~NewWindowController() override;
23
24 void BindRequest(mojom::NewWindowControllerRequest request);
25
James Cookb0bf8e82017-04-09 17:01:4426 // NewWindowController:
27 void SetClient(mojom::NewWindowClientAssociatedPtrInfo client) override;
Evan Stadecae9d302017-10-03 18:52:3128 void ShowKeyboardOverlay() override;
James Cookb0bf8e82017-04-09 17:01:4429
Evan Stadecae9d302017-10-03 18:52:3130 // Pass throughs for methods of the same name on |client_|.
31 void NewTab();
32 void NewWindow(bool incognito);
33 void OpenFileManager();
34 void OpenCrosh();
35 void OpenGetHelp();
36 void RestoreTab();
37 void ShowTaskManager();
38 void OpenFeedbackPage();
39
40 private:
James Cook3918d7bb622017-12-14 01:23:0541 // More than one part of chrome may connect to call the mojo methods, so use
42 // BindingSet instead of Binding. http://crbug.com/794581
43 mojo::BindingSet<mojom::NewWindowController> bindings_;
James Cookb0bf8e82017-04-09 17:01:4444
45 mojom::NewWindowClientAssociatedPtr client_;
46
47 DISALLOW_COPY_AND_ASSIGN(NewWindowController);
48};
49
50} // namespace ash
51
52#endif // ASH_NEW_WINDOW_CONTROLLER_H_