Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: components/test_runner/app_banner_service.cc

Issue 2393513004: Convert app banners to use Mojo. (Closed)
Patch Set: Fix Win clang compile Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 #include "components/test_runner/app_banner_service.h"
6
7 namespace test_runner {
8
9 AppBannerService::AppBannerService(int request_id) : request_id_(request_id) {}
10
11 AppBannerService::~AppBannerService() {}
12
13 void AppBannerService::BindHandle(mojo::ScopedMessagePipeHandle handle) {
14 binding_.reset(new mojo::Binding<blink::mojom::AppBannerService>(
15 this,
16 mojo::MakeRequest<blink::mojom::AppBannerService>(std::move(handle))));
17 }
18
19 void AppBannerService::ResolvePromise(int request_id,
20 const std::string& platform) {
21 if (request_id != request_id_)
22 return;
23
24 // Empty platform means to resolve as a dismissal.
25 if (platform.empty())
26 (*event_)->BannerDismissed(request_id);
27 else
28 (*event_)->BannerAccepted(request_id, platform);
29 }
30
31 void AppBannerService::DisplayAppBanner(int request_id) {}
32
33 void AppBannerService::SetEvent(blink::mojom::AppBannerEventPtr event) {
34 event_.reset(new blink::mojom::AppBannerEventPtr(std::move(event)));
35 }
36
37 } // namespace test_runner
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698