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

Side by Side Diff: chrome/browser/android/tab_android.h

Issue 2315323002: Pass JavaRef to WebContents::FromJavaWebContents. (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ 5 #ifndef CHROME_BROWSER_ANDROID_TAB_ANDROID_H_
6 #define CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ 6 #define CHROME_BROWSER_ANDROID_TAB_ANDROID_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <memory> 11 #include <memory>
12 12
13 #include "base/android/jni_weak_ref.h" 13 #include "base/android/jni_weak_ref.h"
14 #include "base/android/scoped_java_ref.h"
14 #include "base/callback_forward.h" 15 #include "base/callback_forward.h"
15 #include "base/macros.h" 16 #include "base/macros.h"
16 #include "base/strings/string16.h" 17 #include "base/strings/string16.h"
17 #include "chrome/browser/search/instant_service_observer.h" 18 #include "chrome/browser/search/instant_service_observer.h"
18 #include "chrome/browser/sync/glue/synced_tab_delegate_android.h" 19 #include "chrome/browser/sync/glue/synced_tab_delegate_android.h"
19 #include "chrome/browser/ui/search/search_tab_helper_delegate.h" 20 #include "chrome/browser/ui/search/search_tab_helper_delegate.h"
20 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" 21 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h"
21 #include "components/favicon/core/favicon_driver_observer.h" 22 #include "components/favicon/core/favicon_driver_observer.h"
22 #include "components/infobars/core/infobar_manager.h" 23 #include "components/infobars/core/infobar_manager.h"
23 #include "components/sessions/core/session_id.h" 24 #include "components/sessions/core/session_id.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 PARTIAL_PRERENDERED_PAGE_LOAD = 2, 77 PARTIAL_PRERENDERED_PAGE_LOAD = 2,
77 FULL_PRERENDERED_PAGE_LOAD = 3, 78 FULL_PRERENDERED_PAGE_LOAD = 3,
78 }; 79 };
79 80
80 // Convenience method to retrieve the Tab associated with the passed 81 // Convenience method to retrieve the Tab associated with the passed
81 // WebContents. Can return NULL. 82 // WebContents. Can return NULL.
82 static TabAndroid* FromWebContents(const content::WebContents* web_contents); 83 static TabAndroid* FromWebContents(const content::WebContents* web_contents);
83 84
84 // Returns the native TabAndroid stored in the Java Tab represented by 85 // Returns the native TabAndroid stored in the Java Tab represented by
85 // |obj|. 86 // |obj|.
86 static TabAndroid* GetNativeTab(JNIEnv* env, jobject obj); 87 static TabAndroid* GetNativeTab(JNIEnv* env,
88 const base::android::JavaRef<jobject>& obj);
87 89
88 // Function to attach helpers to the contentView. 90 // Function to attach helpers to the contentView.
89 static void AttachTabHelpers(content::WebContents* web_contents); 91 static void AttachTabHelpers(content::WebContents* web_contents);
90 92
91 TabAndroid(JNIEnv* env, jobject obj); 93 TabAndroid(JNIEnv* env, const base::android::JavaRef<jobject>& obj);
92 ~TabAndroid() override; 94 ~TabAndroid() override;
93 95
94 base::android::ScopedJavaLocalRef<jobject> GetJavaObject(); 96 base::android::ScopedJavaLocalRef<jobject> GetJavaObject();
95 97
96 // Return the WebContents, if any, currently owned by this TabAndroid. 98 // Return the WebContents, if any, currently owned by this TabAndroid.
97 content::WebContents* web_contents() const { return web_contents_.get(); } 99 content::WebContents* web_contents() const { return web_contents_.get(); }
98 100
99 // Return the BlimpContents, if any, currently owned by this TabAndroid. 101 // Return the BlimpContents, if any, currently owned by this TabAndroid.
100 blimp::client::BlimpContents* blimp_contents() const { 102 blimp::client::BlimpContents* blimp_contents() const {
101 return blimp_contents_.get(); 103 return blimp_contents_.get();
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 web_contents_delegate_; 302 web_contents_delegate_;
301 303
302 std::unique_ptr<blimp::client::BlimpContents> blimp_contents_; 304 std::unique_ptr<blimp::client::BlimpContents> blimp_contents_;
303 305
304 std::unique_ptr<browser_sync::SyncedTabDelegateAndroid> synced_tab_delegate_; 306 std::unique_ptr<browser_sync::SyncedTabDelegateAndroid> synced_tab_delegate_;
305 307
306 DISALLOW_COPY_AND_ASSIGN(TabAndroid); 308 DISALLOW_COPY_AND_ASSIGN(TabAndroid);
307 }; 309 };
308 310
309 #endif // CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ 311 #endif // CHROME_BROWSER_ANDROID_TAB_ANDROID_H_
OLDNEW
« no previous file with comments | « chrome/browser/android/find_in_page/find_in_page_bridge.cc ('k') | chrome/browser/android/tab_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698