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

Side by Side Diff: chrome/browser/ui/gtk/collected_cookies_gtk.cc

Issue 7713034: HostContentSettingsMap refactoring. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 4 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 | Annotate | Revision Log
OLDNEW
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/gtk/collected_cookies_gtk.h" 5 #include "chrome/browser/ui/gtk/collected_cookies_gtk.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "chrome/browser/content_settings/host_content_settings_map.h" 9 #include "chrome/browser/content_settings/host_content_settings_map.h"
10 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 10 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 // horizontal axis. 233 // horizontal axis.
234 GtkWidget* box = gtk_hbox_new(FALSE, 0); 234 GtkWidget* box = gtk_hbox_new(FALSE, 0);
235 gtk_box_pack_start(GTK_BOX(box), cookie_list_vbox, TRUE, TRUE, 235 gtk_box_pack_start(GTK_BOX(box), cookie_list_vbox, TRUE, TRUE,
236 gtk_util::kControlSpacing); 236 gtk_util::kControlSpacing);
237 return box; 237 return box;
238 } 238 }
239 239
240 GtkWidget* CollectedCookiesGtk::CreateBlockedPane() { 240 GtkWidget* CollectedCookiesGtk::CreateBlockedPane() {
241 TabContentsWrapper* wrapper = 241 TabContentsWrapper* wrapper =
242 TabContentsWrapper::GetCurrentWrapperForContents(tab_contents_); 242 TabContentsWrapper::GetCurrentWrapperForContents(tab_contents_);
243 HostContentSettingsMap* host_content_settings_map = 243 CookieContentSettings* cookie_content_settings =
244 wrapper->profile()->GetHostContentSettingsMap(); 244 wrapper->profile()->GetCookieContentSettings();
245 245
246 GtkWidget* cookie_list_vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing); 246 GtkWidget* cookie_list_vbox = gtk_vbox_new(FALSE, gtk_util::kControlSpacing);
247 247
248 GtkWidget* label = gtk_label_new( 248 GtkWidget* label = gtk_label_new(
249 l10n_util::GetStringUTF8( 249 l10n_util::GetStringUTF8(
250 host_content_settings_map->BlockThirdPartyCookies() ? 250 cookie_content_settings->BlockThirdPartyCookies() ?
251 IDS_COLLECTED_COOKIES_BLOCKED_THIRD_PARTY_BLOCKING_ENABLED : 251 IDS_COLLECTED_COOKIES_BLOCKED_THIRD_PARTY_BLOCKING_ENABLED :
252 IDS_COLLECTED_COOKIES_BLOCKED_COOKIES_LABEL).c_str()); 252 IDS_COLLECTED_COOKIES_BLOCKED_COOKIES_LABEL).c_str());
253 gtk_widget_set_size_request(label, kTreeViewWidth, -1); 253 gtk_widget_set_size_request(label, kTreeViewWidth, -1);
254 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); 254 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
255 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5); 255 gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
256 gtk_box_pack_start(GTK_BOX(cookie_list_vbox), label, TRUE, TRUE, 256 gtk_box_pack_start(GTK_BOX(cookie_list_vbox), label, TRUE, TRUE,
257 gtk_util::kControlSpacing); 257 gtk_util::kControlSpacing);
258 258
259 GtkWidget* scroll_window = gtk_scrolled_window_new(NULL, NULL); 259 GtkWidget* scroll_window = gtk_scrolled_window_new(NULL, NULL);
260 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll_window), 260 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll_window),
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
508 tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this); 508 tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this);
509 gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_view), path, TRUE); 509 gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_view), path, TRUE);
510 g_signal_handlers_unblock_by_func( 510 g_signal_handlers_unblock_by_func(
511 tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this); 511 tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this);
512 } 512 }
513 513
514 void CollectedCookiesGtk::OnTreeViewSelectionChange(GtkWidget* selection) { 514 void CollectedCookiesGtk::OnTreeViewSelectionChange(GtkWidget* selection) {
515 EnableControls(); 515 EnableControls();
516 ShowCookieInfo(gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook_))); 516 ShowCookieInfo(gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook_)));
517 } 517 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698