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/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "grit/locale_settings.h" | 25 #include "grit/locale_settings.h" |
26 #include "grit/theme_resources.h" | 26 #include "grit/theme_resources.h" |
27 #include "ui/base/gtk/gtk_hig_constants.h" | 27 #include "ui/base/gtk/gtk_hig_constants.h" |
28 #include "ui/base/l10n/l10n_util.h" | 28 #include "ui/base/l10n/l10n_util.h" |
29 #include "ui/base/resource/resource_bundle.h" | 29 #include "ui/base/resource/resource_bundle.h" |
30 | 30 |
31 using content::OpenURLParams; | 31 using content::OpenURLParams; |
32 | 32 |
33 namespace { | 33 namespace { |
34 | 34 |
| 35 // The background color of the tabs if a theme other than the native GTK theme |
| 36 // is selected. |
| 37 const GdkColor kBackgroundColor = GDK_COLOR_RGB(0xff, 0xff, 0xff); |
| 38 |
35 std::string PermissionTypeToString(ContentSettingsType type) { | 39 std::string PermissionTypeToString(ContentSettingsType type) { |
36 switch (type) { | 40 switch (type) { |
37 case CONTENT_SETTINGS_TYPE_POPUPS: | 41 case CONTENT_SETTINGS_TYPE_POPUPS: |
38 return l10n_util::GetStringUTF8(IDS_WEBSITE_SETTINGS_TYPE_POPUPS); | 42 return l10n_util::GetStringUTF8(IDS_WEBSITE_SETTINGS_TYPE_POPUPS); |
39 case CONTENT_SETTINGS_TYPE_PLUGINS: | 43 case CONTENT_SETTINGS_TYPE_PLUGINS: |
40 return l10n_util::GetStringUTF8(IDS_WEBSITE_SETTINGS_TYPE_PLUGINS); | 44 return l10n_util::GetStringUTF8(IDS_WEBSITE_SETTINGS_TYPE_PLUGINS); |
41 case CONTENT_SETTINGS_TYPE_GEOLOCATION: | 45 case CONTENT_SETTINGS_TYPE_GEOLOCATION: |
42 return l10n_util::GetStringUTF8(IDS_WEBSITE_SETTINGS_TYPE_LOCATION); | 46 return l10n_util::GetStringUTF8(IDS_WEBSITE_SETTINGS_TYPE_LOCATION); |
43 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: | 47 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: |
44 return l10n_util::GetStringUTF8(IDS_WEBSITE_SETTINGS_TYPE_NOTIFICATIONS); | 48 return l10n_util::GetStringUTF8(IDS_WEBSITE_SETTINGS_TYPE_NOTIFICATIONS); |
(...skipping 22 matching lines...) Expand all Loading... |
67 WebsiteSettingsPopupGtk::WebsiteSettingsPopupGtk( | 71 WebsiteSettingsPopupGtk::WebsiteSettingsPopupGtk( |
68 gfx::NativeWindow parent, | 72 gfx::NativeWindow parent, |
69 Profile* profile, | 73 Profile* profile, |
70 TabContentsWrapper* tab_contents_wrapper) | 74 TabContentsWrapper* tab_contents_wrapper) |
71 : parent_(parent), | 75 : parent_(parent), |
72 contents_(NULL), | 76 contents_(NULL), |
73 theme_service_(ThemeServiceGtk::GetFrom(profile)), | 77 theme_service_(ThemeServiceGtk::GetFrom(profile)), |
74 profile_(profile), | 78 profile_(profile), |
75 tab_contents_wrapper_(tab_contents_wrapper), | 79 tab_contents_wrapper_(tab_contents_wrapper), |
76 browser_(NULL), | 80 browser_(NULL), |
77 site_info_contents_(NULL), | 81 header_box_(NULL), |
78 cookies_section_contents_(NULL), | 82 cookies_section_contents_(NULL), |
79 permissions_section_contents_(NULL), | 83 permissions_section_contents_(NULL), |
| 84 identity_tab_contents_(NULL), |
80 presenter_(NULL) { | 85 presenter_(NULL) { |
81 BrowserWindowGtk* browser_window = | 86 BrowserWindowGtk* browser_window = |
82 BrowserWindowGtk::GetBrowserWindowForNativeWindow(parent); | 87 BrowserWindowGtk::GetBrowserWindowForNativeWindow(parent); |
83 browser_ = browser_window->browser(); | 88 browser_ = browser_window->browser(); |
84 anchor_ = browser_window-> | 89 anchor_ = browser_window-> |
85 GetToolbar()->GetLocationBarView()->location_icon_widget(); | 90 GetToolbar()->GetLocationBarView()->location_icon_widget(); |
86 | 91 |
87 InitContents(); | 92 InitContents(); |
88 | 93 |
89 BubbleGtk::ArrowLocationGtk arrow_location = base::i18n::IsRTL() ? | 94 BubbleGtk::ArrowLocationGtk arrow_location = base::i18n::IsRTL() ? |
(...skipping 28 matching lines...) Expand all Loading... |
118 | 123 |
119 void WebsiteSettingsPopupGtk::InitContents() { | 124 void WebsiteSettingsPopupGtk::InitContents() { |
120 if (!contents_) { | 125 if (!contents_) { |
121 contents_ = gtk_vbox_new(FALSE, ui::kContentAreaSpacing); | 126 contents_ = gtk_vbox_new(FALSE, ui::kContentAreaSpacing); |
122 gtk_container_set_border_width(GTK_CONTAINER(contents_), | 127 gtk_container_set_border_width(GTK_CONTAINER(contents_), |
123 ui::kContentAreaBorder); | 128 ui::kContentAreaBorder); |
124 } else { | 129 } else { |
125 gtk_util::RemoveAllChildren(contents_); | 130 gtk_util::RemoveAllChildren(contents_); |
126 } | 131 } |
127 | 132 |
128 site_info_contents_ = gtk_vbox_new(FALSE, ui::kControlSpacing); | 133 // Create popup header. |
129 std::string title = | 134 header_box_ = gtk_vbox_new(FALSE, ui::kControlSpacing); |
130 l10n_util::GetStringUTF8(IDS_PAGE_INFO_SITE_INFO_TITLE); | 135 gtk_box_pack_start(GTK_BOX(contents_), header_box_, FALSE, FALSE, 0); |
131 gtk_box_pack_start(GTK_BOX(contents_), | 136 |
132 CreateSection(title, site_info_contents_), | 137 // Create the container for the contents of the permissions tab. |
133 FALSE, FALSE, 0); | 138 GtkWidget* permission_tab_contents = gtk_vbox_new(FALSE, ui::kControlSpacing); |
134 gtk_box_pack_start(GTK_BOX(contents_), | 139 gtk_container_set_border_width(GTK_CONTAINER(permission_tab_contents), 10); |
135 gtk_hseparator_new(), | |
136 FALSE, FALSE, 0); | |
137 cookies_section_contents_ = gtk_vbox_new(FALSE, ui::kControlSpacing); | 140 cookies_section_contents_ = gtk_vbox_new(FALSE, ui::kControlSpacing); |
138 title = l10n_util::GetStringUTF8(IDS_WEBSITE_SETTINGS_TITLE_SITE_DATA); | 141 std::string title = l10n_util::GetStringUTF8( |
139 gtk_box_pack_start(GTK_BOX(contents_), | 142 IDS_WEBSITE_SETTINGS_TITLE_SITE_DATA); |
| 143 gtk_box_pack_start(GTK_BOX(permission_tab_contents), |
140 CreateSection(title, | 144 CreateSection(title, |
141 cookies_section_contents_), | 145 cookies_section_contents_), |
142 FALSE, FALSE, 0); | 146 FALSE, FALSE, 0); |
143 gtk_box_pack_start(GTK_BOX(contents_), | 147 gtk_box_pack_start(GTK_BOX(permission_tab_contents), |
144 gtk_hseparator_new(), | 148 gtk_hseparator_new(), |
145 FALSE, FALSE, 0); | 149 FALSE, FALSE, 0); |
146 permissions_section_contents_ = gtk_vbox_new(FALSE, ui::kControlSpacing); | 150 permissions_section_contents_ = gtk_vbox_new(FALSE, ui::kControlSpacing); |
147 title = l10n_util::GetStringUTF8(IDS_WEBSITE_SETTINGS_TITLE_SITE_PERMISSIONS); | 151 title = l10n_util::GetStringUTF8(IDS_WEBSITE_SETTINGS_TITLE_SITE_PERMISSIONS); |
148 gtk_box_pack_start(GTK_BOX(contents_), | 152 gtk_box_pack_start(GTK_BOX(permission_tab_contents), |
149 CreateSection(title, | 153 CreateSection(title, |
150 permissions_section_contents_), | 154 permissions_section_contents_), |
151 FALSE, FALSE, 0); | 155 FALSE, FALSE, 0); |
152 | 156 |
| 157 // Create the container for the contents of the identity tab. |
| 158 GtkWidget* info_tab = gtk_vbox_new(FALSE, ui::kControlSpacing); |
| 159 identity_tab_contents_ = gtk_vbox_new(FALSE, ui::kControlSpacing); |
| 160 gtk_container_set_border_width(GTK_CONTAINER(identity_tab_contents_), 10); |
| 161 gtk_box_pack_start(GTK_BOX(info_tab), |
| 162 identity_tab_contents_, |
| 163 FALSE, FALSE, 0); |
| 164 |
| 165 // Create tab container and add all tabs. |
| 166 GtkWidget* notebook = gtk_notebook_new(); |
| 167 if (theme_service_->UsingNativeTheme()) |
| 168 gtk_widget_modify_bg(notebook, GTK_STATE_NORMAL, NULL); |
| 169 else |
| 170 gtk_widget_modify_bg(notebook, GTK_STATE_NORMAL, &kBackgroundColor); |
| 171 |
| 172 GtkWidget* label = theme_service_->BuildLabel( |
| 173 l10n_util::GetStringUTF8(IDS_WEBSITE_SETTINGS_TAB_LABEL_PERMISSIONS), |
| 174 ui::kGdkBlack); |
| 175 gtk_widget_show(label); |
| 176 gtk_notebook_append_page( |
| 177 GTK_NOTEBOOK(notebook), permission_tab_contents, label); |
| 178 |
| 179 label = theme_service_->BuildLabel( |
| 180 l10n_util::GetStringUTF8(IDS_WEBSITE_SETTINGS_TAB_LABEL_IDENTITY), |
| 181 ui::kGdkBlack); |
| 182 gtk_widget_show(label); |
| 183 gtk_notebook_append_page(GTK_NOTEBOOK(notebook), info_tab, label); |
| 184 |
| 185 gtk_box_pack_start(GTK_BOX(contents_), notebook, FALSE, FALSE, 0); |
153 gtk_widget_show_all(contents_); | 186 gtk_widget_show_all(contents_); |
154 } | 187 } |
155 | 188 |
156 void WebsiteSettingsPopupGtk::ClearContainer(GtkWidget* container) { | 189 void WebsiteSettingsPopupGtk::ClearContainer(GtkWidget* container) { |
157 GList* child = gtk_container_get_children(GTK_CONTAINER(container)); | 190 GList* child = gtk_container_get_children(GTK_CONTAINER(container)); |
158 while (child) { | 191 while (child) { |
159 gtk_container_remove(GTK_CONTAINER(container), GTK_WIDGET(child->data)); | 192 gtk_container_remove(GTK_CONTAINER(container), GTK_WIDGET(child->data)); |
160 child = child->next; | 193 child = child->next; |
161 } | 194 } |
162 } | 195 } |
163 | 196 |
164 void WebsiteSettingsPopupGtk::SetSiteInfo(const std::string& site_info) { | |
165 DCHECK(site_info_contents_); | |
166 ClearContainer(site_info_contents_); | |
167 GtkWidget* label = theme_service_->BuildLabel(site_info, | |
168 ui::kGdkBlack); | |
169 GtkWidget* site_info_entry_box = gtk_hbox_new(FALSE, ui::kControlSpacing); | |
170 gtk_box_pack_start(GTK_BOX(site_info_entry_box), label, FALSE, FALSE, 0); | |
171 gtk_box_pack_start(GTK_BOX(site_info_contents_), site_info_entry_box, FALSE, | |
172 FALSE, 0); | |
173 gtk_widget_show_all(site_info_contents_); | |
174 } | |
175 | |
176 GtkWidget* WebsiteSettingsPopupGtk::CreateSection(std::string section_title, | 197 GtkWidget* WebsiteSettingsPopupGtk::CreateSection(std::string section_title, |
177 GtkWidget* section_content) { | 198 GtkWidget* section_content) { |
178 GtkWidget* section_box = gtk_vbox_new(FALSE, ui::kControlSpacing); | 199 GtkWidget* section_box = gtk_vbox_new(FALSE, ui::kControlSpacing); |
179 | 200 |
180 // Add Section title | 201 // Add Section title |
181 GtkWidget* title_hbox = gtk_hbox_new(FALSE, ui::kControlSpacing); | 202 GtkWidget* title_hbox = gtk_hbox_new(FALSE, ui::kControlSpacing); |
182 | 203 |
183 GtkWidget* label = theme_service_->BuildLabel(section_title, | 204 GtkWidget* label = theme_service_->BuildLabel(section_title, |
184 ui::kGdkBlack); | 205 ui::kGdkBlack); |
185 gtk_label_set_selectable(GTK_LABEL(label), TRUE); | 206 gtk_label_set_selectable(GTK_LABEL(label), TRUE); |
(...skipping 16 matching lines...) Expand all Loading... |
202 void WebsiteSettingsPopupGtk::SetCookieInfo( | 223 void WebsiteSettingsPopupGtk::SetCookieInfo( |
203 const CookieInfoList& cookie_info_list) { | 224 const CookieInfoList& cookie_info_list) { |
204 DCHECK(cookies_section_contents_); | 225 DCHECK(cookies_section_contents_); |
205 ClearContainer(cookies_section_contents_); | 226 ClearContainer(cookies_section_contents_); |
206 | 227 |
207 // Create cookies info rows. | 228 // Create cookies info rows. |
208 for (CookieInfoList::const_iterator it = cookie_info_list.begin(); | 229 for (CookieInfoList::const_iterator it = cookie_info_list.begin(); |
209 it != cookie_info_list.end(); | 230 it != cookie_info_list.end(); |
210 ++it) { | 231 ++it) { |
211 GtkWidget* cookies_info = gtk_hbox_new(FALSE, 0); | 232 GtkWidget* cookies_info = gtk_hbox_new(FALSE, 0); |
212 | 233 GtkWidget* label = CreateTextLabel(it->cookie_source, 200); |
213 GtkWidget* label = theme_service_->BuildLabel(it->cookie_source, | |
214 ui::kGdkBlack); | |
215 gtk_label_set_selectable(GTK_LABEL(label), TRUE); | |
216 gtk_util::SetLabelWidth(label, 200); | |
217 // Allow linebreaking in the middle of words if necessary, so that extremely | |
218 // long hostnames (longer than one line) will still be completely shown. | |
219 gtk_label_set_line_wrap_mode(GTK_LABEL(label), PANGO_WRAP_WORD_CHAR); | |
220 gtk_box_pack_start(GTK_BOX(cookies_info), label, FALSE, FALSE, 0); | 234 gtk_box_pack_start(GTK_BOX(cookies_info), label, FALSE, FALSE, 0); |
221 | 235 |
222 std::string allowed_count = base::IntToString(it->allowed); | 236 std::string allowed_count = base::IntToString(it->allowed); |
223 std::string blocked_count = base::IntToString(it->blocked); | 237 std::string blocked_count = base::IntToString(it->blocked); |
224 // TODO(markusheintz): Add a localized label here once we decided how this | 238 // TODO(markusheintz): Add a localized label here once we decided how this |
225 // information should be displayed. | 239 // information should be displayed. |
226 std::string info_str = " (" + allowed_count + " allowed / " | 240 std::string info_str = " (" + allowed_count + " allowed / " |
227 + blocked_count + " blocked)"; | 241 + blocked_count + " blocked)"; |
228 | 242 |
229 GtkWidget* info = theme_service_->BuildLabel(info_str, ui::kGdkBlack); | 243 GtkWidget* info = theme_service_->BuildLabel(info_str, ui::kGdkBlack); |
(...skipping 14 matching lines...) Expand all Loading... |
244 G_CALLBACK(OnCookiesLinkClickedThunk), this); | 258 G_CALLBACK(OnCookiesLinkClickedThunk), this); |
245 gtk_box_pack_start(GTK_BOX(link_hbox), view_cookies_link, | 259 gtk_box_pack_start(GTK_BOX(link_hbox), view_cookies_link, |
246 FALSE, FALSE, 0); | 260 FALSE, FALSE, 0); |
247 | 261 |
248 gtk_box_pack_start(GTK_BOX(cookies_section_contents_), link_hbox, | 262 gtk_box_pack_start(GTK_BOX(cookies_section_contents_), link_hbox, |
249 TRUE, FALSE, 0); | 263 TRUE, FALSE, 0); |
250 | 264 |
251 gtk_widget_show_all(cookies_section_contents_); | 265 gtk_widget_show_all(cookies_section_contents_); |
252 } | 266 } |
253 | 267 |
| 268 GtkWidget* WebsiteSettingsPopupGtk::CreateTextLabel(const std::string& text, |
| 269 int width) { |
| 270 GtkWidget* label = theme_service_->BuildLabel(text, ui::kGdkBlack); |
| 271 gtk_util::SetLabelWidth(label, width); |
| 272 gtk_label_set_selectable(GTK_LABEL(label), TRUE); |
| 273 gtk_label_set_line_wrap_mode(GTK_LABEL(label), PANGO_WRAP_WORD_CHAR); |
| 274 return label; |
| 275 } |
| 276 |
| 277 void WebsiteSettingsPopupGtk::SetIdentityInfo( |
| 278 const IdentityInfo& identity_info) { |
| 279 // Create popup header. |
| 280 DCHECK(header_box_); |
| 281 ClearContainer(header_box_); |
| 282 |
| 283 GtkWidget* identity_label = theme_service_->BuildLabel( |
| 284 identity_info.site_identity, ui::kGdkBlack); |
| 285 gtk_label_set_selectable(GTK_LABEL(identity_label), TRUE); |
| 286 PangoAttrList* attributes = pango_attr_list_new(); |
| 287 pango_attr_list_insert(attributes, |
| 288 pango_attr_weight_new(PANGO_WEIGHT_BOLD)); |
| 289 gtk_label_set_attributes(GTK_LABEL(identity_label), attributes); |
| 290 pango_attr_list_unref(attributes); |
| 291 gtk_util::SetLabelWidth(identity_label, 400); |
| 292 gtk_box_pack_start(GTK_BOX(header_box_), identity_label, FALSE, FALSE, 0); |
| 293 |
| 294 std::string identity_status_text; |
| 295 switch (identity_info.identity_status) { |
| 296 case WebsiteSettings::SITE_IDENTITY_STATUS_CERT: |
| 297 case WebsiteSettings::SITE_IDENTITY_STATUS_DNSSEC_CERT: |
| 298 case WebsiteSettings::SITE_IDENTITY_STATUS_EV_CERT: |
| 299 identity_status_text = |
| 300 l10n_util::GetStringUTF8(IDS_WEBSITE_SETTINGS_IDENTITY_VERIFIED); |
| 301 break; |
| 302 default: |
| 303 identity_status_text = |
| 304 l10n_util::GetStringUTF8(IDS_WEBSITE_SETTINGS_IDENTITY_NOT_VERIFIED); |
| 305 break; |
| 306 } |
| 307 GtkWidget* status_label = CreateTextLabel(identity_status_text, 400); |
| 308 gtk_box_pack_start( |
| 309 GTK_BOX(header_box_), status_label, FALSE, FALSE, 0); |
| 310 gtk_widget_show_all(header_box_); |
| 311 |
| 312 // Create identity tab contents. |
| 313 DCHECK(identity_tab_contents_); |
| 314 ClearContainer(identity_tab_contents_); |
| 315 |
| 316 // Create identity section. |
| 317 GtkWidget* identity_description = |
| 318 CreateTextLabel(identity_info.identity_status_description, 300); |
| 319 GtkWidget* identity_box = gtk_vbox_new(FALSE, ui::kControlSpacing); |
| 320 gtk_box_pack_start(GTK_BOX(identity_box), identity_description, FALSE, FALSE, |
| 321 0); |
| 322 |
| 323 // Create connection section. |
| 324 GtkWidget* connection_description = |
| 325 CreateTextLabel(identity_info.connection_status_description, 300); |
| 326 GtkWidget* connection_box = gtk_vbox_new(FALSE, ui::kControlSpacing); |
| 327 gtk_box_pack_start(GTK_BOX(connection_box), connection_description, FALSE, |
| 328 FALSE, 0); |
| 329 |
| 330 // Add to contents. |
| 331 gtk_box_pack_start( |
| 332 GTK_BOX(identity_tab_contents_), CreateSection( |
| 333 l10n_util::GetStringUTF8(IDS_WEBSITE_SETTINGS_TITEL_IDENTITY), |
| 334 identity_box), |
| 335 TRUE, |
| 336 FALSE, |
| 337 0); |
| 338 gtk_box_pack_start(GTK_BOX(identity_tab_contents_), |
| 339 gtk_hseparator_new(), |
| 340 FALSE, FALSE, 0); |
| 341 gtk_box_pack_start( |
| 342 GTK_BOX(identity_tab_contents_), |
| 343 CreateSection( |
| 344 l10n_util::GetStringUTF8( |
| 345 IDS_WEBSITE_SETTINGS_TITEL_CONNECTION), |
| 346 connection_box), |
| 347 TRUE, |
| 348 FALSE, |
| 349 0); |
| 350 |
| 351 gtk_widget_show_all(identity_tab_contents_); |
| 352 } |
| 353 |
254 void WebsiteSettingsPopupGtk::SetPermissionInfo( | 354 void WebsiteSettingsPopupGtk::SetPermissionInfo( |
255 const PermissionInfoList& permission_info_list) { | 355 const PermissionInfoList& permission_info_list) { |
256 DCHECK(permissions_section_contents_); | 356 DCHECK(permissions_section_contents_); |
257 ClearContainer(permissions_section_contents_); | 357 ClearContainer(permissions_section_contents_); |
258 | 358 |
259 for (PermissionInfoList::const_iterator permission = | 359 for (PermissionInfoList::const_iterator permission = |
260 permission_info_list.begin(); | 360 permission_info_list.begin(); |
261 permission != permission_info_list.end(); | 361 permission != permission_info_list.end(); |
262 ++permission) { | 362 ++permission) { |
263 // Add a label for the permission type. | 363 // Add a label for the permission type. |
264 GtkWidget* label = theme_service_->BuildLabel( | 364 GtkWidget* label = |
265 PermissionTypeToString(permission->type), ui::kGdkBlack); | 365 CreateTextLabel(PermissionTypeToString(permission->type), 250); |
266 gtk_util::SetLabelWidth(label, 280); | |
267 GtkWidget* hbox = gtk_hbox_new(FALSE, 0); | 366 GtkWidget* hbox = gtk_hbox_new(FALSE, 0); |
268 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | 367 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
269 | 368 |
270 GtkListStore* store = | 369 GtkListStore* store = |
271 gtk_list_store_new(3, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT); | 370 gtk_list_store_new(3, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT); |
272 GtkTreeIter iter; | 371 GtkTreeIter iter; |
273 // Add option for permission "Allow" to the combobox model. | 372 // Add option for permission "Allow" to the combobox model. |
274 std::string setting_str = PermissionValueToString(CONTENT_SETTING_ALLOW); | 373 std::string setting_str = PermissionValueToString(CONTENT_SETTING_ALLOW); |
275 gtk_list_store_append(store, &iter); | 374 gtk_list_store_append(store, &iter); |
276 gtk_list_store_set(store, &iter, 0, setting_str.c_str(), 1, | 375 gtk_list_store_set(store, &iter, 0, setting_str.c_str(), 1, |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 GTK_TREE_MODEL(gtk_combo_box_get_model(GTK_COMBO_BOX(widget))); | 478 GTK_TREE_MODEL(gtk_combo_box_get_model(GTK_COMBO_BOX(widget))); |
380 | 479 |
381 int value = -1; | 480 int value = -1; |
382 int type = -1; | 481 int type = -1; |
383 gtk_tree_model_get(store, &it, 1, &value, 2, &type, -1); | 482 gtk_tree_model_get(store, &it, 1, &value, 2, &type, -1); |
384 | 483 |
385 if (presenter_) | 484 if (presenter_) |
386 presenter_->OnSitePermissionChanged(ContentSettingsType(type), | 485 presenter_->OnSitePermissionChanged(ContentSettingsType(type), |
387 ContentSetting(value)); | 486 ContentSetting(value)); |
388 } | 487 } |
OLD | NEW |