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

Unified Diff: chrome/browser/ui/views/page_info/permission_selector_row.cc

Issue 2946323003: Page Info: Add brackets in to one line if and for statements (Closed)
Patch Set: Added "Page Info:", clarifying the scope of the change, into the commit message Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/page_info/page_info_bubble_view_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b9407fc410934fa49602ff028ea4697d54062f10..7f34132ef268ccb61428758f166ec384c7d0ad3d 100644
--- a/chrome/browser/ui/views/page_info/permission_selector_row.cc
+++ b/chrome/browser/ui/views/page_info/permission_selector_row.cc
@@ -209,15 +209,17 @@ PermissionCombobox::~PermissionCombobox() {}
void PermissionCombobox::UpdateSelectedIndex(bool use_default) {
int index = model_->GetCheckedIndex();
- if (use_default && index == -1)
+ if (use_default && index == -1) {
index = 0;
+ }
SetSelectedIndex(index);
}
void PermissionCombobox::OnPaintBorder(gfx::Canvas* canvas) {
// No border except a focus indicator for MD mode.
- if (ui::MaterialDesignController::IsSecondaryUiMaterial() && !HasFocus())
+ if (ui::MaterialDesignController::IsSecondaryUiMaterial() && !HasFocus()) {
return;
+ }
Combobox::OnPaintBorder(canvas);
}
@@ -262,10 +264,11 @@ PermissionSelectorRow::PermissionSelectorRow(
bool use_real_combobox =
ui::MaterialDesignController::IsSecondaryUiMaterial();
#endif
- if (use_real_combobox)
+ if (use_real_combobox) {
InitializeComboboxView(layout, permission);
- else
+ } else {
InitializeMenuButtonView(layout, permission);
+ }
// Show the permission decision reason, if it was not the user.
base::string16 reason =
@@ -300,8 +303,9 @@ PermissionSelectorRow::~PermissionSelectorRow() {
//
// Technically, the MenuButton has the same problem, but MenuButton doesn't
// use its model in its destructor.
- if (combobox_)
+ if (combobox_) {
combobox_->parent()->RemoveChildView(combobox_);
+ }
}
void PermissionSelectorRow::InitializeMenuButtonView(
@@ -356,8 +360,9 @@ void PermissionSelectorRow::PermissionChanged(
combobox_->UpdateSelectedIndex(use_default);
}
- for (PermissionSelectorRowObserver& observer : observer_list_)
+ for (PermissionSelectorRowObserver& observer : observer_list_) {
observer.OnPermissionChanged(permission);
+ }
}
views::View* PermissionSelectorRow::button() {
« no previous file with comments | « chrome/browser/ui/views/page_info/page_info_bubble_view_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698