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

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

Issue 2123863004: ScreenCapture for Android phase1, part II (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 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/permissions/grouped_permission_infobar_delegate.h" 5 #include "chrome/browser/permissions/grouped_permission_infobar_delegate.h"
6 #include "chrome/grit/generated_resources.h" 6 #include "chrome/grit/generated_resources.h"
7 #include "components/url_formatter/elide_url.h" 7 #include "components/url_formatter/elide_url.h"
8 #include "grit/theme_resources.h" 8 #include "grit/theme_resources.h"
9 #include "ui/base/l10n/l10n_util.h" 9 #include "ui/base/l10n/l10n_util.h"
10 10
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 return IDR_INFOBAR_MEDIA_STREAM_CAMERA; 64 return IDR_INFOBAR_MEDIA_STREAM_CAMERA;
65 } 65 }
66 return IDR_INFOBAR_WARNING; 66 return IDR_INFOBAR_WARNING;
67 } 67 }
68 68
69 base::string16 GroupedPermissionInfoBarDelegate::GetMessageTextFragment( 69 base::string16 GroupedPermissionInfoBarDelegate::GetMessageTextFragment(
70 int index) const { 70 int index) const {
71 DCHECK(index >= 0 && index < static_cast<int>(types_.size())); 71 DCHECK(index >= 0 && index < static_cast<int>(types_.size()));
72 ContentSettingsType type = types_[index]; 72 ContentSettingsType type = types_[index];
73 int message_id; 73 int message_id;
74 if (type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC) { 74 if (type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_SCREEN) {
75 message_id = IDS_MEDIA_CAPTURE_SCREEN_PERMISSION_FRAGMENT;
76 } else if (type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC) {
75 message_id = IDS_MEDIA_CAPTURE_AUDIO_ONLY_PERMISSION_FRAGMENT; 77 message_id = IDS_MEDIA_CAPTURE_AUDIO_ONLY_PERMISSION_FRAGMENT;
76 } else if (type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA) { 78 } else if (type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA) {
77 message_id = IDS_MEDIA_CAPTURE_VIDEO_ONLY_PERMISSION_FRAGMENT; 79 message_id = IDS_MEDIA_CAPTURE_VIDEO_ONLY_PERMISSION_FRAGMENT;
78 } else { 80 } else {
79 NOTREACHED(); 81 NOTREACHED();
80 return base::string16(); 82 return base::string16();
81 } 83 }
82 return l10n_util::GetStringUTF16(message_id); 84 return l10n_util::GetStringUTF16(message_id);
83 } 85 }
84 86
85 void GroupedPermissionInfoBarDelegate::ToggleAccept(int position, 87 void GroupedPermissionInfoBarDelegate::ToggleAccept(int position,
86 bool new_value) { 88 bool new_value) {
87 DCHECK(position >= 0 && position < static_cast<int>(types_.size())); 89 DCHECK(position >= 0 && position < static_cast<int>(types_.size()));
88 accept_states_[position] = new_value; 90 accept_states_[position] = new_value;
89 } 91 }
90 92
91 bool GroupedPermissionInfoBarDelegate::GetAcceptState(int position) { 93 bool GroupedPermissionInfoBarDelegate::GetAcceptState(int position) {
92 DCHECK(position >= 0 && position < static_cast<int>(types_.size())); 94 DCHECK(position >= 0 && position < static_cast<int>(types_.size()));
93 return accept_states_[position]; 95 return accept_states_[position];
94 } 96 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698