Chromium Code Reviews| Index: chrome/browser/extensions/api/messaging/arc_opt_in_host.h |
| diff --git a/chrome/browser/extensions/api/messaging/arc_opt_in_host.h b/chrome/browser/extensions/api/messaging/arc_opt_in_host.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0eb72537d3a653c63390fad8ea4f771154d95304 |
| --- /dev/null |
| +++ b/chrome/browser/extensions/api/messaging/arc_opt_in_host.h |
| @@ -0,0 +1,43 @@ |
| +// Copyright 2016 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_EXTENSIONS_API_MESSAGING_ARC_OPT_IN_HOST_H_ |
| +#define CHROME_BROWSER_EXTENSIONS_API_MESSAGING_ARC_OPT_IN_HOST_H_ |
| + |
| +#include "base/macros.h" |
| +#include "base/thread_task_runner_handle.h" |
|
xiyuan
2016/02/11 17:57:20
move to cc file?
khmel
2016/02/12 02:45:23
Done.
|
| +#include "chrome/browser/chromeos/arc/arc_auth_service.h" |
| +#include "extensions/browser/api/messaging/native_message_host.h" |
| + |
| +// Supports communication with Arc OptIn dialog. |
| +class ArcOptInHost : public extensions::NativeMessageHost, |
| + public arc::ArcAuthService::Observer { |
| + public: |
| + static const char kHostName[]; |
| + static const char* const kHostOrigin[]; |
| + |
| + static scoped_ptr<NativeMessageHost> Create() { |
| + return scoped_ptr<NativeMessageHost>(new ArcOptInHost()); |
|
xiyuan
2016/02/11 17:57:20
Move impl to cc file.
khmel
2016/02/12 02:45:23
Done.
|
| + } |
| + |
| + ~ArcOptInHost() override; |
| + |
| + // Overrides NativeMessageHost: |
| + void Start(Client* client) override; |
| + void OnMessage(const std::string& request_string) override; |
| + scoped_refptr<base::SingleThreadTaskRunner> task_runner() const override; |
| + |
| + // Overrides arc::ArcAuthService::Observer: |
| + void OnOptInUINeedToClose() override; |
| + |
| + private: |
| + // Unowned pointer. |
| + Client* client_ = nullptr; |
| + |
| + ArcOptInHost(); |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ArcOptInHost); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_EXTENSIONS_API_MESSAGING_ARC_OPT_IN_HOST_H_ |