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

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

Issue 1747783002: CC Animation: Erase old animation system in Android Compositor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 9 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_array.h" 10 #include "base/android/jni_array.h"
11 #include "base/android/jni_string.h" 11 #include "base/android/jni_string.h"
12 #include "base/metrics/histogram.h" 12 #include "base/metrics/histogram.h"
13 #include "base/trace_event/trace_event.h" 13 #include "base/trace_event/trace_event.h"
14 #include "cc/layers/layer.h" 14 #include "cc/layers/layer.h"
15 #include "cc/layers/layer_settings.h"
15 #include "chrome/browser/android/compositor/tab_content_manager.h" 16 #include "chrome/browser/android/compositor/tab_content_manager.h"
16 #include "chrome/browser/android/metrics/uma_utils.h" 17 #include "chrome/browser/android/metrics/uma_utils.h"
17 #include "chrome/browser/android/offline_pages/offline_page_model_factory.h" 18 #include "chrome/browser/android/offline_pages/offline_page_model_factory.h"
18 #include "chrome/browser/android/offline_pages/offline_page_utils.h" 19 #include "chrome/browser/android/offline_pages/offline_page_utils.h"
19 #include "chrome/browser/android/tab_web_contents_delegate_android.h" 20 #include "chrome/browser/android/tab_web_contents_delegate_android.h"
20 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 21 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
21 #include "chrome/browser/bookmarks/managed_bookmark_service_factory.h" 22 #include "chrome/browser/bookmarks/managed_bookmark_service_factory.h"
22 #include "chrome/browser/browser_about_handler.h" 23 #include "chrome/browser/browser_about_handler.h"
23 #include "chrome/browser/chrome_notification_types.h" 24 #include "chrome/browser/chrome_notification_types.h"
24 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 25 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 } 115 }
115 116
116 void TabAndroid::AttachTabHelpers(content::WebContents* web_contents) { 117 void TabAndroid::AttachTabHelpers(content::WebContents* web_contents) {
117 DCHECK(web_contents); 118 DCHECK(web_contents);
118 119
119 TabHelpers::AttachTabHelpers(web_contents); 120 TabHelpers::AttachTabHelpers(web_contents);
120 } 121 }
121 122
122 TabAndroid::TabAndroid(JNIEnv* env, jobject obj) 123 TabAndroid::TabAndroid(JNIEnv* env, jobject obj)
123 : weak_java_tab_(env, obj), 124 : weak_java_tab_(env, obj),
124 content_layer_(cc::Layer::Create(content::Compositor::LayerSettings())), 125 content_layer_(cc::Layer::Create(cc::LayerSettings())),
125 tab_content_manager_(NULL), 126 tab_content_manager_(NULL),
126 synced_tab_delegate_(new browser_sync::SyncedTabDelegateAndroid(this)) { 127 synced_tab_delegate_(new browser_sync::SyncedTabDelegateAndroid(this)) {
127 Java_Tab_setNativePtr(env, obj, reinterpret_cast<intptr_t>(this)); 128 Java_Tab_setNativePtr(env, obj, reinterpret_cast<intptr_t>(this));
128 } 129 }
129 130
130 TabAndroid::~TabAndroid() { 131 TabAndroid::~TabAndroid() {
131 GetContentLayer()->RemoveAllChildren(); 132 GetContentLayer()->RemoveAllChildren();
132 JNIEnv* env = base::android::AttachCurrentThread(); 133 JNIEnv* env = base::android::AttachCurrentThread();
133 Java_Tab_clearNativePtr(env, weak_java_tab_.get(env).obj()); 134 Java_Tab_clearNativePtr(env, weak_java_tab_.get(env).obj());
134 } 135 }
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { 917 static void Init(JNIEnv* env, const JavaParamRef<jobject>& obj) {
917 TRACE_EVENT0("native", "TabAndroid::Init"); 918 TRACE_EVENT0("native", "TabAndroid::Init");
918 // This will automatically bind to the Java object and pass ownership there. 919 // This will automatically bind to the Java object and pass ownership there.
919 new TabAndroid(env, obj); 920 new TabAndroid(env, obj);
920 } 921 }
921 922
922 // static 923 // static
923 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { 924 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) {
924 return RegisterNativesImpl(env); 925 return RegisterNativesImpl(env);
925 } 926 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698