| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/views/options/exceptions_view.h" | 5 #include "chrome/browser/ui/views/options/exceptions_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 NOTREACHED(); | 77 NOTREACHED(); |
| 78 } | 78 } |
| 79 } | 79 } |
| 80 | 80 |
| 81 void ExceptionsView::Layout() { | 81 void ExceptionsView::Layout() { |
| 82 views::NativeButton* buttons[] = { add_button_, edit_button_, | 82 views::NativeButton* buttons[] = { add_button_, edit_button_, |
| 83 remove_button_, remove_all_button_ }; | 83 remove_button_, remove_all_button_ }; |
| 84 | 84 |
| 85 // The buttons are placed in the parent, but we need to lay them out. | 85 // The buttons are placed in the parent, but we need to lay them out. |
| 86 int max_y = | 86 int max_y = |
| 87 GetParent()->GetLocalBounds().bottom() - views::kButtonVEdgeMargin; | 87 GetParent()->GetContentsBounds().bottom() - views::kButtonVEdgeMargin; |
| 88 int x = kPanelHorizMargin; | 88 int x = kPanelHorizMargin; |
| 89 | 89 |
| 90 for (size_t i = 0; i < arraysize(buttons); ++i) { | 90 for (size_t i = 0; i < arraysize(buttons); ++i) { |
| 91 gfx::Size pref = buttons[i]->GetPreferredSize(); | 91 gfx::Size pref = buttons[i]->GetPreferredSize(); |
| 92 buttons[i]->SetBounds(x, max_y - pref.height(), pref.width(), | 92 buttons[i]->SetBounds(x, max_y - pref.height(), pref.width(), |
| 93 pref.height()); | 93 pref.height()); |
| 94 x += pref.width() + kRelatedControlHorizontalSpacing; | 94 x += pref.width() + kRelatedControlHorizontalSpacing; |
| 95 } | 95 } |
| 96 | 96 |
| 97 // Lay out the rest of this view. | 97 // Lay out the rest of this view. |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 } | 273 } |
| 274 | 274 |
| 275 UpdateButtonState(); | 275 UpdateButtonState(); |
| 276 } | 276 } |
| 277 | 277 |
| 278 void ExceptionsView::RemoveAll() { | 278 void ExceptionsView::RemoveAll() { |
| 279 model_.RemoveAll(); | 279 model_.RemoveAll(); |
| 280 | 280 |
| 281 UpdateButtonState(); | 281 UpdateButtonState(); |
| 282 } | 282 } |
| OLD | NEW |