| 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/simple_content_exceptions_view.h" | 5 #include "chrome/browser/ui/views/options/simple_content_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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 default: | 63 default: |
| 64 NOTREACHED(); | 64 NOTREACHED(); |
| 65 } | 65 } |
| 66 } | 66 } |
| 67 | 67 |
| 68 void SimpleContentExceptionsView::Layout() { | 68 void SimpleContentExceptionsView::Layout() { |
| 69 views::NativeButton* buttons[] = { remove_button_, remove_all_button_ }; | 69 views::NativeButton* buttons[] = { remove_button_, remove_all_button_ }; |
| 70 | 70 |
| 71 // The buttons are placed in the parent, but we need to lay them out. | 71 // The buttons are placed in the parent, but we need to lay them out. |
| 72 int max_y = | 72 int max_y = |
| 73 GetParent()->GetLocalBounds().bottom() - views::kButtonVEdgeMargin; | 73 GetParent()->GetContentsBounds().bottom() - views::kButtonVEdgeMargin; |
| 74 int x = kPanelHorizMargin; | 74 int x = kPanelHorizMargin; |
| 75 | 75 |
| 76 for (size_t i = 0; i < arraysize(buttons); ++i) { | 76 for (size_t i = 0; i < arraysize(buttons); ++i) { |
| 77 gfx::Size pref = buttons[i]->GetPreferredSize(); | 77 gfx::Size pref = buttons[i]->GetPreferredSize(); |
| 78 buttons[i]->SetBounds(x, max_y - pref.height(), pref.width(), | 78 buttons[i]->SetBounds(x, max_y - pref.height(), pref.width(), |
| 79 pref.height()); | 79 pref.height()); |
| 80 x += pref.width() + kRelatedControlHorizontalSpacing; | 80 x += pref.width() + kRelatedControlHorizontalSpacing; |
| 81 } | 81 } |
| 82 | 82 |
| 83 // Lay out the rest of this view. | 83 // Lay out the rest of this view. |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 | 182 |
| 183 void SimpleContentExceptionsView::Remove() { | 183 void SimpleContentExceptionsView::Remove() { |
| 184 model_->RemoveRows(GetSelectedRows()); | 184 model_->RemoveRows(GetSelectedRows()); |
| 185 UpdateButtonState(); | 185 UpdateButtonState(); |
| 186 } | 186 } |
| 187 | 187 |
| 188 void SimpleContentExceptionsView::RemoveAll() { | 188 void SimpleContentExceptionsView::RemoveAll() { |
| 189 model_->RemoveAll(); | 189 model_->RemoveAll(); |
| 190 UpdateButtonState(); | 190 UpdateButtonState(); |
| 191 } | 191 } |
| OLD | NEW |