| 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/location_bar_view_gtk.h" | 5 #include "chrome/browser/ui/gtk/location_bar_view_gtk.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1360 | 1360 |
| 1361 gboolean LocationBarViewGtk::ContentSettingImageViewGtk::OnButtonPressed( | 1361 gboolean LocationBarViewGtk::ContentSettingImageViewGtk::OnButtonPressed( |
| 1362 GtkWidget* sender, GdkEvent* event) { | 1362 GtkWidget* sender, GdkEvent* event) { |
| 1363 TabContentsWrapper* tab_contents = parent_->GetTabContentsWrapper(); | 1363 TabContentsWrapper* tab_contents = parent_->GetTabContentsWrapper(); |
| 1364 if (!tab_contents) | 1364 if (!tab_contents) |
| 1365 return TRUE; | 1365 return TRUE; |
| 1366 const ContentSettingsType content_settings_type = | 1366 const ContentSettingsType content_settings_type = |
| 1367 content_setting_image_model_->get_content_settings_type(); | 1367 content_setting_image_model_->get_content_settings_type(); |
| 1368 if (content_settings_type == CONTENT_SETTINGS_TYPE_PRERENDER) | 1368 if (content_settings_type == CONTENT_SETTINGS_TYPE_PRERENDER) |
| 1369 return TRUE; | 1369 return TRUE; |
| 1370 GURL url = tab_contents->tab_contents()->GetURL(); | |
| 1371 std::wstring display_host; | |
| 1372 net::AppendFormattedHost(url, | |
| 1373 UTF8ToWide(profile_->GetPrefs()->GetString(prefs::kAcceptLanguages)), | |
| 1374 &display_host, | |
| 1375 NULL, NULL); | |
| 1376 | |
| 1377 content_setting_bubble_ = new ContentSettingBubbleGtk( | 1370 content_setting_bubble_ = new ContentSettingBubbleGtk( |
| 1378 sender, this, | 1371 sender, this, |
| 1379 ContentSettingBubbleModel::CreateContentSettingBubbleModel( | 1372 ContentSettingBubbleModel::CreateContentSettingBubbleModel( |
| 1380 tab_contents, profile_, content_settings_type), | 1373 tab_contents, profile_, content_settings_type), |
| 1381 profile_, tab_contents->tab_contents()); | 1374 profile_, tab_contents->tab_contents()); |
| 1382 return TRUE; | 1375 return TRUE; |
| 1383 } | 1376 } |
| 1384 | 1377 |
| 1385 gboolean LocationBarViewGtk::ContentSettingImageViewGtk::OnExpose( | 1378 gboolean LocationBarViewGtk::ContentSettingImageViewGtk::OnExpose( |
| 1386 GtkWidget* sender, GdkEventExpose* event) { | 1379 GtkWidget* sender, GdkEventExpose* event) { |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1636 | 1629 |
| 1637 std::string badge_text = page_action_->GetBadgeText(tab_id); | 1630 std::string badge_text = page_action_->GetBadgeText(tab_id); |
| 1638 if (badge_text.empty()) | 1631 if (badge_text.empty()) |
| 1639 return FALSE; | 1632 return FALSE; |
| 1640 | 1633 |
| 1641 gfx::CanvasSkiaPaint canvas(event, false); | 1634 gfx::CanvasSkiaPaint canvas(event, false); |
| 1642 gfx::Rect bounding_rect(widget->allocation); | 1635 gfx::Rect bounding_rect(widget->allocation); |
| 1643 page_action_->PaintBadge(&canvas, bounding_rect, tab_id); | 1636 page_action_->PaintBadge(&canvas, bounding_rect, tab_id); |
| 1644 return FALSE; | 1637 return FALSE; |
| 1645 } | 1638 } |
| OLD | NEW |