| 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_popup_gtk.h" | 5 #include "chrome/browser/ui/gtk/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 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 using content::OpenURLParams; | 32 using content::OpenURLParams; |
| 33 | 33 |
| 34 namespace { | 34 namespace { |
| 35 | 35 |
| 36 // The background color of the tabs if a theme other than the native GTK theme | 36 // The background color of the tabs if a theme other than the native GTK theme |
| 37 // is selected. | 37 // is selected. |
| 38 const GdkColor kBackgroundColor = GDK_COLOR_RGB(0xff, 0xff, 0xff); | 38 const GdkColor kBackgroundColor = GDK_COLOR_RGB(0xff, 0xff, 0xff); |
| 39 | 39 |
| 40 std::string PermissionTypeToString(ContentSettingsType type) { | 40 std::string PermissionTypeToString(ContentSettingsType type) { |
| 41 switch (type) { | 41 return l10n_util::GetStringUTF8( |
| 42 case CONTENT_SETTINGS_TYPE_POPUPS: | 42 WebsiteSettingsUI::PermissionTypeToUIStringID(type)); |
| 43 return l10n_util::GetStringUTF8(IDS_WEBSITE_SETTINGS_TYPE_POPUPS); | |
| 44 case CONTENT_SETTINGS_TYPE_PLUGINS: | |
| 45 return l10n_util::GetStringUTF8(IDS_WEBSITE_SETTINGS_TYPE_PLUGINS); | |
| 46 case CONTENT_SETTINGS_TYPE_GEOLOCATION: | |
| 47 return l10n_util::GetStringUTF8(IDS_WEBSITE_SETTINGS_TYPE_LOCATION); | |
| 48 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: | |
| 49 return l10n_util::GetStringUTF8(IDS_WEBSITE_SETTINGS_TYPE_NOTIFICATIONS); | |
| 50 default: | |
| 51 NOTREACHED(); | |
| 52 return ""; | |
| 53 } | |
| 54 } | 43 } |
| 55 | 44 |
| 56 std::string PermissionValueToString(ContentSetting value) { | 45 std::string PermissionValueToString(ContentSetting value) { |
| 57 switch (value) { | 46 return l10n_util::GetStringUTF8( |
| 58 case CONTENT_SETTING_ALLOW: | 47 WebsiteSettingsUI::PermissionValueToUIStringID(value)); |
| 59 return l10n_util::GetStringUTF8(IDS_WEBSITE_SETTINGS_PERMISSION_ALLOW); | |
| 60 case CONTENT_SETTING_BLOCK: | |
| 61 return l10n_util::GetStringUTF8(IDS_WEBSITE_SETTINGS_PERMISSION_BLOCK); | |
| 62 case CONTENT_SETTING_ASK: | |
| 63 return l10n_util::GetStringUTF8(IDS_WEBSITE_SETTINGS_PERMISSION_ASK); | |
| 64 default: | |
| 65 NOTREACHED(); | |
| 66 return ""; | |
| 67 } | |
| 68 } | 48 } |
| 69 | 49 |
| 70 } // namespace | 50 } // namespace |
| 71 | 51 |
| 72 // static | 52 // static |
| 73 void WebsiteSettingsPopupGtk::Show(gfx::NativeWindow parent, | 53 void WebsiteSettingsPopupGtk::Show(gfx::NativeWindow parent, |
| 74 Profile* profile, | 54 Profile* profile, |
| 75 TabContentsWrapper* tab_contents_wrapper, | 55 TabContentsWrapper* tab_contents_wrapper, |
| 76 const GURL& url, | 56 const GURL& url, |
| 77 const content::SSLStatus& ssl) { | 57 const content::SSLStatus& ssl) { |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 if (presenter_.get()) | 509 if (presenter_.get()) |
| 530 presenter_->OnSitePermissionChanged(ContentSettingsType(type), | 510 presenter_->OnSitePermissionChanged(ContentSettingsType(type), |
| 531 ContentSetting(value)); | 511 ContentSetting(value)); |
| 532 } | 512 } |
| 533 | 513 |
| 534 void WebsiteSettingsPopupGtk::OnViewCertLinkClicked(GtkWidget* widget) { | 514 void WebsiteSettingsPopupGtk::OnViewCertLinkClicked(GtkWidget* widget) { |
| 535 DCHECK_NE(cert_id_, 0); | 515 DCHECK_NE(cert_id_, 0); |
| 536 ShowCertificateViewerByID(GTK_WINDOW(parent_), cert_id_); | 516 ShowCertificateViewerByID(GTK_WINDOW(parent_), cert_id_); |
| 537 bubble_->Close(); | 517 bubble_->Close(); |
| 538 } | 518 } |
| OLD | NEW |