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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 | 346 |
347 // Put the event box in an alignment to get the padding correct. | 347 // Put the event box in an alignment to get the padding correct. |
348 site_type_alignment_ = gtk_alignment_new(0, 0, 1, 1); | 348 site_type_alignment_ = gtk_alignment_new(0, 0, 1, 1); |
349 gtk_alignment_set_padding(GTK_ALIGNMENT(site_type_alignment_), | 349 gtk_alignment_set_padding(GTK_ALIGNMENT(site_type_alignment_), |
350 1, 1, 0, 0); | 350 1, 1, 0, 0); |
351 gtk_container_add(GTK_CONTAINER(site_type_alignment_), | 351 gtk_container_add(GTK_CONTAINER(site_type_alignment_), |
352 site_type_event_box_); | 352 site_type_event_box_); |
353 gtk_box_pack_start(GTK_BOX(hbox_.get()), site_type_alignment_, | 353 gtk_box_pack_start(GTK_BOX(hbox_.get()), site_type_alignment_, |
354 FALSE, FALSE, 0); | 354 FALSE, FALSE, 0); |
355 | 355 |
| 356 gtk_widget_set_tooltip_text(location_icon_image_, |
| 357 l10n_util::GetStringUTF8(IDS_TOOLTIP_LOCATION_ICON).c_str()); |
| 358 |
356 g_signal_connect(site_type_event_box_, "button-release-event", | 359 g_signal_connect(site_type_event_box_, "button-release-event", |
357 G_CALLBACK(&OnIconReleasedThunk), this); | 360 G_CALLBACK(&OnIconReleasedThunk), this); |
358 } | 361 } |
359 | 362 |
360 void LocationBarViewGtk::SetSiteTypeDragSource() { | 363 void LocationBarViewGtk::SetSiteTypeDragSource() { |
361 bool enable = !location_entry()->IsEditingOrEmpty(); | 364 bool enable = !location_entry()->IsEditingOrEmpty(); |
362 if (enable_location_drag_ == enable) | 365 if (enable_location_drag_ == enable) |
363 return; | 366 return; |
364 enable_location_drag_ = enable; | 367 enable_location_drag_ = enable; |
365 | 368 |
(...skipping 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1546 | 1549 |
1547 std::string badge_text = page_action_->GetBadgeText(tab_id); | 1550 std::string badge_text = page_action_->GetBadgeText(tab_id); |
1548 if (badge_text.empty()) | 1551 if (badge_text.empty()) |
1549 return FALSE; | 1552 return FALSE; |
1550 | 1553 |
1551 gfx::CanvasSkiaPaint canvas(event, false); | 1554 gfx::CanvasSkiaPaint canvas(event, false); |
1552 gfx::Rect bounding_rect(widget->allocation); | 1555 gfx::Rect bounding_rect(widget->allocation); |
1553 page_action_->PaintBadge(&canvas, bounding_rect, tab_id); | 1556 page_action_->PaintBadge(&canvas, bounding_rect, tab_id); |
1554 return FALSE; | 1557 return FALSE; |
1555 } | 1558 } |
OLD | NEW |