Commit a109d28c authored by Shimi Zhang's avatar Shimi Zhang Committed by Commit Bot

Convert AssociatedInterfacePtr to AssociatedRemote in chrome/b/android

This is a followup of http://crrev/c/1685837. See more at
https://docs.google.com/document/d/1Jwfbzbe8ozaoilhqj5mAPYbYGpgZCen_XAAAdwmyP1E/edit

Bug: 955171
Change-Id: Ic99f1aa371144b568fbddf1e7cfb426dcbb6edd6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1787403Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Reviewed-by: default avatarOksana Zhuravlova <oksamyt@chromium.org>
Commit-Queue: Shimi Zhang <ctzsm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695434}
parent 40807bcc
......@@ -516,7 +516,7 @@ void TabAndroid::LoadOriginalImage(JNIEnv* env,
const JavaParamRef<jobject>& obj) {
content::RenderFrameHost* render_frame_host =
web_contents()->GetFocusedFrame();
chrome::mojom::ChromeRenderFrameAssociatedPtr renderer;
mojo::AssociatedRemote<chrome::mojom::ChromeRenderFrame> renderer;
render_frame_host->GetRemoteAssociatedInterfaces()->GetInterface(&renderer);
renderer->RequestReloadImageForContextNode();
}
......
......@@ -123,7 +123,7 @@ AddToHomescreenDataFetcher::AddToHomescreenDataFetcher(
DCHECK(shortcut_info_.url.is_valid());
// Send a message to the renderer to retrieve information about the page.
chrome::mojom::ChromeRenderFrameAssociatedPtr chrome_render_frame;
mojo::AssociatedRemote<chrome::mojom::ChromeRenderFrame> chrome_render_frame;
web_contents->GetMainFrame()->GetRemoteAssociatedInterfaces()->GetInterface(
&chrome_render_frame);
// Bind the InterfacePtr into the callback so that it's kept alive
......@@ -137,7 +137,8 @@ AddToHomescreenDataFetcher::AddToHomescreenDataFetcher(
AddToHomescreenDataFetcher::~AddToHomescreenDataFetcher() {}
void AddToHomescreenDataFetcher::OnDidGetWebApplicationInfo(
chrome::mojom::ChromeRenderFrameAssociatedPtr chrome_render_frame,
mojo::AssociatedRemote<chrome::mojom::ChromeRenderFrame>
chrome_render_frame,
const WebApplicationInfo& received_web_app_info) {
if (!web_contents())
return;
......
......@@ -16,6 +16,7 @@
#include "chrome/browser/android/shortcut_info.h"
#include "chrome/common/chrome_render_frame.mojom.h"
#include "content/public/browser/web_contents_observer.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
#include "third_party/skia/include/core/SkBitmap.h"
namespace favicon_base {
......@@ -59,7 +60,8 @@ class AddToHomescreenDataFetcher : public content::WebContentsObserver {
// IPC message received when the initialization is finished.
void OnDidGetWebApplicationInfo(
chrome::mojom::ChromeRenderFrameAssociatedPtr chrome_render_frame,
mojo::AssociatedRemote<chrome::mojom::ChromeRenderFrame>
chrome_render_frame,
const WebApplicationInfo& web_app_info);
// Accessors, etc.
......
......@@ -248,7 +248,9 @@ class AddToHomescreenDataFetcherTest : public ChromeRenderViewHostTestHarness {
WebApplicationInfo web_application_info;
web_application_info.title = base::UTF8ToUTF16(kWebApplicationInfoTitle);
fetcher->OnDidGetWebApplicationInfo(nullptr, web_application_info);
fetcher->OnDidGetWebApplicationInfo(
mojo::AssociatedRemote<chrome::mojom::ChromeRenderFrame>(),
web_application_info);
waiter.WaitForDataAvailable();
EXPECT_EQ(is_webapk_compatible, waiter.is_webapk_compatible());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment