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

Unified Diff: chrome/renderer/banners/app_banner_client.cc

Issue 2393513004: Convert app banners to use Mojo. (Closed)
Patch Set: Add TODO 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/banners/app_banner_client.h ('k') | chrome/renderer/chrome_content_renderer_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/banners/app_banner_client.cc
diff --git a/chrome/renderer/banners/app_banner_client.cc b/chrome/renderer/banners/app_banner_client.cc
deleted file mode 100644
index deec5d66bf8512e34b00bd3f420fee4f0825458d..0000000000000000000000000000000000000000
--- a/chrome/renderer/banners/app_banner_client.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/renderer/banners/app_banner_client.h"
-
-#include "chrome/common/render_messages.h"
-#include "ipc/ipc_message.h"
-#include "third_party/WebKit/public/platform/WebString.h"
-
-using blink::WebString;
-
-AppBannerClient::AppBannerClient(content::RenderFrame* render_frame)
- : content::RenderFrameObserver(render_frame) {
-}
-
-AppBannerClient::~AppBannerClient() {
-}
-
-void AppBannerClient::OnDestruct() {}
-
-bool AppBannerClient::OnMessageReceived(const IPC::Message& message) {
- bool handled = true;
- IPC_BEGIN_MESSAGE_MAP(AppBannerClient, message)
- IPC_MESSAGE_HANDLER(ChromeViewMsg_AppBannerAccepted, OnBannerAccepted);
- IPC_MESSAGE_HANDLER(ChromeViewMsg_AppBannerDismissed, OnBannerDismissed);
- IPC_MESSAGE_UNHANDLED(handled = false)
- IPC_END_MESSAGE_MAP()
- return handled;
-}
-
-void AppBannerClient::registerBannerCallbacks(
- int request_id,
- blink::WebAppBannerCallbacks* callbacks) {
- banner_callbacks_.AddWithID(callbacks, request_id);
-}
-
-void AppBannerClient::showAppBanner(int request_id) {
- Send(new ChromeViewHostMsg_RequestShowAppBanner(routing_id(), request_id));
-}
-
-void AppBannerClient::ResolveEvent(
- int request_id,
- const std::string& platform,
- const blink::WebAppBannerPromptResult::Outcome& outcome) {
- blink::WebAppBannerCallbacks* callbacks =
- banner_callbacks_.Lookup(request_id);
- if (!callbacks)
- return;
-
- callbacks->onSuccess(blink::WebAppBannerPromptResult(
- blink::WebString::fromUTF8(platform), outcome));
- banner_callbacks_.Remove(request_id);
-}
-
-void AppBannerClient::OnBannerAccepted(int request_id,
- const std::string& platform) {
- ResolveEvent(request_id, platform,
- blink::WebAppBannerPromptResult::Outcome::Accepted);
-}
-
-void AppBannerClient::OnBannerDismissed(int request_id) {
- ResolveEvent(request_id, "",
- blink::WebAppBannerPromptResult::Outcome::Dismissed);
-}
« no previous file with comments | « chrome/renderer/banners/app_banner_client.h ('k') | chrome/renderer/chrome_content_renderer_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698