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

Side by Side Diff: chrome/browser/ui/website_settings/website_settings_ui.cc

Issue 620983002: Add Permissions to the PageInfo dialog on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@page_info_dialog_shell_only_v2
Patch Set: Final rebase Created 6 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/website_settings/website_settings_ui.h" 5 #include "chrome/browser/ui/website_settings/website_settings_ui.h"
6 6
7 #include "chrome/grit/chromium_strings.h" 7 #include "chrome/grit/chromium_strings.h"
8 #include "chrome/grit/generated_resources.h" 8 #include "chrome/grit/generated_resources.h"
9 #include "grit/theme_resources.h" 9 #include "grit/theme_resources.h"
10 #include "ui/base/l10n/l10n_util.h" 10 #include "ui/base/l10n/l10n_util.h"
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 250 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
251 return rb.GetNativeImageNamed(GetPermissionIconID(info.type, setting)); 251 return rb.GetNativeImageNamed(GetPermissionIconID(info.type, setting));
252 } 252 }
253 253
254 // static 254 // static
255 int WebsiteSettingsUI::GetIdentityIconID( 255 int WebsiteSettingsUI::GetIdentityIconID(
256 WebsiteSettings::SiteIdentityStatus status) { 256 WebsiteSettings::SiteIdentityStatus status) {
257 int resource_id = IDR_PAGEINFO_INFO; 257 int resource_id = IDR_PAGEINFO_INFO;
258 switch (status) { 258 switch (status) {
259 case WebsiteSettings::SITE_IDENTITY_STATUS_UNKNOWN: 259 case WebsiteSettings::SITE_IDENTITY_STATUS_UNKNOWN:
260 case WebsiteSettings::SITE_IDENTITY_STATUS_INTERNAL_PAGE:
260 break; 261 break;
261 case WebsiteSettings::SITE_IDENTITY_STATUS_CERT: 262 case WebsiteSettings::SITE_IDENTITY_STATUS_CERT:
262 case WebsiteSettings::SITE_IDENTITY_STATUS_EV_CERT: 263 case WebsiteSettings::SITE_IDENTITY_STATUS_EV_CERT:
263 resource_id = IDR_PAGEINFO_GOOD; 264 resource_id = IDR_PAGEINFO_GOOD;
264 break; 265 break;
265 case WebsiteSettings::SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN: 266 case WebsiteSettings::SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN:
266 resource_id = IDR_PAGEINFO_WARNING_MINOR; 267 resource_id = IDR_PAGEINFO_WARNING_MINOR;
267 break; 268 break;
268 case WebsiteSettings::SITE_IDENTITY_STATUS_NO_CERT: 269 case WebsiteSettings::SITE_IDENTITY_STATUS_NO_CERT:
269 resource_id = IDR_PAGEINFO_WARNING_MAJOR; 270 resource_id = IDR_PAGEINFO_WARNING_MAJOR;
(...skipping 20 matching lines...) Expand all
290 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 291 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
291 return rb.GetNativeImageNamed(GetIdentityIconID(status)); 292 return rb.GetNativeImageNamed(GetIdentityIconID(status));
292 } 293 }
293 294
294 // static 295 // static
295 int WebsiteSettingsUI::GetConnectionIconID( 296 int WebsiteSettingsUI::GetConnectionIconID(
296 WebsiteSettings::SiteConnectionStatus status) { 297 WebsiteSettings::SiteConnectionStatus status) {
297 int resource_id = IDR_PAGEINFO_INFO; 298 int resource_id = IDR_PAGEINFO_INFO;
298 switch (status) { 299 switch (status) {
299 case WebsiteSettings::SITE_CONNECTION_STATUS_UNKNOWN: 300 case WebsiteSettings::SITE_CONNECTION_STATUS_UNKNOWN:
301 case WebsiteSettings::SITE_CONNECTION_STATUS_INTERNAL_PAGE:
300 break; 302 break;
301 case WebsiteSettings::SITE_CONNECTION_STATUS_ENCRYPTED: 303 case WebsiteSettings::SITE_CONNECTION_STATUS_ENCRYPTED:
302 resource_id = IDR_PAGEINFO_GOOD; 304 resource_id = IDR_PAGEINFO_GOOD;
303 break; 305 break;
304 case WebsiteSettings::SITE_CONNECTION_STATUS_MIXED_CONTENT: 306 case WebsiteSettings::SITE_CONNECTION_STATUS_MIXED_CONTENT:
305 resource_id = IDR_PAGEINFO_WARNING_MINOR; 307 resource_id = IDR_PAGEINFO_WARNING_MINOR;
306 break; 308 break;
307 case WebsiteSettings::SITE_CONNECTION_STATUS_UNENCRYPTED: 309 case WebsiteSettings::SITE_CONNECTION_STATUS_UNENCRYPTED:
308 resource_id = IDR_PAGEINFO_WARNING_MAJOR; 310 resource_id = IDR_PAGEINFO_WARNING_MAJOR;
309 break; 311 break;
(...skipping 20 matching lines...) Expand all
330 // the first time. 332 // the first time.
331 return IDR_PAGEINFO_INFO; 333 return IDR_PAGEINFO_INFO;
332 } 334 }
333 335
334 // static 336 // static
335 const gfx::Image& WebsiteSettingsUI::GetFirstVisitIcon( 337 const gfx::Image& WebsiteSettingsUI::GetFirstVisitIcon(
336 const base::string16& first_visit) { 338 const base::string16& first_visit) {
337 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 339 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
338 return rb.GetNativeImageNamed(GetFirstVisitIconID(first_visit)); 340 return rb.GetNativeImageNamed(GetFirstVisitIconID(first_visit));
339 } 341 }
340
341 // static
342 int WebsiteSettingsUI::GetConnectionSummaryMessageID(
343 WebsiteSettings::SiteConnectionStatus status) {
344 switch (status) {
345 case WebsiteSettings::SITE_CONNECTION_STATUS_UNKNOWN:
346 return IDS_PAGE_INFO_UNENCRYPTED_CONNECTION_SUMMARY_TEXT;
347 case WebsiteSettings::SITE_CONNECTION_STATUS_ENCRYPTED:
348 return IDS_PAGE_INFO_ENCRYPTED_CONNECTION_SUMMARY_TEXT;
349 case WebsiteSettings::SITE_CONNECTION_STATUS_MIXED_CONTENT:
350 return IDS_PAGE_INFO_MIXED_CONTENT_CONNECTION_SUMMARY_TEXT;
351 case WebsiteSettings::SITE_CONNECTION_STATUS_UNENCRYPTED:
352 return IDS_PAGE_INFO_UNENCRYPTED_CONNECTION_SUMMARY_TEXT;
353 case WebsiteSettings::SITE_CONNECTION_STATUS_ENCRYPTED_ERROR:
354 return IDS_PAGE_INFO_UNENCRYPTED_CONNECTION_SUMMARY_TEXT;
355 case WebsiteSettings::SITE_CONNECTION_STATUS_INTERNAL_PAGE:
356 return IDS_PAGE_INFO_INTERNAL_PAGE;
357 default:
358 NOTREACHED();
359 return 0;
360 }
361 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698