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

Side by Side Diff: chrome/browser/ui/content_settings/content_setting_bubble_model.cc

Issue 2458453002: [sensors] Add Permission guard to the generic sensor apis.
Patch Set: rebase + blink reformat Created 3 years, 8 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 (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/ui/content_settings/content_setting_bubble_model.h" 5 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/feature_list.h" 10 #include "base/feature_list.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 title_ids = kAccessedTitleIDs; 163 title_ids = kAccessedTitleIDs;
164 num_title_ids = arraysize(kAccessedTitleIDs); 164 num_title_ids = arraysize(kAccessedTitleIDs);
165 } 165 }
166 int title_id = GetIdForContentType(title_ids, num_title_ids, content_type()); 166 int title_id = GetIdForContentType(title_ids, num_title_ids, content_type());
167 if (title_id) 167 if (title_id)
168 set_title(l10n_util::GetStringUTF16(title_id)); 168 set_title(l10n_util::GetStringUTF16(title_id));
169 } 169 }
170 170
171 void ContentSettingSimpleBubbleModel::SetManageText() { 171 void ContentSettingSimpleBubbleModel::SetManageText() {
172 static const ContentSettingsTypeIdEntry kLinkIDs[] = { 172 static const ContentSettingsTypeIdEntry kLinkIDs[] = {
173 {CONTENT_SETTINGS_TYPE_COOKIES, IDS_BLOCKED_COOKIES_LINK}, 173 {CONTENT_SETTINGS_TYPE_COOKIES, IDS_BLOCKED_COOKIES_LINK},
174 {CONTENT_SETTINGS_TYPE_IMAGES, IDS_BLOCKED_IMAGES_LINK}, 174 {CONTENT_SETTINGS_TYPE_IMAGES, IDS_BLOCKED_IMAGES_LINK},
175 {CONTENT_SETTINGS_TYPE_JAVASCRIPT, IDS_BLOCKED_JAVASCRIPT_LINK}, 175 {CONTENT_SETTINGS_TYPE_JAVASCRIPT, IDS_BLOCKED_JAVASCRIPT_LINK},
176 {CONTENT_SETTINGS_TYPE_PLUGINS, IDS_BLOCKED_PLUGINS_LINK}, 176 {CONTENT_SETTINGS_TYPE_PLUGINS, IDS_BLOCKED_PLUGINS_LINK},
177 {CONTENT_SETTINGS_TYPE_POPUPS, IDS_BLOCKED_POPUPS_LINK}, 177 {CONTENT_SETTINGS_TYPE_POPUPS, IDS_BLOCKED_POPUPS_LINK},
178 {CONTENT_SETTINGS_TYPE_GEOLOCATION, IDS_GEOLOCATION_BUBBLE_MANAGE_LINK}, 178 {CONTENT_SETTINGS_TYPE_GEOLOCATION, IDS_GEOLOCATION_BUBBLE_MANAGE_LINK},
179 {CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, IDS_LEARN_MORE}, 179 {CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, IDS_LEARN_MORE},
180 {CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS, IDS_HANDLERS_BUBBLE_MANAGE_LINK}, 180 {CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS,
181 {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, IDS_PPAPI_BROKER_BUBBLE_MANAGE_LINK}, 181 IDS_HANDLERS_BUBBLE_MANAGE_LINK},
182 {CONTENT_SETTINGS_TYPE_MIDI_SYSEX, IDS_MIDI_SYSEX_BUBBLE_MANAGE_LINK}, 182 {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, IDS_PPAPI_BROKER_BUBBLE_MANAGE_LINK},
183 {CONTENT_SETTINGS_TYPE_MIDI_SYSEX, IDS_MIDI_SYSEX_BUBBLE_MANAGE_LINK},
184 {CONTENT_SETTINGS_TYPE_SENSORS, IDS_SENSORS_BUBBLE_MANAGE_LINK},
183 }; 185 };
184 set_manage_text(l10n_util::GetStringUTF16( 186 set_manage_text(l10n_util::GetStringUTF16(
185 GetIdForContentType(kLinkIDs, arraysize(kLinkIDs), content_type()))); 187 GetIdForContentType(kLinkIDs, arraysize(kLinkIDs), content_type())));
186 } 188 }
187 189
188 void ContentSettingSimpleBubbleModel::OnManageLinkClicked() { 190 void ContentSettingSimpleBubbleModel::OnManageLinkClicked() {
189 if (delegate()) 191 if (delegate())
190 delegate()->ShowContentSettingsPage(content_type()); 192 delegate()->ShowContentSettingsPage(content_type());
191 193
192 if (content_type() == CONTENT_SETTINGS_TYPE_PLUGINS) { 194 if (content_type() == CONTENT_SETTINGS_TYPE_PLUGINS) {
(...skipping 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after
1599 1601
1600 ContentSettingSubresourceFilterBubbleModel* 1602 ContentSettingSubresourceFilterBubbleModel*
1601 ContentSettingBubbleModel::AsSubresourceFilterBubbleModel() { 1603 ContentSettingBubbleModel::AsSubresourceFilterBubbleModel() {
1602 return nullptr; 1604 return nullptr;
1603 } 1605 }
1604 1606
1605 ContentSettingDownloadsBubbleModel* 1607 ContentSettingDownloadsBubbleModel*
1606 ContentSettingBubbleModel::AsDownloadsBubbleModel() { 1608 ContentSettingBubbleModel::AsDownloadsBubbleModel() {
1607 return nullptr; 1609 return nullptr;
1608 } 1610 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698