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

Side by Side Diff: chrome/browser/ui/views/options/simple_content_exceptions_view.cc

Issue 6462022: It turns out I had the sense of the GetLocalBounds bool wrong everywhere, so ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698