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

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

Powered by Google App Engine
This is Rietveld 408576698