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 #include "components/test_runner/app_banner_service.h" | 5 #include "components/test_runner/app_banner_service.h" |
6 | 6 |
7 namespace test_runner { | 7 namespace test_runner { |
8 | 8 |
9 AppBannerService::AppBannerService() : binding_(this) {} | 9 AppBannerService::AppBannerService() : binding_(this) {} |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 event_->BannerAccepted(platform); | 21 event_->BannerAccepted(platform); |
22 } | 22 } |
23 | 23 |
24 void AppBannerService::SendBannerPromptRequest( | 24 void AppBannerService::SendBannerPromptRequest( |
25 const std::vector<std::string>& platforms, | 25 const std::vector<std::string>& platforms, |
26 const base::Callback<void(bool)>& callback) { | 26 const base::Callback<void(bool)>& callback) { |
27 if (!controller_.is_bound()) | 27 if (!controller_.is_bound()) |
28 return; | 28 return; |
29 | 29 |
30 controller_->BannerPromptRequest( | 30 controller_->BannerPromptRequest( |
31 binding_.CreateInterfacePtrAndBind(), mojo::GetProxy(&event_), platforms, | 31 binding_.CreateInterfacePtrAndBind(), mojo::MakeRequest(&event_), |
32 base::Bind(&AppBannerService::OnBannerPromptReply, base::Unretained(this), | 32 platforms, base::Bind(&AppBannerService::OnBannerPromptReply, |
33 callback)); | 33 base::Unretained(this), callback)); |
34 } | 34 } |
35 | 35 |
36 void AppBannerService::DisplayAppBanner() { /* do nothing */ } | 36 void AppBannerService::DisplayAppBanner() { /* do nothing */ } |
37 | 37 |
38 void AppBannerService::OnBannerPromptReply( | 38 void AppBannerService::OnBannerPromptReply( |
39 const base::Callback<void(bool)>& callback, | 39 const base::Callback<void(bool)>& callback, |
40 blink::mojom::AppBannerPromptReply reply, | 40 blink::mojom::AppBannerPromptReply reply, |
41 const std::string& referrer) { | 41 const std::string& referrer) { |
42 callback.Run(reply == blink::mojom::AppBannerPromptReply::CANCEL); | 42 callback.Run(reply == blink::mojom::AppBannerPromptReply::CANCEL); |
43 } | 43 } |
44 | 44 |
45 } // namespace test_runner | 45 } // namespace test_runner |
OLD | NEW |