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

Side by Side Diff: chrome/browser/permissions/permission_update_infobar_delegate_android.cc

Issue 1520543004: Add method for identifying different InfoBars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing Created 5 years 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/permissions/permission_update_infobar_delegate_android. h" 5 #include "chrome/browser/permissions/permission_update_infobar_delegate_android. h"
6 6
7 #include "base/android/jni_array.h" 7 #include "base/android/jni_array.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "chrome/browser/android/preferences/pref_service_bridge.h" 10 #include "chrome/browser/android/preferences/pref_service_bridge.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 reinterpret_cast<intptr_t>(this), 141 reinterpret_cast<intptr_t>(this),
142 web_contents->GetJavaWebContents().obj(), 142 web_contents->GetJavaWebContents().obj(),
143 base::android::ToJavaArrayOfStrings(env, android_permissions_).obj())); 143 base::android::ToJavaArrayOfStrings(env, android_permissions_).obj()));
144 } 144 }
145 145
146 PermissionUpdateInfoBarDelegate::~PermissionUpdateInfoBarDelegate() { 146 PermissionUpdateInfoBarDelegate::~PermissionUpdateInfoBarDelegate() {
147 Java_PermissionUpdateInfoBarDelegate_onNativeDestroyed( 147 Java_PermissionUpdateInfoBarDelegate_onNativeDestroyed(
148 base::android::AttachCurrentThread(), java_delegate_.obj()); 148 base::android::AttachCurrentThread(), java_delegate_.obj());
149 } 149 }
150 150
151 std::string PermissionUpdateInfoBarDelegate::GetIdentifier() const {
152 return "PermissionUpdateInfoBarDelegate";
153 }
154
151 int PermissionUpdateInfoBarDelegate::GetIconId() const { 155 int PermissionUpdateInfoBarDelegate::GetIconId() const {
152 return IDR_INFOBAR_WARNING; 156 return IDR_INFOBAR_WARNING;
153 } 157 }
154 158
155 base::string16 PermissionUpdateInfoBarDelegate::GetMessageText() const { 159 base::string16 PermissionUpdateInfoBarDelegate::GetMessageText() const {
156 return l10n_util::GetStringUTF16(permission_msg_id_); 160 return l10n_util::GetStringUTF16(permission_msg_id_);
157 } 161 }
158 162
159 int PermissionUpdateInfoBarDelegate::GetButtons() const { 163 int PermissionUpdateInfoBarDelegate::GetButtons() const {
160 return BUTTON_OK; 164 return BUTTON_OK;
(...skipping 12 matching lines...) Expand all
173 } 177 }
174 178
175 bool PermissionUpdateInfoBarDelegate::Cancel() { 179 bool PermissionUpdateInfoBarDelegate::Cancel() {
176 base::ResetAndReturn(&callback_).Run(false); 180 base::ResetAndReturn(&callback_).Run(false);
177 return true; 181 return true;
178 } 182 }
179 183
180 void PermissionUpdateInfoBarDelegate::InfoBarDismissed() { 184 void PermissionUpdateInfoBarDelegate::InfoBarDismissed() {
181 base::ResetAndReturn(&callback_).Run(false); 185 base::ResetAndReturn(&callback_).Run(false);
182 } 186 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698