 Chromium Code Reviews
 Chromium Code Reviews Issue 2743423004:
  Permissions: Show the reason for permission decisions made on the user's behalf.  (Closed)
    
  
    Issue 2743423004:
  Permissions: Show the reason for permission decisions made on the user's behalf.  (Closed) 
  | Index: chrome/browser/ui/views/page_info/permission_selector_row.cc | 
| diff --git a/chrome/browser/ui/views/page_info/permission_selector_row.cc b/chrome/browser/ui/views/page_info/permission_selector_row.cc | 
| index ac79ebc88ffa57a1b3482b3f99ebb98c1b888e19..3c665b485594c51e2f3c5f56d6d3262e0133de84 100644 | 
| --- a/chrome/browser/ui/views/page_info/permission_selector_row.cc | 
| +++ b/chrome/browser/ui/views/page_info/permission_selector_row.cc | 
| @@ -266,6 +266,21 @@ PermissionSelectorRow::PermissionSelectorRow( | 
| InitializeComboboxView(layout, permission); | 
| else | 
| InitializeMenuButtonView(layout, permission); | 
| + | 
| + // Show the permission decision reason, if it was not the user. | 
| + base::string16 reason = | 
| + PageInfoUI::PermissionDecisionReasonToUIString(profile, permission, url); | 
| + if (!reason.empty()) { | 
| + layout->StartRow(1, 1); | 
| + layout->SkipColumns(1); | 
| + views::Label* permission_decision_reason = new views::Label(reason); | 
| + permission_decision_reason->SetEnabledColor(SK_ColorGRAY); | 
| 
lgarron
2017/03/29 05:49:26
Note that "High Contrast Black" mode on Windows ha
 
Patti Lor
2017/03/30 03:27:29
No, they don't - there actually aren't any for non
 | 
| + // Long labels should span the remaining width of the row. | 
| + views::ColumnSet* column_set = layout->GetColumnSet(1); | 
| + DCHECK(!!column_set); | 
| 
lgarron
2017/03/29 05:49:26
More of a question for me to learn: Is this patter
 
Patti Lor
2017/03/30 03:27:29
Good point - I've seen it before but I don't think
 | 
| + layout->AddView(permission_decision_reason, column_set->num_columns() - 2, | 
| + 1, views::GridLayout::LEADING, views::GridLayout::CENTER); | 
| + } | 
| } | 
| void PermissionSelectorRow::AddObserver( |