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

Unified Diff: chrome/browser/android/shortcut_helper.cc

Issue 941633003: Remove unnessary usage of Tab.getNativePtr(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 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/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/shortcut_helper.cc
diff --git a/chrome/browser/android/shortcut_helper.cc b/chrome/browser/android/shortcut_helper.cc
index 2c94f34d404d9bdca556ac906cda9ba303d0e84a..4263ac914f67e4245cd1382db3af7dcd6e5aece2 100644
--- a/chrome/browser/android/shortcut_helper.cc
+++ b/chrome/browser/android/shortcut_helper.cc
@@ -16,7 +16,6 @@
#include "base/task/cancelable_task_tracker.h"
#include "base/threading/worker_pool.h"
#include "chrome/browser/android/manifest_icon_selector.h"
-#include "chrome/browser/android/tab_android.h"
#include "chrome/browser/banners/app_banner_settings_helper.h"
#include "chrome/browser/favicon/favicon_service.h"
#include "chrome/browser/favicon/favicon_service_factory.h"
@@ -46,11 +45,10 @@ using content::Manifest;
// http://developer.android.com/design/style/iconography.html
const int ShortcutHelper::kPreferredIconSizeInDp = 48;
-jlong Initialize(JNIEnv* env, jobject obj, jlong tab_android_ptr) {
- TabAndroid* tab = reinterpret_cast<TabAndroid*>(tab_android_ptr);
-
- ShortcutHelper* shortcut_helper =
- new ShortcutHelper(env, obj, tab->web_contents());
+jlong Initialize(JNIEnv* env, jobject obj, jobject java_web_contents) {
+ content::WebContents* web_contents =
+ content::WebContents::FromJavaWebContents(java_web_contents);
+ ShortcutHelper* shortcut_helper = new ShortcutHelper(env, obj, web_contents);
shortcut_helper->Initialize();
return reinterpret_cast<intptr_t>(shortcut_helper);
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/ShortcutHelper.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698