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

Side by Side Diff: chrome/browser/ui/views/collected_cookies_views.cc

Issue 2380943004: Merge LocalSharedObjectsContainer with LocalSharedObjectsCounter (Closed)
Patch Set: url -> origin Created 4 years, 2 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
OLDNEW
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"
11 #include "chrome/browser/browsing_data/browsing_data_database_helper.h" 11 #include "chrome/browser/browsing_data/browsing_data_database_helper.h"
12 #include "chrome/browser/browsing_data/browsing_data_file_system_helper.h" 12 #include "chrome/browser/browsing_data/browsing_data_file_system_helper.h"
13 #include "chrome/browser/browsing_data/browsing_data_indexed_db_helper.h" 13 #include "chrome/browser/browsing_data/browsing_data_indexed_db_helper.h"
14 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h" 14 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h"
15 #include "chrome/browser/browsing_data/cookies_tree_model.h" 15 #include "chrome/browser/browsing_data/cookies_tree_model.h"
16 #include "chrome/browser/chrome_notification_types.h" 16 #include "chrome/browser/chrome_notification_types.h"
17 #include "chrome/browser/content_settings/cookie_settings_factory.h" 17 #include "chrome/browser/content_settings/cookie_settings_factory.h"
18 #include "chrome/browser/content_settings/local_shared_objects_container.h"
18 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 19 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
19 #include "chrome/browser/infobars/infobar_service.h" 20 #include "chrome/browser/infobars/infobar_service.h"
20 #include "chrome/browser/profiles/profile.h" 21 #include "chrome/browser/profiles/profile.h"
21 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" 22 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h"
22 #include "chrome/browser/ui/views/cookie_info_view.h" 23 #include "chrome/browser/ui/views/cookie_info_view.h"
23 #include "chrome/common/pref_names.h" 24 #include "chrome/common/pref_names.h"
24 #include "chrome/grit/generated_resources.h" 25 #include "chrome/grit/generated_resources.h"
25 #include "chrome/grit/locale_settings.h" 26 #include "chrome/grit/locale_settings.h"
26 #include "chrome/grit/theme_resources.h" 27 #include "chrome/grit/theme_resources.h"
27 #include "components/constrained_window/constrained_window_views.h" 28 #include "components/constrained_window/constrained_window_views.h"
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 views::View* CollectedCookiesViews::CreateAllowedPane() { 328 views::View* CollectedCookiesViews::CreateAllowedPane() {
328 TabSpecificContentSettings* content_settings = 329 TabSpecificContentSettings* content_settings =
329 TabSpecificContentSettings::FromWebContents(web_contents_); 330 TabSpecificContentSettings::FromWebContents(web_contents_);
330 331
331 // Create the controls that go into the pane. 332 // Create the controls that go into the pane.
332 allowed_label_ = new views::Label(l10n_util::GetStringUTF16( 333 allowed_label_ = new views::Label(l10n_util::GetStringUTF16(
333 IDS_COLLECTED_COOKIES_ALLOWED_COOKIES_LABEL)); 334 IDS_COLLECTED_COOKIES_ALLOWED_COOKIES_LABEL));
334 allowed_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); 335 allowed_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
335 336
336 allowed_cookies_tree_model_ = 337 allowed_cookies_tree_model_ =
337 content_settings->CreateAllowedCookiesTreeModel(); 338 content_settings->allowed_local_shared_objects().CreateCookiesTreeModel();
338 allowed_cookies_tree_ = new views::TreeView(); 339 allowed_cookies_tree_ = new views::TreeView();
339 allowed_cookies_tree_->SetModel(allowed_cookies_tree_model_.get()); 340 allowed_cookies_tree_->SetModel(allowed_cookies_tree_model_.get());
340 allowed_cookies_tree_->SetRootShown(false); 341 allowed_cookies_tree_->SetRootShown(false);
341 allowed_cookies_tree_->SetEditable(false); 342 allowed_cookies_tree_->SetEditable(false);
342 allowed_cookies_tree_->set_auto_expand_children(true); 343 allowed_cookies_tree_->set_auto_expand_children(true);
343 allowed_cookies_tree_->SetController(this); 344 allowed_cookies_tree_->SetController(this);
344 345
345 block_allowed_button_ = views::MdTextButton::CreateSecondaryUiButton(this, 346 block_allowed_button_ = views::MdTextButton::CreateSecondaryUiButton(this,
346 l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_BLOCK_BUTTON)); 347 l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_BLOCK_BUTTON));
347 348
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 // Create the controls that go into the pane. 400 // Create the controls that go into the pane.
400 blocked_label_ = new views::Label( 401 blocked_label_ = new views::Label(
401 l10n_util::GetStringUTF16( 402 l10n_util::GetStringUTF16(
402 prefs->GetBoolean(prefs::kBlockThirdPartyCookies) ? 403 prefs->GetBoolean(prefs::kBlockThirdPartyCookies) ?
403 IDS_COLLECTED_COOKIES_BLOCKED_THIRD_PARTY_BLOCKING_ENABLED : 404 IDS_COLLECTED_COOKIES_BLOCKED_THIRD_PARTY_BLOCKING_ENABLED :
404 IDS_COLLECTED_COOKIES_BLOCKED_COOKIES_LABEL)); 405 IDS_COLLECTED_COOKIES_BLOCKED_COOKIES_LABEL));
405 blocked_label_->SetMultiLine(true); 406 blocked_label_->SetMultiLine(true);
406 blocked_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); 407 blocked_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
407 blocked_label_->SizeToFit(kTreeViewWidth); 408 blocked_label_->SizeToFit(kTreeViewWidth);
408 blocked_cookies_tree_model_ = 409 blocked_cookies_tree_model_ =
409 content_settings->CreateBlockedCookiesTreeModel(); 410 content_settings->blocked_local_shared_objects().CreateCookiesTreeModel();
410 blocked_cookies_tree_ = new views::TreeView(); 411 blocked_cookies_tree_ = new views::TreeView();
411 blocked_cookies_tree_->SetModel(blocked_cookies_tree_model_.get()); 412 blocked_cookies_tree_->SetModel(blocked_cookies_tree_model_.get());
412 blocked_cookies_tree_->SetRootShown(false); 413 blocked_cookies_tree_->SetRootShown(false);
413 blocked_cookies_tree_->SetEditable(false); 414 blocked_cookies_tree_->SetEditable(false);
414 blocked_cookies_tree_->set_auto_expand_children(true); 415 blocked_cookies_tree_->set_auto_expand_children(true);
415 blocked_cookies_tree_->SetController(this); 416 blocked_cookies_tree_->SetController(this);
416 417
417 allow_blocked_button_ = views::MdTextButton::CreateSecondaryUiButton( 418 allow_blocked_button_ = views::MdTextButton::CreateSecondaryUiButton(
418 this, l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_ALLOW_BUTTON)); 419 this, l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_ALLOW_BUTTON));
419 for_session_blocked_button_ = views::MdTextButton::CreateSecondaryUiButton( 420 for_session_blocked_button_ = views::MdTextButton::CreateSecondaryUiButton(
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 /////////////////////////////////////////////////////////////////////////////// 535 ///////////////////////////////////////////////////////////////////////////////
535 // CollectedCookiesViews, content::NotificationObserver implementation: 536 // CollectedCookiesViews, content::NotificationObserver implementation:
536 537
537 void CollectedCookiesViews::Observe( 538 void CollectedCookiesViews::Observe(
538 int type, 539 int type,
539 const content::NotificationSource& source, 540 const content::NotificationSource& source,
540 const content::NotificationDetails& details) { 541 const content::NotificationDetails& details) {
541 DCHECK_EQ(chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, type); 542 DCHECK_EQ(chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, type);
542 GetWidget()->Close(); 543 GetWidget()->Close();
543 } 544 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698