OLD | NEW |
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" |
11 #include "chrome/browser/cookies_tree_model.h" | 11 #include "chrome/browser/cookies_tree_model.h" |
| 12 #include "chrome/browser/infobars/infobar_tab_helper.h" |
12 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" | 14 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" |
14 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" | 15 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" |
15 #include "chrome/browser/ui/gtk/gtk_chrome_cookie_view.h" | 16 #include "chrome/browser/ui/gtk/gtk_chrome_cookie_view.h" |
16 #include "chrome/browser/ui/gtk/gtk_util.h" | 17 #include "chrome/browser/ui/gtk/gtk_util.h" |
17 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 18 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
18 #include "chrome/common/chrome_notification_types.h" | 19 #include "chrome/common/chrome_notification_types.h" |
19 #include "content/common/notification_source.h" | 20 #include "content/common/notification_source.h" |
20 #include "grit/generated_resources.h" | 21 #include "grit/generated_resources.h" |
21 #include "ui/base/gtk/gtk_hig_constants.h" | 22 #include "ui/base/gtk/gtk_hig_constants.h" |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 | 426 |
426 void CollectedCookiesGtk::Observe(int type, | 427 void CollectedCookiesGtk::Observe(int type, |
427 const NotificationSource& source, | 428 const NotificationSource& source, |
428 const NotificationDetails& details) { | 429 const NotificationDetails& details) { |
429 DCHECK(type == chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN); | 430 DCHECK(type == chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN); |
430 window_->CloseConstrainedWindow(); | 431 window_->CloseConstrainedWindow(); |
431 } | 432 } |
432 | 433 |
433 void CollectedCookiesGtk::OnClose(GtkWidget* close_button) { | 434 void CollectedCookiesGtk::OnClose(GtkWidget* close_button) { |
434 if (status_changed_) { | 435 if (status_changed_) { |
435 TabContentsWrapper::GetCurrentWrapperForContents(tab_contents_)->AddInfoBar( | 436 TabContentsWrapper::GetCurrentWrapperForContents(tab_contents_)-> |
436 new CollectedCookiesInfoBarDelegate(tab_contents_)); | 437 infobar_tab_helper()->AddInfoBar( |
| 438 new CollectedCookiesInfoBarDelegate(tab_contents_)); |
437 } | 439 } |
438 window_->CloseConstrainedWindow(); | 440 window_->CloseConstrainedWindow(); |
439 } | 441 } |
440 | 442 |
441 void CollectedCookiesGtk::AddExceptions(GtkTreeSelection* selection, | 443 void CollectedCookiesGtk::AddExceptions(GtkTreeSelection* selection, |
442 gtk_tree::TreeAdapter* adapter, | 444 gtk_tree::TreeAdapter* adapter, |
443 ContentSetting setting) { | 445 ContentSetting setting) { |
444 GtkTreeModel* model; | 446 GtkTreeModel* model; |
445 GList* paths = | 447 GList* paths = |
446 gtk_tree_selection_get_selected_rows(selection, &model); | 448 gtk_tree_selection_get_selected_rows(selection, &model); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this); | 512 tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this); |
511 gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_view), path, TRUE); | 513 gtk_tree_view_expand_row(GTK_TREE_VIEW(tree_view), path, TRUE); |
512 g_signal_handlers_unblock_by_func( | 514 g_signal_handlers_unblock_by_func( |
513 tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this); | 515 tree_view, reinterpret_cast<gpointer>(OnTreeViewRowExpandedThunk), this); |
514 } | 516 } |
515 | 517 |
516 void CollectedCookiesGtk::OnTreeViewSelectionChange(GtkWidget* selection) { | 518 void CollectedCookiesGtk::OnTreeViewSelectionChange(GtkWidget* selection) { |
517 EnableControls(); | 519 EnableControls(); |
518 ShowCookieInfo(gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook_))); | 520 ShowCookieInfo(gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook_))); |
519 } | 521 } |
OLD | NEW |