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

Unified Diff: chrome/browser/ui/android/bluetooth_chooser_android.cc

Issue 1672103002: Pass the frame instead of the WebContents through RunBluetoothChooser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@doc-bubble-lifetimes
Patch Set: Fix Android Created 4 years, 10 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/browser/ui/android/bluetooth_chooser_android.h ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/android/bluetooth_chooser_android.cc
diff --git a/chrome/browser/ui/android/bluetooth_chooser_android.cc b/chrome/browser/ui/android/bluetooth_chooser_android.cc
index 5094a9400f2828ed25928f4f1bd5d22cb75775df..bbc794a2ca6d5becb2daf879d506fcce3cf20253 100644
--- a/chrome/browser/ui/android/bluetooth_chooser_android.cc
+++ b/chrome/browser/ui/android/bluetooth_chooser_android.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/ssl/chrome_security_state_model_client.h"
#include "chrome/browser/ui/android/view_android_helper.h"
#include "content/public/browser/android/content_view_core.h"
+#include "content/public/browser/render_frame_host.h"
#include "jni/BluetoothChooserDialog_jni.h"
#include "ui/android/window_android.h"
#include "url/origin.h"
@@ -20,11 +21,13 @@ using base::android::ConvertUTF16ToJavaString;
using base::android::ScopedJavaLocalRef;
BluetoothChooserAndroid::BluetoothChooserAndroid(
- content::WebContents* web_contents,
- const EventHandler& event_handler,
- const url::Origin& origin)
+ content::RenderFrameHost* frame,
+ const EventHandler& event_handler)
: event_handler_(event_handler) {
+ const url::Origin origin = frame->GetLastCommittedOrigin();
DCHECK(!origin.unique());
+ content::WebContents* web_contents =
+ content::WebContents::FromRenderFrameHost(frame);
base::android::ScopedJavaLocalRef<jobject> window_android =
content::ContentViewCore::FromWebContents(
web_contents)->GetWindowAndroid()->GetJavaObject();
« no previous file with comments | « chrome/browser/ui/android/bluetooth_chooser_android.h ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698