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

Side by Side Diff: chrome/browser/chromeos/arc/arc_voice_interaction_service.h

Issue 2731403007: add voice interaction shortcut. (Closed)
Patch Set: removed debugging prints Created 3 years, 9 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 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 CHROME_BROWSER_CHROMEOS_ARC_ARC_VOICE_INTERACTION_SERVICE_H_
6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_VOICE_INTERACTION_SERVICE_H_
7
8 #include <memory>
9
10 #include "base/macros.h"
11 #include "components/arc/arc_service.h"
12 #include "components/arc/common/voice_interaction.mojom.h"
13 #include "mojo/public/cpp/bindings/binding.h"
14 #include "ui/base/accelerators/accelerator.h"
15
16 namespace arc {
17
18 // This provides voice interaction context (screenshots and view hierarchies)
19 // to Arc to be used by VoiceInteractionSession. This class Lives on the UI
Luis Héctor Chávez 2017/03/13 17:39:34 nit: ARC.
Muyuan 2017/03/14 01:38:14 Done.
20 // thread.
21 class ArcVoiceInteractionService : public ArcService,
22 public mojom::VoiceInteractionHost,
23 public ui::AcceleratorTarget {
24 public:
25 explicit ArcVoiceInteractionService(ArcBridgeService* bridge_service);
26 ~ArcVoiceInteractionService() override;
27
28 void OnCaptureInstanceReady();
29 void OnCaptureInstanceClosed();
30
31 void OnArcHomeInstanceReady();
32 void OnArcHomeInstanceClosed();
33
34 // ui::AcceleratorTarget overrides.
35 bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
36 bool CanHandleAccelerators() const override;
37
38 // mojom::VoiceInteractionHost overrides.
39 void GetVoiceInteractionStructure(
40 const GetVoiceInteractionStructureCallback& callback) override;
41 void CaptureFocusedWindow(
42 const CaptureFocusedWindowCallback& callback) override;
43
44 private:
45 class ArcHomeObserver;
46 class CaptureObserver;
47
48 std::unique_ptr<ArcHomeObserver> home_observer_;
49 std::unique_ptr<CaptureObserver> capture_observer_;
50
51 mojo::Binding<mojom::VoiceInteractionHost> home_binding_;
52 mojo::Binding<mojom::VoiceInteractionHost> capture_binding_;
53
54 DISALLOW_COPY_AND_ASSIGN(ArcVoiceInteractionService);
55 };
56
57 } // namespace arc
58 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_VOICE_INTERACTION_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698