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

Side by Side Diff: chrome/browser/ui/android/infobars/infobar_android.cc

Issue 26176007: [InfoBar] Always close native infobars from C++ (Part I) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 2 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/ui/android/infobars/infobar_android.h" 5 #include "chrome/browser/ui/android/infobars/infobar_android.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "chrome/browser/android/resource_mapper.h" 10 #include "chrome/browser/android/resource_mapper.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 JNIEnv* env = base::android::AttachCurrentThread(); 80 JNIEnv* env = base::android::AttachCurrentThread();
81 Java_InfoBar_closeInfoBar(env, java_info_bar_.obj()); 81 Java_InfoBar_closeInfoBar(env, java_info_bar_.obj());
82 } 82 }
83 } 83 }
84 84
85 int InfoBarAndroid::GetEnumeratedIconId() { 85 int InfoBarAndroid::GetEnumeratedIconId() {
86 DCHECK(delegate_); 86 DCHECK(delegate_);
87 return ResourceMapper::MapFromChromiumId(delegate_->GetIconID()); 87 return ResourceMapper::MapFromChromiumId(delegate_->GetIconID());
88 } 88 }
89 89
90 void InfoBarAndroid::CloseInfoBar() {
91 CloseJavaInfoBar();
92 if (owner())
93 RemoveSelf();
94 }
95
96 90
97 // Native JNI methods --------------------------------------------------------- 91 // Native JNI methods ---------------------------------------------------------
98 92
99 bool RegisterNativeInfoBar(JNIEnv* env) { 93 bool RegisterNativeInfoBar(JNIEnv* env) {
100 return RegisterNativesImpl(env); 94 return RegisterNativesImpl(env);
101 } 95 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/android/infobars/confirm_infobar.cc ('k') | chrome/browser/ui/android/infobars/translate_infobar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698