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..164495187a7ca3791d143ede2a9d7370b7241212 |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/arc/voice_interaction/arc_voice_interaction_arc_home_service.h |
| @@ -0,0 +1,43 @@ |
| +// 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 <memory> |
|
xiyuan
2017/04/03 19:01:07
not used?
Muyuan
2017/04/03 20:25:35
Done.
|
| + |
| +#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" |
| + |
| +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; |
| + void OnInstanceClosed() 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_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ArcVoiceInteractionArcHomeService); |
| +}; |
| + |
| +} // namespace arc |
| +#endif // CHROME_BROWSER_CHROMEOS_ARC_VOICE_INTERACTION_ARC_VOICE_INTERACTION_ARC_HOME_SERVICE_H_ |