blob: 57fbb2c3b421946e9ec977eba711465f50b56de0 [file] [log] [blame]
// 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/ash_export.h"
#include "ash/public/interfaces/new_window.mojom.h"
#include "base/macros.h"
#include "mojo/public/cpp/bindings/associated_binding.h"
#include "mojo/public/cpp/bindings/binding_set.h"
#include "url/gurl.h"
namespace ash {
// Provides the NewWindowController interface to the outside world. This lets a
// consumer of ash provide a NewWindowClient, which we will dispatch to if one
// has been provided to us.
class ASH_EXPORT NewWindowController : public mojom::NewWindowController {
~NewWindowController() override;
void BindRequest(mojom::NewWindowControllerRequest request);
// NewWindowController:
void SetClient(mojom::NewWindowClientAssociatedPtrInfo client) override;
void ShowKeyboardOverlay() override;
void NewTabWithUrl(const GURL& url) override;
// Pass throughs for methods of the same name on |client_|.
void NewTab();
void NewWindow(bool incognito);
void OpenFileManager();
void OpenCrosh();
void OpenGetHelp();
void RestoreTab();
void ShowKeyboardShortcutViewer();
void ShowTaskManager();
void OpenFeedbackPage();
// More than one part of chrome may connect to call the mojo methods, so use
// BindingSet instead of Binding.
mojo::BindingSet<mojom::NewWindowController> bindings_;
mojom::NewWindowClientAssociatedPtr client_;
} // namespace ash