| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/collected_cookies_views.h" | 5 #include "chrome/browser/ui/views/collected_cookies_views.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "chrome/browser/browsing_data/browsing_data_appcache_helper.h" | 8 #include "chrome/browser/browsing_data/browsing_data_appcache_helper.h" |
| 9 #include "chrome/browser/browsing_data/browsing_data_channel_id_helper.h" | 9 #include "chrome/browser/browsing_data/browsing_data_channel_id_helper.h" |
| 10 #include "chrome/browser/browsing_data/browsing_data_cookie_helper.h" | 10 #include "chrome/browser/browsing_data/browsing_data_cookie_helper.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 const int kCookieInfoBottomPadding = 4; | 68 const int kCookieInfoBottomPadding = 4; |
| 69 | 69 |
| 70 // Adds a ColumnSet to |layout| to hold two buttons with padding between. | 70 // Adds a ColumnSet to |layout| to hold two buttons with padding between. |
| 71 // Starts a new row with the added ColumnSet. | 71 // Starts a new row with the added ColumnSet. |
| 72 void StartNewButtonColumnSet(views::GridLayout* layout, | 72 void StartNewButtonColumnSet(views::GridLayout* layout, |
| 73 const int column_layout_id) { | 73 const int column_layout_id) { |
| 74 ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); | 74 ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); |
| 75 const int button_padding = | 75 const int button_padding = |
| 76 provider->GetDistanceMetric(views::DISTANCE_RELATED_BUTTON_HORIZONTAL); | 76 provider->GetDistanceMetric(views::DISTANCE_RELATED_BUTTON_HORIZONTAL); |
| 77 const int button_size_limit = | 77 const int button_size_limit = |
| 78 provider->GetDistanceMetric(DISTANCE_BUTTON_MAX_LINKABLE_WIDTH); | 78 provider->GetDistanceMetric(views::DISTANCE_BUTTON_MAX_LINKABLE_WIDTH); |
| 79 | 79 |
| 80 views::ColumnSet* column_set = layout->AddColumnSet(column_layout_id); | 80 views::ColumnSet* column_set = layout->AddColumnSet(column_layout_id); |
| 81 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, 0, | 81 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, 0, |
| 82 views::GridLayout::USE_PREF, 0, 0); | 82 views::GridLayout::USE_PREF, 0, 0); |
| 83 column_set->AddPaddingColumn(0, button_padding); | 83 column_set->AddPaddingColumn(0, button_padding); |
| 84 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, 0, | 84 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::CENTER, 0, |
| 85 views::GridLayout::USE_PREF, 0, 0); | 85 views::GridLayout::USE_PREF, 0, 0); |
| 86 column_set->LinkColumnSizes(0, 2, -1); | 86 column_set->LinkColumnSizes(0, 2, -1); |
| 87 column_set->set_linked_column_size_limit(button_size_limit); | 87 column_set->set_linked_column_size_limit(button_size_limit); |
| 88 layout->StartRow(0, column_layout_id); | 88 layout->StartRow(0, column_layout_id); |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 /////////////////////////////////////////////////////////////////////////////// | 544 /////////////////////////////////////////////////////////////////////////////// |
| 545 // CollectedCookiesViews, content::NotificationObserver implementation: | 545 // CollectedCookiesViews, content::NotificationObserver implementation: |
| 546 | 546 |
| 547 void CollectedCookiesViews::Observe( | 547 void CollectedCookiesViews::Observe( |
| 548 int type, | 548 int type, |
| 549 const content::NotificationSource& source, | 549 const content::NotificationSource& source, |
| 550 const content::NotificationDetails& details) { | 550 const content::NotificationDetails& details) { |
| 551 DCHECK_EQ(chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, type); | 551 DCHECK_EQ(chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, type); |
| 552 GetWidget()->Close(); | 552 GetWidget()->Close(); |
| 553 } | 553 } |
| OLD | NEW |