0
Files
src/ash/note_taking_controller.h
Vladislav Kaznacheev 92edf62ebb Move note taking related methods out of PaletteDelegate
Create ash::NoteTakingController and have chromeos::NoteTakingHelper
communicate with it over mojo.

Bug: 773698
Test: ash_unittests --gtest_filter=CreateNoteTest.*
Change-Id: Ib41e9adc0d95624c450097c48d1c0779ed8ee763
Reviewed-on: https://chromium-review.googlesource.com/713195
Reviewed-by: James Cook <jamescook@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Jacob Dufault <jdufault@chromium.org>
Commit-Queue: Vladislav Kaznacheev <kaznacheev@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508837}
2017-10-13 22:08:01 +00:00

50 lines
1.3 KiB
C++

// Copyright 2017 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_NOTETAKING_CONTROLLER_H_
#define ASH_NOTETAKING_CONTROLLER_H_
#include "ash/ash_export.h"
#include "ash/public/interfaces/note_taking_controller.mojom.h"
#include "mojo/public/cpp/bindings/binding.h"
namespace ash {
// Controller for the note taking functionality.
class ASH_EXPORT NoteTakingController : public mojom::NoteTakingController {
public:
NoteTakingController();
~NoteTakingController() override;
void BindRequest(mojom::NoteTakingControllerRequest request);
// mojom::NoteTakingController:
void SetClient(mojom::NoteTakingControllerClientPtr client) override;
// Returns true if the client is attached.
bool CanCreateNote() const;
// Calls the method of the same name on |client_|.
void CreateNote();
private:
friend class TestNoteTakingControllerClient;
void OnClientConnectionLost();
void FlushMojoForTesting();
// Binding for mojom::NoteTakingController interface.
mojo::Binding<ash::mojom::NoteTakingController> binding_;
// Interface to NoteTaking controller client (chrome).
mojom::NoteTakingControllerClientPtr client_;
DISALLOW_COPY_AND_ASSIGN(NoteTakingController);
};
} // namespace ash
#endif // ASH_NOTETAKING_CONTROLLER_H_