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

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: Remove resetPermission + Rebase Created 4 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 (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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 title_ids = kAccessedTitleIDs; 158 title_ids = kAccessedTitleIDs;
159 num_title_ids = arraysize(kAccessedTitleIDs); 159 num_title_ids = arraysize(kAccessedTitleIDs);
160 } 160 }
161 int title_id = GetIdForContentType(title_ids, num_title_ids, content_type()); 161 int title_id = GetIdForContentType(title_ids, num_title_ids, content_type());
162 if (title_id) 162 if (title_id)
163 set_title(l10n_util::GetStringUTF16(title_id)); 163 set_title(l10n_util::GetStringUTF16(title_id));
164 } 164 }
165 165
166 void ContentSettingSimpleBubbleModel::SetManageText() { 166 void ContentSettingSimpleBubbleModel::SetManageText() {
167 static const ContentSettingsTypeIdEntry kLinkIDs[] = { 167 static const ContentSettingsTypeIdEntry kLinkIDs[] = {
168 {CONTENT_SETTINGS_TYPE_COOKIES, IDS_BLOCKED_COOKIES_LINK}, 168 {CONTENT_SETTINGS_TYPE_COOKIES, IDS_BLOCKED_COOKIES_LINK},
169 {CONTENT_SETTINGS_TYPE_IMAGES, IDS_BLOCKED_IMAGES_LINK}, 169 {CONTENT_SETTINGS_TYPE_IMAGES, IDS_BLOCKED_IMAGES_LINK},
170 {CONTENT_SETTINGS_TYPE_JAVASCRIPT, IDS_BLOCKED_JAVASCRIPT_LINK}, 170 {CONTENT_SETTINGS_TYPE_JAVASCRIPT, IDS_BLOCKED_JAVASCRIPT_LINK},
171 {CONTENT_SETTINGS_TYPE_PLUGINS, IDS_BLOCKED_PLUGINS_LINK}, 171 {CONTENT_SETTINGS_TYPE_PLUGINS, IDS_BLOCKED_PLUGINS_LINK},
172 {CONTENT_SETTINGS_TYPE_POPUPS, IDS_BLOCKED_POPUPS_LINK}, 172 {CONTENT_SETTINGS_TYPE_POPUPS, IDS_BLOCKED_POPUPS_LINK},
173 {CONTENT_SETTINGS_TYPE_GEOLOCATION, IDS_GEOLOCATION_BUBBLE_MANAGE_LINK}, 173 {CONTENT_SETTINGS_TYPE_GEOLOCATION, IDS_GEOLOCATION_BUBBLE_MANAGE_LINK},
174 {CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, IDS_LEARN_MORE}, 174 {CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, IDS_LEARN_MORE},
175 {CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS, IDS_HANDLERS_BUBBLE_MANAGE_LINK}, 175 {CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS,
176 {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, IDS_PPAPI_BROKER_BUBBLE_MANAGE_LINK}, 176 IDS_HANDLERS_BUBBLE_MANAGE_LINK},
177 {CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, IDS_BLOCKED_DOWNLOADS_LINK}, 177 {CONTENT_SETTINGS_TYPE_PPAPI_BROKER, IDS_PPAPI_BROKER_BUBBLE_MANAGE_LINK},
178 {CONTENT_SETTINGS_TYPE_MIDI_SYSEX, IDS_MIDI_SYSEX_BUBBLE_MANAGE_LINK}, 178 {CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, IDS_BLOCKED_DOWNLOADS_LINK},
179 {CONTENT_SETTINGS_TYPE_MIDI_SYSEX, IDS_MIDI_SYSEX_BUBBLE_MANAGE_LINK},
180 {CONTENT_SETTINGS_TYPE_SENSORS, IDS_SENSORS_BUBBLE_MANAGE_LINK},
179 }; 181 };
180 set_manage_text(l10n_util::GetStringUTF8( 182 set_manage_text(l10n_util::GetStringUTF8(
181 GetIdForContentType(kLinkIDs, arraysize(kLinkIDs), content_type()))); 183 GetIdForContentType(kLinkIDs, arraysize(kLinkIDs), content_type())));
182 } 184 }
183 185
184 void ContentSettingSimpleBubbleModel::OnManageLinkClicked() { 186 void ContentSettingSimpleBubbleModel::OnManageLinkClicked() {
185 if (delegate()) 187 if (delegate())
186 delegate()->ShowContentSettingsPage(content_type()); 188 delegate()->ShowContentSettingsPage(content_type());
187 189
188 if (content_type() == CONTENT_SETTINGS_TYPE_PLUGINS) { 190 if (content_type() == CONTENT_SETTINGS_TYPE_PLUGINS) {
(...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1469 ContentSettingMediaStreamBubbleModel* 1471 ContentSettingMediaStreamBubbleModel*
1470 ContentSettingBubbleModel::AsMediaStreamBubbleModel() { 1472 ContentSettingBubbleModel::AsMediaStreamBubbleModel() {
1471 // In general, bubble models might not inherit from the media bubble model. 1473 // In general, bubble models might not inherit from the media bubble model.
1472 return nullptr; 1474 return nullptr;
1473 } 1475 }
1474 1476
1475 ContentSettingSubresourceFilterBubbleModel* 1477 ContentSettingSubresourceFilterBubbleModel*
1476 ContentSettingBubbleModel::AsSubresourceFilterBubbleModel() { 1478 ContentSettingBubbleModel::AsSubresourceFilterBubbleModel() {
1477 return nullptr; 1479 return nullptr;
1478 } 1480 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698