| 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/permission_selector.h" | 5 #include "chrome/browser/ui/gtk/website_settings/permission_selector.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 10 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 GdkPixbuf* pixbuf = WebsiteSettingsUI::GetPermissionIcon( | 61 GdkPixbuf* pixbuf = WebsiteSettingsUI::GetPermissionIcon( |
| 62 type, effective_setting).ToGdkPixbuf(); | 62 type, effective_setting).ToGdkPixbuf(); |
| 63 icon_ = gtk_image_new_from_pixbuf(pixbuf); | 63 icon_ = gtk_image_new_from_pixbuf(pixbuf); |
| 64 gtk_box_pack_start(GTK_BOX(widget_), icon_, FALSE, FALSE, 0); | 64 gtk_box_pack_start(GTK_BOX(widget_), icon_, FALSE, FALSE, 0); |
| 65 | 65 |
| 66 // Add a label for the permission type. | 66 // Add a label for the permission type. |
| 67 GtkWidget* label = theme_service->BuildLabel(l10n_util::GetStringFUTF8( | 67 GtkWidget* label = theme_service->BuildLabel(l10n_util::GetStringFUTF8( |
| 68 IDS_WEBSITE_SETTINGS_PERMISSION_TYPE, | 68 IDS_WEBSITE_SETTINGS_PERMISSION_TYPE, |
| 69 WebsiteSettingsUI::PermissionTypeToUIString(type)), | 69 WebsiteSettingsUI::PermissionTypeToUIString(type)), |
| 70 ui::kGdkBlack); | 70 ui::kGdkBlack); |
| 71 gtk_label_set_selectable(GTK_LABEL(label), TRUE); | |
| 72 gtk_label_set_line_wrap_mode(GTK_LABEL(label), PANGO_WRAP_WORD_CHAR); | 71 gtk_label_set_line_wrap_mode(GTK_LABEL(label), PANGO_WRAP_WORD_CHAR); |
| 73 | 72 |
| 74 gtk_box_pack_start(GTK_BOX(widget_), label, FALSE, FALSE, 0); | 73 gtk_box_pack_start(GTK_BOX(widget_), label, FALSE, FALSE, 0); |
| 75 | 74 |
| 76 // Add the menu button. | 75 // Add the menu button. |
| 77 menu_button_ = gtk_button_new_with_label( | 76 menu_button_ = gtk_button_new_with_label( |
| 78 UTF16ToUTF8(WebsiteSettingsUI::PermissionActionToUIString( | 77 UTF16ToUTF8(WebsiteSettingsUI::PermissionActionToUIString( |
| 79 setting, default_setting, source)).c_str()); | 78 setting, default_setting, source)).c_str()); |
| 80 bool user_setting = source == content_settings::SETTING_SOURCE_USER; | 79 bool user_setting = source == content_settings::SETTING_SOURCE_USER; |
| 81 gtk_widget_set_sensitive(GTK_WIDGET(menu_button_), user_setting); | 80 gtk_widget_set_sensitive(GTK_WIDGET(menu_button_), user_setting); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 content_settings::SETTING_SOURCE_USER)).c_str()); | 140 content_settings::SETTING_SOURCE_USER)).c_str()); |
| 142 | 141 |
| 143 FOR_EACH_OBSERVER(PermissionSelectorObserver, | 142 FOR_EACH_OBSERVER(PermissionSelectorObserver, |
| 144 observer_list_, | 143 observer_list_, |
| 145 OnPermissionChanged(this)); | 144 OnPermissionChanged(this)); |
| 146 } | 145 } |
| 147 | 146 |
| 148 bool PermissionSelector::IsCommandIdChecked(int command_id) { | 147 bool PermissionSelector::IsCommandIdChecked(int command_id) { |
| 149 return setting_ == CommandIdToContentSetting(command_id); | 148 return setting_ == CommandIdToContentSetting(command_id); |
| 150 } | 149 } |
| OLD | NEW |