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

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

Issue 2833213002: DevTools: retain DTAH in all the targets to match their life time. (Closed)
Patch Set: for landing Created 3 years, 8 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #include "chrome/browser/android/tab_android.h" 5 #include "chrome/browser/android/tab_android.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 #include "components/navigation_interception/intercept_navigation_delegate.h" 58 #include "components/navigation_interception/intercept_navigation_delegate.h"
59 #include "components/navigation_interception/navigation_params.h" 59 #include "components/navigation_interception/navigation_params.h"
60 #include "components/offline_pages/core/offline_page_feature.h" 60 #include "components/offline_pages/core/offline_page_feature.h"
61 #include "components/offline_pages/core/offline_page_item.h" 61 #include "components/offline_pages/core/offline_page_item.h"
62 #include "components/offline_pages/core/offline_page_model.h" 62 #include "components/offline_pages/core/offline_page_model.h"
63 #include "components/sessions/content/content_live_tab.h" 63 #include "components/sessions/content/content_live_tab.h"
64 #include "components/sessions/core/tab_restore_service.h" 64 #include "components/sessions/core/tab_restore_service.h"
65 #include "components/url_formatter/url_fixer.h" 65 #include "components/url_formatter/url_fixer.h"
66 #include "content/public/browser/android/compositor.h" 66 #include "content/public/browser/android/compositor.h"
67 #include "content/public/browser/browser_thread.h" 67 #include "content/public/browser/browser_thread.h"
68 #include "content/public/browser/devtools_agent_host.h"
68 #include "content/public/browser/interstitial_page.h" 69 #include "content/public/browser/interstitial_page.h"
69 #include "content/public/browser/navigation_entry.h" 70 #include "content/public/browser/navigation_entry.h"
70 #include "content/public/browser/notification_service.h" 71 #include "content/public/browser/notification_service.h"
71 #include "content/public/browser/render_frame_host.h" 72 #include "content/public/browser/render_frame_host.h"
72 #include "content/public/browser/render_process_host.h" 73 #include "content/public/browser/render_process_host.h"
73 #include "content/public/browser/render_view_host.h" 74 #include "content/public/browser/render_view_host.h"
74 #include "content/public/browser/web_contents.h" 75 #include "content/public/browser/web_contents.h"
75 #include "content/public/common/browser_controls_state.h" 76 #include "content/public/common/browser_controls_state.h"
76 #include "content/public/common/resource_request_body.h" 77 #include "content/public/common/resource_request_body.h"
77 #include "jni/Tab_jni.h" 78 #include "jni/Tab_jni.h"
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 if (tab_content_manager == tab_content_manager_) 791 if (tab_content_manager == tab_content_manager_)
791 return; 792 return;
792 793
793 if (tab_content_manager_) 794 if (tab_content_manager_)
794 tab_content_manager_->DetachLiveLayer(GetAndroidId(), GetContentLayer()); 795 tab_content_manager_->DetachLiveLayer(GetAndroidId(), GetContentLayer());
795 tab_content_manager_ = tab_content_manager; 796 tab_content_manager_ = tab_content_manager;
796 if (tab_content_manager_) 797 if (tab_content_manager_)
797 tab_content_manager_->AttachLiveLayer(GetAndroidId(), GetContentLayer()); 798 tab_content_manager_->AttachLiveLayer(GetAndroidId(), GetContentLayer());
798 } 799 }
799 800
801 scoped_refptr<content::DevToolsAgentHost> TabAndroid::GetDevToolsAgentHost() {
802 return devtools_host_;
803 }
804
805 void TabAndroid::SetDevToolsAgentHost(
806 scoped_refptr<content::DevToolsAgentHost> host) {
807 devtools_host_ = host;
Bernhard Bauer 2017/04/24 12:16:57 std::move(host)?
808 }
809
800 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { 810 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) {
801 TRACE_EVENT0("native", "TabAndroid::Init"); 811 TRACE_EVENT0("native", "TabAndroid::Init");
802 // This will automatically bind to the Java object and pass ownership there. 812 // This will automatically bind to the Java object and pass ownership there.
803 new TabAndroid(env, obj); 813 new TabAndroid(env, obj);
804 } 814 }
805 815
806 // static 816 // static
807 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { 817 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) {
808 return RegisterNativesImpl(env); 818 return RegisterNativesImpl(env);
809 } 819 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698