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

Side by Side Diff: chrome/renderer/banners/app_banner_client.cc

Issue 1483903002: [App Banner] Use appropriate type parameters for WebCallbacks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « no previous file | components/test_runner/app_banner_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 "chrome/renderer/banners/app_banner_client.h" 5 #include "chrome/renderer/banners/app_banner_client.h"
6 6
7 #include "chrome/common/render_messages.h" 7 #include "chrome/common/render_messages.h"
8 #include "ipc/ipc_message.h" 8 #include "ipc/ipc_message.h"
9 #include "third_party/WebKit/public/platform/WebString.h" 9 #include "third_party/WebKit/public/platform/WebString.h"
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 void AppBannerClient::ResolveEvent( 47 void AppBannerClient::ResolveEvent(
48 int request_id, 48 int request_id,
49 const std::string& platform, 49 const std::string& platform,
50 const blink::WebAppBannerPromptResult::Outcome& outcome) { 50 const blink::WebAppBannerPromptResult::Outcome& outcome) {
51 blink::WebAppBannerCallbacks* callbacks = 51 blink::WebAppBannerCallbacks* callbacks =
52 banner_callbacks_.Lookup(request_id); 52 banner_callbacks_.Lookup(request_id);
53 if (!callbacks) 53 if (!callbacks)
54 return; 54 return;
55 55
56 scoped_ptr<blink::WebAppBannerPromptResult> result( 56 callbacks->onSuccess(blink::WebAppBannerPromptResult(
57 new blink::WebAppBannerPromptResult( 57 blink::WebString::fromUTF8(platform), outcome));
58 blink::WebString::fromUTF8(platform),
59 outcome));
60 callbacks->onSuccess(result.release());
61 banner_callbacks_.Remove(request_id); 58 banner_callbacks_.Remove(request_id);
62 } 59 }
63 60
64 void AppBannerClient::OnBannerAccepted(int request_id, 61 void AppBannerClient::OnBannerAccepted(int request_id,
65 const std::string& platform) { 62 const std::string& platform) {
66 ResolveEvent(request_id, platform, 63 ResolveEvent(request_id, platform,
67 blink::WebAppBannerPromptResult::Outcome::Accepted); 64 blink::WebAppBannerPromptResult::Outcome::Accepted);
68 } 65 }
69 66
70 void AppBannerClient::OnBannerDismissed(int request_id) { 67 void AppBannerClient::OnBannerDismissed(int request_id) {
71 ResolveEvent(request_id, "", 68 ResolveEvent(request_id, "",
72 blink::WebAppBannerPromptResult::Outcome::Dismissed); 69 blink::WebAppBannerPromptResult::Outcome::Dismissed);
73 } 70 }
OLDNEW
« no previous file with comments | « no previous file | components/test_runner/app_banner_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698