| 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/gtk/website_settings/website_settings_popup_gtk.h" | 5 #include "chrome/browser/ui/gtk/website_settings/website_settings_popup_gtk.h" |
| 6 | 6 |
| 7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/certificate_viewer.h" | 10 #include "chrome/browser/certificate_viewer.h" |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 ui::kGdkBlack); | 331 ui::kGdkBlack); |
| 332 gtk_widget_show(label); | 332 gtk_widget_show(label); |
| 333 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), connection_tab, label); | 333 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), connection_tab, label); |
| 334 | 334 |
| 335 gtk_box_pack_start(GTK_BOX(contents_), notebook, FALSE, FALSE, 0); | 335 gtk_box_pack_start(GTK_BOX(contents_), notebook, FALSE, FALSE, 0); |
| 336 gtk_widget_show_all(contents_); | 336 gtk_widget_show_all(contents_); |
| 337 } | 337 } |
| 338 | 338 |
| 339 void WebsiteSettingsPopupGtk::OnPermissionChanged( | 339 void WebsiteSettingsPopupGtk::OnPermissionChanged( |
| 340 PermissionSelector* selector) { | 340 PermissionSelector* selector) { |
| 341 presenter_->OnSitePermissionChanged(selector->type(), | 341 presenter_->OnSitePermissionChanged(selector->GetType(), |
| 342 selector->setting()); | 342 selector->GetSetting()); |
| 343 } | 343 } |
| 344 | 344 |
| 345 void WebsiteSettingsPopupGtk::OnComboboxShown() { | 345 void WebsiteSettingsPopupGtk::OnComboboxShown() { |
| 346 bubble_->HandlePointerAndKeyboardUngrabbedByContent(); | 346 bubble_->HandlePointerAndKeyboardUngrabbedByContent(); |
| 347 } | 347 } |
| 348 | 348 |
| 349 void WebsiteSettingsPopupGtk::SetCookieInfo( | 349 void WebsiteSettingsPopupGtk::SetCookieInfo( |
| 350 const CookieInfoList& cookie_info_list) { | 350 const CookieInfoList& cookie_info_list) { |
| 351 DCHECK(cookies_section_contents_); | 351 DCHECK(cookies_section_contents_); |
| 352 ClearContainer(cookies_section_contents_); | 352 ClearContainer(cookies_section_contents_); |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 | 524 |
| 525 for (PermissionInfoList::const_iterator permission = | 525 for (PermissionInfoList::const_iterator permission = |
| 526 permission_info_list.begin(); | 526 permission_info_list.begin(); |
| 527 permission != permission_info_list.end(); | 527 permission != permission_info_list.end(); |
| 528 ++permission) { | 528 ++permission) { |
| 529 PermissionSelector* selector = | 529 PermissionSelector* selector = |
| 530 new PermissionSelector( | 530 new PermissionSelector( |
| 531 theme_service_, | 531 theme_service_, |
| 532 permission->type, | 532 permission->type, |
| 533 permission->setting, | 533 permission->setting, |
| 534 permission->default_setting); | 534 permission->default_setting, |
| 535 permission->source); |
| 535 selector->AddObserver(this); | 536 selector->AddObserver(this); |
| 536 GtkWidget* hbox = selector->CreateUI(); | 537 GtkWidget* hbox = selector->widget(); |
| 537 selectors_.push_back(selector); | 538 selectors_.push_back(selector); |
| 538 gtk_box_pack_start(GTK_BOX(permissions_section_contents_), hbox, FALSE, | 539 gtk_box_pack_start(GTK_BOX(permissions_section_contents_), hbox, FALSE, |
| 539 FALSE, 0); | 540 FALSE, 0); |
| 540 } | 541 } |
| 541 | 542 |
| 542 gtk_widget_show_all(permissions_section_contents_); | 543 gtk_widget_show_all(permissions_section_contents_); |
| 543 } | 544 } |
| 544 | 545 |
| 545 void WebsiteSettingsPopupGtk::OnCookiesLinkClicked(GtkWidget* widget) { | 546 void WebsiteSettingsPopupGtk::OnCookiesLinkClicked(GtkWidget* widget) { |
| 546 new CollectedCookiesGtk(GTK_WINDOW(parent_), | 547 new CollectedCookiesGtk(GTK_WINDOW(parent_), |
| 547 tab_contents_); | 548 tab_contents_); |
| 548 bubble_->Close(); | 549 bubble_->Close(); |
| 549 } | 550 } |
| 550 | 551 |
| 551 void WebsiteSettingsPopupGtk::OnViewCertLinkClicked(GtkWidget* widget) { | 552 void WebsiteSettingsPopupGtk::OnViewCertLinkClicked(GtkWidget* widget) { |
| 552 DCHECK_NE(cert_id_, 0); | 553 DCHECK_NE(cert_id_, 0); |
| 553 ShowCertificateViewerByID( | 554 ShowCertificateViewerByID( |
| 554 tab_contents_->web_contents(), GTK_WINDOW(parent_), cert_id_); | 555 tab_contents_->web_contents(), GTK_WINDOW(parent_), cert_id_); |
| 555 bubble_->Close(); | 556 bubble_->Close(); |
| 556 } | 557 } |
| 557 | 558 |
| 558 void WebsiteSettingsPopupGtk::OnCloseButtonClicked(GtkWidget* widget) { | 559 void WebsiteSettingsPopupGtk::OnCloseButtonClicked(GtkWidget* widget) { |
| 559 bubble_->Close(); | 560 bubble_->Close(); |
| 560 } | 561 } |
| OLD | NEW |