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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 #include "chrome/common/extensions/extension_resource.h" | 53 #include "chrome/common/extensions/extension_resource.h" |
54 #include "chrome/common/pref_names.h" | 54 #include "chrome/common/pref_names.h" |
55 #include "content/browser/tab_contents/tab_contents.h" | 55 #include "content/browser/tab_contents/tab_contents.h" |
56 #include "content/common/notification_service.h" | 56 #include "content/common/notification_service.h" |
57 #include "content/common/page_transition_types.h" | 57 #include "content/common/page_transition_types.h" |
58 #include "grit/generated_resources.h" | 58 #include "grit/generated_resources.h" |
59 #include "grit/theme_resources.h" | 59 #include "grit/theme_resources.h" |
60 #include "grit/theme_resources_standard.h" | 60 #include "grit/theme_resources_standard.h" |
61 #include "net/base/net_util.h" | 61 #include "net/base/net_util.h" |
62 #include "ui/base/dragdrop/gtk_dnd_util.h" | 62 #include "ui/base/dragdrop/gtk_dnd_util.h" |
| 63 #include "ui/base/gtk/gtk_hig_constants.h" |
63 #include "ui/base/l10n/l10n_util.h" | 64 #include "ui/base/l10n/l10n_util.h" |
64 #include "ui/base/resource/resource_bundle.h" | 65 #include "ui/base/resource/resource_bundle.h" |
65 #include "ui/gfx/canvas_skia_paint.h" | 66 #include "ui/gfx/canvas_skia_paint.h" |
66 #include "ui/gfx/font.h" | 67 #include "ui/gfx/font.h" |
67 #include "ui/gfx/gtk_util.h" | 68 #include "ui/gfx/gtk_util.h" |
68 #include "ui/gfx/image/image.h" | 69 #include "ui/gfx/image/image.h" |
69 #include "webkit/glue/window_open_disposition.h" | 70 #include "webkit/glue/window_open_disposition.h" |
70 | 71 |
71 namespace { | 72 namespace { |
72 | 73 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 gtk_widget_set_size_request(entry_box_, 0, -1); | 217 gtk_widget_set_size_request(entry_box_, 0, -1); |
217 gtk_box_pack_start(GTK_BOX(hbox_.get()), entry_box_, TRUE, TRUE, 0); | 218 gtk_box_pack_start(GTK_BOX(hbox_.get()), entry_box_, TRUE, TRUE, 0); |
218 | 219 |
219 // We need to adjust the visibility of the search hint widgets according to | 220 // We need to adjust the visibility of the search hint widgets according to |
220 // the horizontal space in the |entry_box_|. | 221 // the horizontal space in the |entry_box_|. |
221 g_signal_connect(entry_box_, "size-allocate", | 222 g_signal_connect(entry_box_, "size-allocate", |
222 G_CALLBACK(&OnEntryBoxSizeAllocateThunk), this); | 223 G_CALLBACK(&OnEntryBoxSizeAllocateThunk), this); |
223 | 224 |
224 // Tab to search (the keyword box on the left hand side). | 225 // Tab to search (the keyword box on the left hand side). |
225 tab_to_search_full_label_ = | 226 tab_to_search_full_label_ = |
226 theme_service_->BuildLabel("", gtk_util::kGdkBlack); | 227 theme_service_->BuildLabel("", ui::kGdkBlack); |
227 tab_to_search_partial_label_ = | 228 tab_to_search_partial_label_ = |
228 theme_service_->BuildLabel("", gtk_util::kGdkBlack); | 229 theme_service_->BuildLabel("", ui::kGdkBlack); |
229 GtkWidget* tab_to_search_label_hbox = gtk_hbox_new(FALSE, 0); | 230 GtkWidget* tab_to_search_label_hbox = gtk_hbox_new(FALSE, 0); |
230 gtk_box_pack_start(GTK_BOX(tab_to_search_label_hbox), | 231 gtk_box_pack_start(GTK_BOX(tab_to_search_label_hbox), |
231 tab_to_search_full_label_, FALSE, FALSE, 0); | 232 tab_to_search_full_label_, FALSE, FALSE, 0); |
232 gtk_box_pack_start(GTK_BOX(tab_to_search_label_hbox), | 233 gtk_box_pack_start(GTK_BOX(tab_to_search_label_hbox), |
233 tab_to_search_partial_label_, FALSE, FALSE, 0); | 234 tab_to_search_partial_label_, FALSE, FALSE, 0); |
234 GtkWidget* tab_to_search_hbox = gtk_hbox_new(FALSE, 0); | 235 GtkWidget* tab_to_search_hbox = gtk_hbox_new(FALSE, 0); |
235 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 236 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
236 tab_to_search_magnifier_ = gtk_image_new_from_pixbuf( | 237 tab_to_search_magnifier_ = gtk_image_new_from_pixbuf( |
237 rb.GetNativeImageNamed(IDR_KEYWORD_SEARCH_MAGNIFIER)); | 238 rb.GetNativeImageNamed(IDR_KEYWORD_SEARCH_MAGNIFIER)); |
238 gtk_box_pack_start(GTK_BOX(tab_to_search_hbox), tab_to_search_magnifier_, | 239 gtk_box_pack_start(GTK_BOX(tab_to_search_hbox), tab_to_search_magnifier_, |
(...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1622 | 1623 |
1623 std::string badge_text = page_action_->GetBadgeText(tab_id); | 1624 std::string badge_text = page_action_->GetBadgeText(tab_id); |
1624 if (badge_text.empty()) | 1625 if (badge_text.empty()) |
1625 return FALSE; | 1626 return FALSE; |
1626 | 1627 |
1627 gfx::CanvasSkiaPaint canvas(event, false); | 1628 gfx::CanvasSkiaPaint canvas(event, false); |
1628 gfx::Rect bounding_rect(widget->allocation); | 1629 gfx::Rect bounding_rect(widget->allocation); |
1629 page_action_->PaintBadge(&canvas, bounding_rect, tab_id); | 1630 page_action_->PaintBadge(&canvas, bounding_rect, tab_id); |
1630 return FALSE; | 1631 return FALSE; |
1631 } | 1632 } |
OLD | NEW |