Chromium Code Reviews| Index: chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_arc_home_service.h |
| diff --git a/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_arc_home_service.h b/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_arc_home_service.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1be5837c49d24e619caba34e4105a3ae20462fe9 |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_arc_home_service.h |
| @@ -0,0 +1,55 @@ |
| +// 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 CHROME_BROWSER_CHROMEOS_ARC_VOICE_INTERACTION_ARC_VOICE_INTERACTION_ARC_HOME_SERVICE_H_ |
| +#define CHROME_BROWSER_CHROMEOS_ARC_VOICE_INTERACTION_ARC_VOICE_INTERACTION_ARC_HOME_SERVICE_H_ |
| + |
| +#include "base/macros.h" |
| +#include "components/arc/arc_service.h" |
| +#include "components/arc/common/voice_interaction_arc_home.mojom.h" |
| +#include "components/arc/instance_holder.h" |
| +#include "mojo/public/cpp/bindings/binding.h" |
| +#include "ui/accessibility/ax_tree_update.h" |
| + |
| +namespace ui { |
| + |
|
Luis Héctor Chávez
2017/04/25 18:22:36
nit: typically fwd-declarations of this style don'
Muyuan
2017/04/25 19:38:13
Done.
|
| +struct AXSnapshotNodeAndroid; |
| + |
| +} // ui |
| + |
| +namespace arc { |
| + |
| +// ArcVoiceInteractionArcHomeService provides view hierarchy to to ARC to be |
| +// used by VoiceInteractionSession. This class lives on the UI thread. |
| +class ArcVoiceInteractionArcHomeService |
| + : public ArcService, |
| + public mojom::VoiceInteractionArcHomeHost, |
| + public InstanceHolder<mojom::VoiceInteractionArcHomeInstance>::Observer { |
| + public: |
| + explicit ArcVoiceInteractionArcHomeService(ArcBridgeService* bridge_service); |
| + ~ArcVoiceInteractionArcHomeService() override; |
| + |
| + // InstanceHolder<mojom::VoiceInteractionArcHomeInstance> overrides; |
| + void OnInstanceReady() override; |
| + |
| + // Gets view hierarchy from current focused app and send it to ARC. |
| + void GetVoiceInteractionStructure( |
| + const GetVoiceInteractionStructureCallback& callback) override; |
| + |
| + private: |
| + mojo::Binding<mojom::VoiceInteractionArcHomeHost> binding_; |
| + |
| + static mojom::VoiceInteractionStructurePtr CreateVoiceInteractionStructure( |
|
Luis Héctor Chávez
2017/04/25 18:22:36
it's better to move these private static methods t
Muyuan
2017/04/25 19:38:13
Done.
|
| + const ui::AXSnapshotNodeAndroid& view_structure); |
| + static void RequestVoiceInteractionStructureCallback( |
| + const base::Callback<void(mojom::VoiceInteractionStructurePtr)>& callback, |
|
Luis Héctor Chávez
2017/04/25 18:22:36
iwyu: #include "base/callback_forward.h"
Muyuan
2017/04/25 19:38:13
Done. Moved to anonymous namespace.
|
| + const ui::AXTreeUpdate& update); |
| + |
| + friend class ArcVoiceInteractionArcHomeServiceTest; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ArcVoiceInteractionArcHomeService); |
| +}; |
| + |
| +} // namespace arc |
| +#endif // CHROME_BROWSER_CHROMEOS_ARC_VOICE_INTERACTION_ARC_VOICE_INTERACTION_ARC_HOME_SERVICE_H_ |