| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_WEBSHARE_SHARE_SERVICE_IMPL_H_ | 5 #ifndef CHROME_BROWSER_WEBSHARE_SHARE_SERVICE_IMPL_H_ |
| 6 #define CHROME_BROWSER_WEBSHARE_SHARE_SERVICE_IMPL_H_ | 6 #define CHROME_BROWSER_WEBSHARE_SHARE_SERVICE_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
| 13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
| 14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
| 15 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
| 16 #include "chrome/browser/ui/browser_dialogs.h" | 16 #include "chrome/browser/ui/browser_dialogs.h" |
| 17 #include "mojo/public/cpp/bindings/interface_request.h" | 17 #include "mojo/public/cpp/bindings/interface_request.h" |
| 18 #include "services/service_manager/public/cpp/bind_source_info.h" |
| 18 #include "third_party/WebKit/public/platform/modules/webshare/webshare.mojom.h" | 19 #include "third_party/WebKit/public/platform/modules/webshare/webshare.mojom.h" |
| 19 #include "third_party/WebKit/public/platform/site_engagement.mojom.h" | 20 #include "third_party/WebKit/public/platform/site_engagement.mojom.h" |
| 20 | 21 |
| 21 class DictionaryValue; | 22 class DictionaryValue; |
| 22 class GURL; | 23 class GURL; |
| 23 | 24 |
| 24 // Desktop implementation of the ShareService Mojo service. | 25 // Desktop implementation of the ShareService Mojo service. |
| 25 class ShareServiceImpl : public blink::mojom::ShareService { | 26 class ShareServiceImpl : public blink::mojom::ShareService { |
| 26 public: | 27 public: |
| 27 ShareServiceImpl(); | 28 ShareServiceImpl(); |
| 28 ~ShareServiceImpl() override; | 29 ~ShareServiceImpl() override; |
| 29 | 30 |
| 30 static void Create(mojo::InterfaceRequest<ShareService> request); | 31 static void Create(const service_manager::BindSourceInfo& source_info, |
| 32 mojo::InterfaceRequest<ShareService> request); |
| 31 | 33 |
| 32 // blink::mojom::ShareService overrides: | 34 // blink::mojom::ShareService overrides: |
| 33 void Share(const std::string& title, | 35 void Share(const std::string& title, |
| 34 const std::string& text, | 36 const std::string& text, |
| 35 const GURL& share_url, | 37 const GURL& share_url, |
| 36 const ShareCallback& callback) override; | 38 const ShareCallback& callback) override; |
| 37 | 39 |
| 38 private: | 40 private: |
| 39 FRIEND_TEST_ALL_PREFIXES(ShareServiceImplUnittest, ReplacePlaceholders); | 41 FRIEND_TEST_ALL_PREFIXES(ShareServiceImplUnittest, ReplacePlaceholders); |
| 40 | 42 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 const GURL& share_url, | 91 const GURL& share_url, |
| 90 const ShareCallback& callback, | 92 const ShareCallback& callback, |
| 91 const base::Optional<std::string>& result); | 93 const base::Optional<std::string>& result); |
| 92 | 94 |
| 93 base::WeakPtrFactory<ShareServiceImpl> weak_factory_; | 95 base::WeakPtrFactory<ShareServiceImpl> weak_factory_; |
| 94 | 96 |
| 95 DISALLOW_COPY_AND_ASSIGN(ShareServiceImpl); | 97 DISALLOW_COPY_AND_ASSIGN(ShareServiceImpl); |
| 96 }; | 98 }; |
| 97 | 99 |
| 98 #endif // CHROME_BROWSER_WEBSHARE_SHARE_SERVICE_IMPL_H_ | 100 #endif // CHROME_BROWSER_WEBSHARE_SHARE_SERVICE_IMPL_H_ |
| OLD | NEW |