| 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/cookies_view.h" | 5 #include "chrome/browser/ui/views/options/cookies_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 views::View* CookiesView::GetContentsView() { | 170 views::View* CookiesView::GetContentsView() { |
| 171 return this; | 171 return this; |
| 172 } | 172 } |
| 173 | 173 |
| 174 /////////////////////////////////////////////////////////////////////////////// | 174 /////////////////////////////////////////////////////////////////////////////// |
| 175 // CookiesView, views::View overrides: | 175 // CookiesView, views::View overrides: |
| 176 | 176 |
| 177 void CookiesView::Layout() { | 177 void CookiesView::Layout() { |
| 178 // Lay out the Remove/Remove All buttons in the parent view. | 178 // Lay out the Remove/Remove All buttons in the parent view. |
| 179 gfx::Size ps = remove_button_->GetPreferredSize(); | 179 gfx::Size ps = remove_button_->GetPreferredSize(); |
| 180 gfx::Rect parent_bounds = GetParent()->GetLocalBounds(); | 180 gfx::Rect parent_bounds = GetParent()->GetContentsBounds(); |
| 181 int y_buttons = | 181 int y_buttons = |
| 182 parent_bounds.bottom() - ps.height() - views::kButtonVEdgeMargin; | 182 parent_bounds.bottom() - ps.height() - views::kButtonVEdgeMargin; |
| 183 | 183 |
| 184 remove_button_->SetBounds(kPanelHorizMargin, y_buttons, ps.width(), | 184 remove_button_->SetBounds(kPanelHorizMargin, y_buttons, ps.width(), |
| 185 ps.height()); | 185 ps.height()); |
| 186 | 186 |
| 187 ps = remove_all_button_->GetPreferredSize(); | 187 ps = remove_all_button_->GetPreferredSize(); |
| 188 int remove_all_x = remove_button_->x() + remove_button_->width() + | 188 int remove_all_x = remove_button_->x() + remove_button_->width() + |
| 189 kRelatedControlHorizontalSpacing; | 189 kRelatedControlHorizontalSpacing; |
| 190 remove_all_button_->SetBounds(remove_all_x, y_buttons, ps.width(), | 190 remove_all_button_->SetBounds(remove_all_x, y_buttons, ps.width(), |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 GetTotalNodeCount() > 1); | 393 GetTotalNodeCount() > 1); |
| 394 } | 394 } |
| 395 | 395 |
| 396 void CookiesView::UpdateVisibleDetailedInfo(views::View* view) { | 396 void CookiesView::UpdateVisibleDetailedInfo(views::View* view) { |
| 397 cookie_info_view_->SetVisible(view == cookie_info_view_); | 397 cookie_info_view_->SetVisible(view == cookie_info_view_); |
| 398 database_info_view_->SetVisible(view == database_info_view_); | 398 database_info_view_->SetVisible(view == database_info_view_); |
| 399 local_storage_info_view_->SetVisible(view == local_storage_info_view_); | 399 local_storage_info_view_->SetVisible(view == local_storage_info_view_); |
| 400 appcache_info_view_->SetVisible(view == appcache_info_view_); | 400 appcache_info_view_->SetVisible(view == appcache_info_view_); |
| 401 indexed_db_info_view_->SetVisible(view == indexed_db_info_view_); | 401 indexed_db_info_view_->SetVisible(view == indexed_db_info_view_); |
| 402 } | 402 } |
| OLD | NEW |