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/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 PrefService* prefs = profile->GetPrefs(); | 394 PrefService* prefs = profile->GetPrefs(); |
395 | 395 |
396 // Create the controls that go into the pane. | 396 // Create the controls that go into the pane. |
397 blocked_label_ = new views::Label( | 397 blocked_label_ = new views::Label( |
398 l10n_util::GetStringUTF16( | 398 l10n_util::GetStringUTF16( |
399 prefs->GetBoolean(prefs::kBlockThirdPartyCookies) ? | 399 prefs->GetBoolean(prefs::kBlockThirdPartyCookies) ? |
400 IDS_COLLECTED_COOKIES_BLOCKED_THIRD_PARTY_BLOCKING_ENABLED : | 400 IDS_COLLECTED_COOKIES_BLOCKED_THIRD_PARTY_BLOCKING_ENABLED : |
401 IDS_COLLECTED_COOKIES_BLOCKED_COOKIES_LABEL)); | 401 IDS_COLLECTED_COOKIES_BLOCKED_COOKIES_LABEL)); |
402 blocked_label_->SetMultiLine(true); | 402 blocked_label_->SetMultiLine(true); |
403 blocked_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 403 blocked_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 404 blocked_label_->SizeToFit(kTreeViewWidth); |
404 blocked_cookies_tree_model_ = | 405 blocked_cookies_tree_model_ = |
405 content_settings->CreateBlockedCookiesTreeModel(); | 406 content_settings->CreateBlockedCookiesTreeModel(); |
406 blocked_cookies_tree_ = new views::TreeView(); | 407 blocked_cookies_tree_ = new views::TreeView(); |
407 blocked_cookies_tree_->SetModel(blocked_cookies_tree_model_.get()); | 408 blocked_cookies_tree_->SetModel(blocked_cookies_tree_model_.get()); |
408 blocked_cookies_tree_->SetRootShown(false); | 409 blocked_cookies_tree_->SetRootShown(false); |
409 blocked_cookies_tree_->SetEditable(false); | 410 blocked_cookies_tree_->SetEditable(false); |
410 blocked_cookies_tree_->set_auto_expand_children(true); | 411 blocked_cookies_tree_->set_auto_expand_children(true); |
411 blocked_cookies_tree_->SetController(this); | 412 blocked_cookies_tree_->SetController(this); |
412 | 413 |
413 allow_blocked_button_ = new views::LabelButton(this, | 414 allow_blocked_button_ = new views::LabelButton(this, |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 /////////////////////////////////////////////////////////////////////////////// | 530 /////////////////////////////////////////////////////////////////////////////// |
530 // CollectedCookiesViews, content::NotificationObserver implementation: | 531 // CollectedCookiesViews, content::NotificationObserver implementation: |
531 | 532 |
532 void CollectedCookiesViews::Observe( | 533 void CollectedCookiesViews::Observe( |
533 int type, | 534 int type, |
534 const content::NotificationSource& source, | 535 const content::NotificationSource& source, |
535 const content::NotificationDetails& details) { | 536 const content::NotificationDetails& details) { |
536 DCHECK_EQ(chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, type); | 537 DCHECK_EQ(chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, type); |
537 GetWidget()->Close(); | 538 GetWidget()->Close(); |
538 } | 539 } |
OLD | NEW |