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

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

Issue 2393513004: Convert app banners to use Mojo. (Closed)
Patch Set: Add TODO Created 4 years, 1 month 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
« no previous file with comments | « components/test_runner/app_banner_client.h ('k') | components/test_runner/app_banner_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 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_client.h"
6
7 #include "base/logging.h"
8 #include "third_party/WebKit/public/platform/modules/app_banner/WebAppBannerProm ptResult.h"
9
10 namespace test_runner {
11
12 AppBannerClient::AppBannerClient() {
13 }
14
15 AppBannerClient::~AppBannerClient() {
16 }
17
18 void AppBannerClient::registerBannerCallbacks(
19 int requestId,
20 blink::WebAppBannerCallbacks* callbacks) {
21 callbacks_map_.AddWithID(callbacks, requestId);
22 }
23
24 void AppBannerClient::ResolvePromise(int request_id,
25 const std::string& resolve_platform) {
26 blink::WebAppBannerCallbacks* callbacks = callbacks_map_.Lookup(request_id);
27 if (!callbacks)
28 return;
29
30 // If no platform has been set, treat it as dismissal.
31 callbacks->onSuccess(blink::WebAppBannerPromptResult(
32 blink::WebString::fromUTF8(resolve_platform),
33 resolve_platform.empty()
34 ? blink::WebAppBannerPromptResult::Outcome::Dismissed
35 : blink::WebAppBannerPromptResult::Outcome::Accepted));
36 callbacks_map_.Remove(request_id);
37 }
38
39 } // namespace test_runner
OLDNEW
« no previous file with comments | « components/test_runner/app_banner_client.h ('k') | components/test_runner/app_banner_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698