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

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

Issue 2393513004: Convert app banners to use Mojo. (Closed)
Patch Set: Rebase 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() : binding_(this) {}
10
11 AppBannerService::~AppBannerService() {}
12
13 mojo::ScopedMessagePipeHandle AppBannerService::GetEventHandle() {
14 return mojo::GetProxy(&event_).PassMessagePipe();
15 }
16
17 mojo::ScopedMessagePipeHandle AppBannerService::GetServiceHandle() {
18 return binding_.CreateInterfacePtrAndBind().PassInterface().PassHandle();
19 }
20
21 void AppBannerService::ResolvePromise(const std::string& platform) {
22 if (!event_.is_bound())
23 return;
24
25 // Empty platform means to resolve as a dismissal.
26 if (platform.empty())
27 event_->BannerDismissed();
28 else
29 event_->BannerAccepted(platform);
30 }
31
32 void AppBannerService::DisplayAppBanner() { /* do nothing */ }
33
34 } // namespace test_runner
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698