OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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_EXTENSIONS_API_MESSAGING_ARC_SUPPORT_HOST_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_MESSAGING_ARC_SUPPORT_HOST_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "chrome/browser/chromeos/arc/arc_auth_service.h" |
| 10 #include "extensions/browser/api/messaging/native_message_host.h" |
| 11 |
| 12 // Supports communication with Arc support dialog. |
| 13 class ArcSupportHost : public extensions::NativeMessageHost, |
| 14 public arc::ArcAuthService::Observer { |
| 15 public: |
| 16 static const char kHostName[]; |
| 17 static const char* const kHostOrigin[]; |
| 18 |
| 19 static scoped_ptr<NativeMessageHost> Create(); |
| 20 |
| 21 ~ArcSupportHost() override; |
| 22 |
| 23 // Overrides NativeMessageHost: |
| 24 void Start(Client* client) override; |
| 25 void OnMessage(const std::string& request_string) override; |
| 26 scoped_refptr<base::SingleThreadTaskRunner> task_runner() const override; |
| 27 |
| 28 // Overrides arc::ArcAuthService::Observer: |
| 29 void OnOptInUINeedToClose() override; |
| 30 |
| 31 private: |
| 32 // Unowned pointer. |
| 33 Client* client_ = nullptr; |
| 34 |
| 35 ArcSupportHost(); |
| 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(ArcSupportHost); |
| 38 }; |
| 39 |
| 40 #endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_ARC_SUPPORT_HOST_H_ |
OLD | NEW |