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

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

Issue 588583002: LocalSharedObjectsContainer: Separate object counting in an interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Just rebased Created 6 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/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"
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.h" 17 #include "chrome/browser/content_settings/cookie_settings.h"
18 #include "chrome/browser/content_settings/local_shared_objects_container.h"
19 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 18 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
20 #include "chrome/browser/infobars/infobar_service.h" 19 #include "chrome/browser/infobars/infobar_service.h"
21 #include "chrome/browser/profiles/profile.h" 20 #include "chrome/browser/profiles/profile.h"
22 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" 21 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h"
23 #include "chrome/browser/ui/views/constrained_window_views.h" 22 #include "chrome/browser/ui/views/constrained_window_views.h"
24 #include "chrome/browser/ui/views/cookie_info_view.h" 23 #include "chrome/browser/ui/views/cookie_info_view.h"
25 #include "chrome/common/pref_names.h" 24 #include "chrome/common/pref_names.h"
26 #include "chrome/grit/generated_resources.h" 25 #include "chrome/grit/generated_resources.h"
27 #include "chrome/grit/locale_settings.h" 26 #include "chrome/grit/locale_settings.h"
28 #include "content/public/browser/notification_details.h" 27 #include "content/public/browser/notification_details.h"
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 } 324 }
326 325
327 views::View* CollectedCookiesViews::CreateAllowedPane() { 326 views::View* CollectedCookiesViews::CreateAllowedPane() {
328 TabSpecificContentSettings* content_settings = 327 TabSpecificContentSettings* content_settings =
329 TabSpecificContentSettings::FromWebContents(web_contents_); 328 TabSpecificContentSettings::FromWebContents(web_contents_);
330 329
331 // Create the controls that go into the pane. 330 // Create the controls that go into the pane.
332 allowed_label_ = new views::Label(l10n_util::GetStringUTF16( 331 allowed_label_ = new views::Label(l10n_util::GetStringUTF16(
333 IDS_COLLECTED_COOKIES_ALLOWED_COOKIES_LABEL)); 332 IDS_COLLECTED_COOKIES_ALLOWED_COOKIES_LABEL));
334 333
335 const LocalSharedObjectsContainer& allowed_data = 334 allowed_cookies_tree_model_ =
336 content_settings->allowed_local_shared_objects(); 335 content_settings->CreateAllowedCookiesTreeModel();
337 allowed_cookies_tree_model_ = allowed_data.CreateCookiesTreeModel();
338 allowed_cookies_tree_ = new views::TreeView(); 336 allowed_cookies_tree_ = new views::TreeView();
339 allowed_cookies_tree_->SetModel(allowed_cookies_tree_model_.get()); 337 allowed_cookies_tree_->SetModel(allowed_cookies_tree_model_.get());
340 allowed_cookies_tree_->SetRootShown(false); 338 allowed_cookies_tree_->SetRootShown(false);
341 allowed_cookies_tree_->SetEditable(false); 339 allowed_cookies_tree_->SetEditable(false);
342 allowed_cookies_tree_->set_auto_expand_children(true); 340 allowed_cookies_tree_->set_auto_expand_children(true);
343 allowed_cookies_tree_->SetController(this); 341 allowed_cookies_tree_->SetController(this);
344 342
345 block_allowed_button_ = new views::LabelButton(this, 343 block_allowed_button_ = new views::LabelButton(this,
346 l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_BLOCK_BUTTON)); 344 l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_BLOCK_BUTTON));
347 block_allowed_button_->SetStyle(views::Button::STYLE_BUTTON); 345 block_allowed_button_->SetStyle(views::Button::STYLE_BUTTON);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 PrefService* prefs = profile->GetPrefs(); 397 PrefService* prefs = profile->GetPrefs();
400 398
401 // Create the controls that go into the pane. 399 // Create the controls that go into the pane.
402 blocked_label_ = new views::Label( 400 blocked_label_ = new views::Label(
403 l10n_util::GetStringUTF16( 401 l10n_util::GetStringUTF16(
404 prefs->GetBoolean(prefs::kBlockThirdPartyCookies) ? 402 prefs->GetBoolean(prefs::kBlockThirdPartyCookies) ?
405 IDS_COLLECTED_COOKIES_BLOCKED_THIRD_PARTY_BLOCKING_ENABLED : 403 IDS_COLLECTED_COOKIES_BLOCKED_THIRD_PARTY_BLOCKING_ENABLED :
406 IDS_COLLECTED_COOKIES_BLOCKED_COOKIES_LABEL)); 404 IDS_COLLECTED_COOKIES_BLOCKED_COOKIES_LABEL));
407 blocked_label_->SetMultiLine(true); 405 blocked_label_->SetMultiLine(true);
408 blocked_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); 406 blocked_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
409 const LocalSharedObjectsContainer& blocked_data = 407 blocked_cookies_tree_model_ =
410 content_settings->blocked_local_shared_objects(); 408 content_settings->CreateBlockedCookiesTreeModel();
411 blocked_cookies_tree_model_ = blocked_data.CreateCookiesTreeModel();
412 blocked_cookies_tree_ = new views::TreeView(); 409 blocked_cookies_tree_ = new views::TreeView();
413 blocked_cookies_tree_->SetModel(blocked_cookies_tree_model_.get()); 410 blocked_cookies_tree_->SetModel(blocked_cookies_tree_model_.get());
414 blocked_cookies_tree_->SetRootShown(false); 411 blocked_cookies_tree_->SetRootShown(false);
415 blocked_cookies_tree_->SetEditable(false); 412 blocked_cookies_tree_->SetEditable(false);
416 blocked_cookies_tree_->set_auto_expand_children(true); 413 blocked_cookies_tree_->set_auto_expand_children(true);
417 blocked_cookies_tree_->SetController(this); 414 blocked_cookies_tree_->SetController(this);
418 415
419 allow_blocked_button_ = new views::LabelButton(this, 416 allow_blocked_button_ = new views::LabelButton(this,
420 l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_ALLOW_BUTTON)); 417 l10n_util::GetStringUTF16(IDS_COLLECTED_COOKIES_ALLOW_BUTTON));
421 allow_blocked_button_->SetStyle(views::Button::STYLE_BUTTON); 418 allow_blocked_button_->SetStyle(views::Button::STYLE_BUTTON);
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 /////////////////////////////////////////////////////////////////////////////// 532 ///////////////////////////////////////////////////////////////////////////////
536 // CollectedCookiesViews, content::NotificationObserver implementation: 533 // CollectedCookiesViews, content::NotificationObserver implementation:
537 534
538 void CollectedCookiesViews::Observe( 535 void CollectedCookiesViews::Observe(
539 int type, 536 int type,
540 const content::NotificationSource& source, 537 const content::NotificationSource& source,
541 const content::NotificationDetails& details) { 538 const content::NotificationDetails& details) {
542 DCHECK_EQ(chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, type); 539 DCHECK_EQ(chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, type);
543 GetWidget()->Close(); 540 GetWidget()->Close();
544 } 541 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698