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

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

Issue 211273007: Split InfoBarService core code into InfoBarManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix android compile Created 6 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 | Annotate | Revision Log
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 #include "chrome/browser/android/tab_android.h" 5 #include "chrome/browser/android/tab_android.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 bool did_start_load, 222 bool did_start_load,
223 bool did_finish_load) { 223 bool did_finish_load) {
224 JNIEnv* env = base::android::AttachCurrentThread(); 224 JNIEnv* env = base::android::AttachCurrentThread();
225 225
226 // We need to notify the native InfobarContainer so infobars can be swapped. 226 // We need to notify the native InfobarContainer so infobars can be swapped.
227 InfoBarContainerAndroid* infobar_container = 227 InfoBarContainerAndroid* infobar_container =
228 reinterpret_cast<InfoBarContainerAndroid*>( 228 reinterpret_cast<InfoBarContainerAndroid*>(
229 Java_Tab_getNativeInfoBarContainer( 229 Java_Tab_getNativeInfoBarContainer(
230 env, 230 env,
231 weak_java_tab_.get(env).obj())); 231 weak_java_tab_.get(env).obj()));
232 InfoBarService* new_infobar_service = new_contents ? 232 InfoBarManager* new_infobar_manager = NULL;
233 InfoBarService::FromWebContents(new_contents) : NULL; 233 if (new_contents) {
234 infobar_container->ChangeInfoBarService(new_infobar_service); 234 InfoBarService* new_infobar_service =
235 InfoBarService::FromWebContents(new_contents);
236 new_infobar_manager =
237 new_infobar_service ? new_infobar_service->infobar_manager() : NULL;
238 }
239 infobar_container->ChangeInfoBarManager(new_infobar_manager);
235 240
236 Java_Tab_swapWebContents( 241 Java_Tab_swapWebContents(
237 env, 242 env,
238 weak_java_tab_.get(env).obj(), 243 weak_java_tab_.get(env).obj(),
239 reinterpret_cast<intptr_t>(new_contents), 244 reinterpret_cast<intptr_t>(new_contents),
240 did_start_load, 245 did_start_load,
241 did_finish_load); 246 did_finish_load);
242 } 247 }
243 248
244 void TabAndroid::Observe(int type, 249 void TabAndroid::Observe(int type,
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 517
513 static void Init(JNIEnv* env, jobject obj) { 518 static void Init(JNIEnv* env, jobject obj) {
514 TRACE_EVENT0("native", "TabAndroid::Init"); 519 TRACE_EVENT0("native", "TabAndroid::Init");
515 // This will automatically bind to the Java object and pass ownership there. 520 // This will automatically bind to the Java object and pass ownership there.
516 new TabAndroid(env, obj); 521 new TabAndroid(env, obj);
517 } 522 }
518 523
519 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) { 524 bool TabAndroid::RegisterTabAndroid(JNIEnv* env) {
520 return RegisterNativesImpl(env); 525 return RegisterNativesImpl(env);
521 } 526 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698