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

Unified Diff: chrome/renderer/installation_service_impl.cc

Issue 2379923002: Implement "appinstalled" event on Android. (Closed)
Patch Set: Minor refactor. 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
Index: chrome/renderer/installation_service_impl.cc
diff --git a/chrome/renderer/installation_service_impl.cc b/chrome/renderer/installation_service_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..be27a68498e96d283970aa4f40a8aefdc01634db
--- /dev/null
+++ b/chrome/renderer/installation_service_impl.cc
@@ -0,0 +1,30 @@
+// Copyright 2016 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/installation_service_impl.h"
+
+#include <utility>
+
+#include "base/memory/ptr_util.h"
+#include "content/public/renderer/render_frame.h"
+#include "mojo/public/cpp/bindings/strong_binding.h"
+#include "third_party/WebKit/public/web/WebLocalFrame.h"
+
+InstallationServiceImpl::InstallationServiceImpl(
+ content::RenderFrame* render_frame)
+ : render_frame_(render_frame) {}
+
+// static
+void InstallationServiceImpl::Create(
+ content::RenderFrame* render_frame,
+ blink::mojom::InstallationServiceRequest request) {
+ mojo::MakeStrongBinding(
+ base::MakeUnique<InstallationServiceImpl>(render_frame),
+ std::move(request));
+}
+
+void InstallationServiceImpl::OnInstall() {
+ blink::WebLocalFrame* frame = render_frame_->GetWebFrame();
+ frame->onAppInstalled();
+}

Powered by Google App Engine
This is Rietveld 408576698