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

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

Issue 1299513002: [Android] Add support for a hung renderer dialog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup Created 5 years, 4 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 9
10 #include "base/android/jni_weak_ref.h" 10 #include "base/android/jni_weak_ref.h"
11 #include "base/callback_forward.h" 11 #include "base/callback_forward.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/strings/string16.h" 13 #include "base/strings/string16.h"
14 #include "chrome/browser/search/instant_service_observer.h" 14 #include "chrome/browser/search/instant_service_observer.h"
15 #include "chrome/browser/sync/glue/synced_tab_delegate_android.h" 15 #include "chrome/browser/sync/glue/synced_tab_delegate_android.h"
16 #include "chrome/browser/ui/search/search_tab_helper_delegate.h" 16 #include "chrome/browser/ui/search/search_tab_helper_delegate.h"
17 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" 17 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h"
18 #include "components/favicon/core/favicon_driver_observer.h" 18 #include "components/favicon/core/favicon_driver_observer.h"
19 #include "components/infobars/core/infobar_manager.h"
19 #include "components/sessions/session_id.h" 20 #include "components/sessions/session_id.h"
20 #include "components/toolbar/toolbar_model.h" 21 #include "components/toolbar/toolbar_model.h"
21 #include "content/public/browser/notification_observer.h" 22 #include "content/public/browser/notification_observer.h"
22 #include "content/public/browser/notification_registrar.h" 23 #include "content/public/browser/notification_registrar.h"
23 24
24 class GURL; 25 class GURL;
25 class Profile; 26 class Profile;
26 class SkBitmap; 27 class SkBitmap;
27 28
28 namespace cc { 29 namespace cc {
29 class Layer; 30 class Layer;
30 } 31 }
31 32
32 namespace chrome { 33 namespace chrome {
33 struct NavigateParams; 34 struct NavigateParams;
34 } 35 }
35 36
36 namespace chrome { 37 namespace chrome {
37 namespace android { 38 namespace android {
38 class ChromeWebContentsDelegateAndroid; 39 class ChromeWebContentsDelegateAndroid;
39 class TabContentManager; 40 class TabContentManager;
40 } 41 }
41 } 42 }
42 43
43 namespace content { 44 namespace content {
44 class ContentViewCore; 45 class ContentViewCore;
45 class WebContents; 46 class WebContents;
46 } 47 }
47 48
49 namespace infobars {
50 class InfoBar;
51 }
52
48 namespace prerender { 53 namespace prerender {
49 class PrerenderManager; 54 class PrerenderManager;
50 } 55 }
51 56
52 class TabAndroid : public CoreTabHelperDelegate, 57 class TabAndroid : public CoreTabHelperDelegate,
53 public InstantServiceObserver, 58 public InstantServiceObserver,
54 public SearchTabHelperDelegate, 59 public SearchTabHelperDelegate,
55 public content::NotificationObserver, 60 public content::NotificationObserver,
56 public favicon::FaviconDriverObserver { 61 public favicon::FaviconDriverObserver,
62 public infobars::InfoBarManager::Observer {
57 public: 63 public:
58 // A Java counterpart will be generated for this enum. 64 // A Java counterpart will be generated for this enum.
59 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser 65 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser
60 enum TabLoadStatus { 66 enum TabLoadStatus {
61 PAGE_LOAD_FAILED = 0, 67 PAGE_LOAD_FAILED = 0,
62 DEFAULT_PAGE_LOAD = 1, 68 DEFAULT_PAGE_LOAD = 1,
63 PARTIAL_PRERENDERED_PAGE_LOAD = 2, 69 PARTIAL_PRERENDERED_PAGE_LOAD = 2,
64 FULL_PRERENDERED_PAGE_LOAD = 3, 70 FULL_PRERENDERED_PAGE_LOAD = 3,
65 }; 71 };
66 72
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 // NotificationObserver ----------------------------------------------------- 141 // NotificationObserver -----------------------------------------------------
136 void Observe(int type, 142 void Observe(int type,
137 const content::NotificationSource& source, 143 const content::NotificationSource& source,
138 const content::NotificationDetails& details) override; 144 const content::NotificationDetails& details) override;
139 145
140 // favicon::FaviconDriverObserver ------------------------------------------- 146 // favicon::FaviconDriverObserver -------------------------------------------
141 void OnFaviconAvailable(const gfx::Image& image) override; 147 void OnFaviconAvailable(const gfx::Image& image) override;
142 void OnFaviconUpdated(favicon::FaviconDriver* favicon_driver, 148 void OnFaviconUpdated(favicon::FaviconDriver* favicon_driver,
143 bool icon_url_changed) override; 149 bool icon_url_changed) override;
144 150
151 // Overriden from infobars::InfoBarManager::Observer:
gone 2015/08/18 20:45:17 nit: while you're here, could you make these obser
jdduke (slow) 2015/08/21 21:18:31 Done.
jdduke (slow) 2015/08/21 21:18:31 Done.
152 void OnInfoBarRemoved(infobars::InfoBar* infobar, bool animate) override;
153
145 // Methods called from Java via JNI ----------------------------------------- 154 // Methods called from Java via JNI -----------------------------------------
146 155
147 void Destroy(JNIEnv* env, jobject obj); 156 void Destroy(JNIEnv* env, jobject obj);
148 void InitWebContents(JNIEnv* env, 157 void InitWebContents(JNIEnv* env,
149 jobject obj, 158 jobject obj,
150 jboolean incognito, 159 jboolean incognito,
151 jobject jcontent_view_core, 160 jobject jcontent_view_core,
152 jobject jweb_contents_delegate, 161 jobject jweb_contents_delegate,
153 jobject jcontext_menu_populator); 162 jobject jcontext_menu_populator);
154 void DestroyWebContents(JNIEnv* env, jobject obj, jboolean delete_native); 163 void DestroyWebContents(JNIEnv* env, jobject obj, jboolean delete_native);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 jobject obj, 218 jobject obj,
210 jobject jcontent_view_core, 219 jobject jcontent_view_core,
211 jboolean visible); 220 jboolean visible);
212 221
213 void DetachOverlayContentViewCore(JNIEnv* env, 222 void DetachOverlayContentViewCore(JNIEnv* env,
214 jobject obj, 223 jobject obj,
215 jobject jcontent_view_core); 224 jobject jcontent_view_core);
216 225
217 bool HasPrerenderedUrl(JNIEnv* env, jobject obj, jstring url); 226 bool HasPrerenderedUrl(JNIEnv* env, jobject obj, jstring url);
218 227
228 void ShowHungRendererInfoBar(JNIEnv* env, jobject obj);
229 void DismissHungRendererInfoBar(JNIEnv* env, jobject obj);
230
219 // Register the Tab's native methods through JNI. 231 // Register the Tab's native methods through JNI.
220 static bool RegisterTabAndroid(JNIEnv* env); 232 static bool RegisterTabAndroid(JNIEnv* env);
221 233
222 private: 234 private:
223 prerender::PrerenderManager* GetPrerenderManager() const; 235 prerender::PrerenderManager* GetPrerenderManager() const;
224 236
225 JavaObjectWeakGlobalRef weak_java_tab_; 237 JavaObjectWeakGlobalRef weak_java_tab_;
226 238
227 // The identifier used by session restore for this tab. 239 // The identifier used by session restore for this tab.
228 SessionID session_tab_id_; 240 SessionID session_tab_id_;
229 241
230 // Identifier of the window the tab is in. 242 // Identifier of the window the tab is in.
231 SessionID session_window_id_; 243 SessionID session_window_id_;
232 244
233 content::NotificationRegistrar notification_registrar_; 245 content::NotificationRegistrar notification_registrar_;
234 246
235 scoped_refptr<cc::Layer> content_layer_; 247 scoped_refptr<cc::Layer> content_layer_;
236 chrome::android::TabContentManager* tab_content_manager_; 248 chrome::android::TabContentManager* tab_content_manager_;
237 249
238 scoped_ptr<content::WebContents> web_contents_; 250 scoped_ptr<content::WebContents> web_contents_;
239 scoped_ptr<chrome::android::ChromeWebContentsDelegateAndroid> 251 scoped_ptr<chrome::android::ChromeWebContentsDelegateAndroid>
240 web_contents_delegate_; 252 web_contents_delegate_;
241 253
242 scoped_ptr<browser_sync::SyncedTabDelegateAndroid> synced_tab_delegate_; 254 scoped_ptr<browser_sync::SyncedTabDelegateAndroid> synced_tab_delegate_;
243 255
256 // Transient InfoBar handle allowing dismissal of the hung renderer infobar
gone 2015/08/18 20:45:17 nit: grammar is weird
jdduke (slow) 2015/08/21 21:18:31 Done.
257 // when the renderer regains responsivesness.
258 infobars::InfoBar* hung_renderer_infobar_;
259
244 DISALLOW_COPY_AND_ASSIGN(TabAndroid); 260 DISALLOW_COPY_AND_ASSIGN(TabAndroid);
245 }; 261 };
246 262
247 #endif // CHROME_BROWSER_ANDROID_TAB_ANDROID_H_ 263 #endif // CHROME_BROWSER_ANDROID_TAB_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698