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

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

Issue 2341953004: Decouple MediaStreamInfoBarDelegate from GroupedPermissionInfoBarDelegate (Closed)
Patch Set: address review comments Created 4 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
« no previous file with comments | « chrome/browser/permissions/permission_infobar_delegate.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/permission_infobar.h" 5 #include "chrome/browser/ui/android/infobars/permission_infobar.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 base::android::ConvertUTF16ToJavaString(env, delegate->GetMessageText()); 48 base::android::ConvertUTF16ToJavaString(env, delegate->GetMessageText());
49 ScopedJavaLocalRef<jstring> link_text = 49 ScopedJavaLocalRef<jstring> link_text =
50 base::android::ConvertUTF16ToJavaString(env, delegate->GetLinkText()); 50 base::android::ConvertUTF16ToJavaString(env, delegate->GetLinkText());
51 51
52 ScopedJavaLocalRef<jobject> java_bitmap; 52 ScopedJavaLocalRef<jobject> java_bitmap;
53 if (delegate->GetIconId() == infobars::InfoBarDelegate::kNoIconID && 53 if (delegate->GetIconId() == infobars::InfoBarDelegate::kNoIconID &&
54 !delegate->GetIcon().IsEmpty()) { 54 !delegate->GetIcon().IsEmpty()) {
55 java_bitmap = gfx::ConvertToJavaBitmap(delegate->GetIcon().ToSkBitmap()); 55 java_bitmap = gfx::ConvertToJavaBitmap(delegate->GetIcon().ToSkBitmap());
56 } 56 }
57 57
58 std::vector<int> content_settings{delegate->content_setting()}; 58 std::vector<int> content_settings{delegate->content_settings()};
59 59
60 return Java_PermissionInfoBar_create( 60 return Java_PermissionInfoBar_create(
61 env, GetWindowAndroid().obj(), GetEnumeratedIconId(), java_bitmap.obj(), 61 env, GetWindowAndroid().obj(), GetEnumeratedIconId(), java_bitmap.obj(),
62 message_text.obj(), link_text.obj(), ok_button_text.obj(), 62 message_text.obj(), link_text.obj(), ok_button_text.obj(),
63 cancel_button_text.obj(), 63 cancel_button_text.obj(),
64 base::android::ToJavaIntArray(env, content_settings).obj(), 64 base::android::ToJavaIntArray(env, content_settings).obj(),
65 delegate->ShouldShowPersistenceToggle()); 65 delegate->ShouldShowPersistenceToggle());
66 } 66 }
67 67
68 void PermissionInfoBar::ProcessButton(int action) { 68 void PermissionInfoBar::ProcessButton(int action) {
69 // Check if the delegate asked us to display a persistence toggle. If so, 69 // Check if the delegate asked us to display a persistence toggle. If so,
70 // inform it of the toggle state. 70 // inform it of the toggle state.
71 PermissionInfoBarDelegate* delegate = GetDelegate(); 71 PermissionInfoBarDelegate* delegate = GetDelegate();
72 if (delegate->ShouldShowPersistenceToggle()) { 72 if (delegate->ShouldShowPersistenceToggle()) {
73 delegate->set_persist(Java_PermissionInfoBar_isPersistSwitchOn( 73 delegate->set_persist(Java_PermissionInfoBar_isPersistSwitchOn(
74 base::android::AttachCurrentThread(), GetJavaInfoBar())); 74 base::android::AttachCurrentThread(), GetJavaInfoBar()));
75 } 75 }
76 76
77 ConfirmInfoBar::ProcessButton(action); 77 ConfirmInfoBar::ProcessButton(action);
78 } 78 }
OLDNEW
« no previous file with comments | « chrome/browser/permissions/permission_infobar_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698