OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 gtk_widget_set_size_request(entry_box_, 0, -1); | 403 gtk_widget_set_size_request(entry_box_, 0, -1); |
404 gtk_box_pack_start(GTK_BOX(hbox_.get()), entry_box_, TRUE, TRUE, 0); | 404 gtk_box_pack_start(GTK_BOX(hbox_.get()), entry_box_, TRUE, TRUE, 0); |
405 | 405 |
406 // We need to adjust the visibility of the search hint widgets according to | 406 // We need to adjust the visibility of the search hint widgets according to |
407 // the horizontal space in the |entry_box_|. | 407 // the horizontal space in the |entry_box_|. |
408 g_signal_connect(entry_box_, "size-allocate", | 408 g_signal_connect(entry_box_, "size-allocate", |
409 G_CALLBACK(&OnEntryBoxSizeAllocateThunk), this); | 409 G_CALLBACK(&OnEntryBoxSizeAllocateThunk), this); |
410 | 410 |
411 // Tab to search (the keyword box on the left hand side). | 411 // Tab to search (the keyword box on the left hand side). |
412 tab_to_search_full_label_ = | 412 tab_to_search_full_label_ = |
413 theme_service_->BuildLabel("", ui::kGdkBlack); | 413 theme_service_->BuildLabel(std::string(), ui::kGdkBlack); |
414 tab_to_search_partial_label_ = | 414 tab_to_search_partial_label_ = |
415 theme_service_->BuildLabel("", ui::kGdkBlack); | 415 theme_service_->BuildLabel(std::string(), ui::kGdkBlack); |
416 GtkWidget* tab_to_search_label_hbox = gtk_hbox_new(FALSE, 0); | 416 GtkWidget* tab_to_search_label_hbox = gtk_hbox_new(FALSE, 0); |
417 gtk_box_pack_start(GTK_BOX(tab_to_search_label_hbox), | 417 gtk_box_pack_start(GTK_BOX(tab_to_search_label_hbox), |
418 tab_to_search_full_label_, FALSE, FALSE, 0); | 418 tab_to_search_full_label_, FALSE, FALSE, 0); |
419 gtk_box_pack_start(GTK_BOX(tab_to_search_label_hbox), | 419 gtk_box_pack_start(GTK_BOX(tab_to_search_label_hbox), |
420 tab_to_search_partial_label_, FALSE, FALSE, 0); | 420 tab_to_search_partial_label_, FALSE, FALSE, 0); |
421 GtkWidget* tab_to_search_hbox = gtk_hbox_new(FALSE, 0); | 421 GtkWidget* tab_to_search_hbox = gtk_hbox_new(FALSE, 0); |
422 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 422 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
423 tab_to_search_magnifier_ = gtk_image_new_from_pixbuf( | 423 tab_to_search_magnifier_ = gtk_image_new_from_pixbuf( |
424 rb.GetNativeImageNamed(IDR_KEYWORD_SEARCH_MAGNIFIER).ToGdkPixbuf()); | 424 rb.GetNativeImageNamed(IDR_KEYWORD_SEARCH_MAGNIFIER).ToGdkPixbuf()); |
425 gtk_box_pack_start(GTK_BOX(tab_to_search_hbox), tab_to_search_magnifier_, | 425 gtk_box_pack_start(GTK_BOX(tab_to_search_hbox), tab_to_search_magnifier_, |
(...skipping 25 matching lines...) Expand all Loading... |
451 location_entry_alignment_ = gtk_alignment_new(0.0, 0.0, 1.0, 1.0); | 451 location_entry_alignment_ = gtk_alignment_new(0.0, 0.0, 1.0, 1.0); |
452 gtk_container_add(GTK_CONTAINER(location_entry_alignment_), | 452 gtk_container_add(GTK_CONTAINER(location_entry_alignment_), |
453 location_entry_->GetNativeView()); | 453 location_entry_->GetNativeView()); |
454 gtk_box_pack_start(GTK_BOX(entry_box_), location_entry_alignment_, | 454 gtk_box_pack_start(GTK_BOX(entry_box_), location_entry_alignment_, |
455 TRUE, TRUE, 0); | 455 TRUE, TRUE, 0); |
456 | 456 |
457 // Tab to search notification (the hint on the right hand side). | 457 // Tab to search notification (the hint on the right hand side). |
458 tab_to_search_hint_ = gtk_hbox_new(FALSE, 0); | 458 tab_to_search_hint_ = gtk_hbox_new(FALSE, 0); |
459 gtk_widget_set_name(tab_to_search_hint_, "chrome-tab-to-search-hint"); | 459 gtk_widget_set_name(tab_to_search_hint_, "chrome-tab-to-search-hint"); |
460 tab_to_search_hint_leading_label_ = | 460 tab_to_search_hint_leading_label_ = |
461 theme_service_->BuildLabel("", kHintTextColor); | 461 theme_service_->BuildLabel(std::string(), kHintTextColor); |
462 gtk_widget_set_sensitive(tab_to_search_hint_leading_label_, FALSE); | 462 gtk_widget_set_sensitive(tab_to_search_hint_leading_label_, FALSE); |
463 tab_to_search_hint_icon_ = gtk_image_new_from_pixbuf( | 463 tab_to_search_hint_icon_ = gtk_image_new_from_pixbuf( |
464 rb.GetNativeImageNamed(IDR_LOCATION_BAR_KEYWORD_HINT_TAB).ToGdkPixbuf()); | 464 rb.GetNativeImageNamed(IDR_LOCATION_BAR_KEYWORD_HINT_TAB).ToGdkPixbuf()); |
465 tab_to_search_hint_trailing_label_ = | 465 tab_to_search_hint_trailing_label_ = |
466 theme_service_->BuildLabel("", kHintTextColor); | 466 theme_service_->BuildLabel(std::string(), kHintTextColor); |
467 gtk_widget_set_sensitive(tab_to_search_hint_trailing_label_, FALSE); | 467 gtk_widget_set_sensitive(tab_to_search_hint_trailing_label_, FALSE); |
468 gtk_box_pack_start(GTK_BOX(tab_to_search_hint_), | 468 gtk_box_pack_start(GTK_BOX(tab_to_search_hint_), |
469 tab_to_search_hint_leading_label_, | 469 tab_to_search_hint_leading_label_, |
470 FALSE, FALSE, 0); | 470 FALSE, FALSE, 0); |
471 gtk_box_pack_start(GTK_BOX(tab_to_search_hint_), | 471 gtk_box_pack_start(GTK_BOX(tab_to_search_hint_), |
472 tab_to_search_hint_icon_, | 472 tab_to_search_hint_icon_, |
473 FALSE, FALSE, 0); | 473 FALSE, FALSE, 0); |
474 gtk_box_pack_start(GTK_BOX(tab_to_search_hint_), | 474 gtk_box_pack_start(GTK_BOX(tab_to_search_hint_), |
475 tab_to_search_hint_trailing_label_, | 475 tab_to_search_hint_trailing_label_, |
476 FALSE, FALSE, 0); | 476 FALSE, FALSE, 0); |
(...skipping 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2100 } | 2100 } |
2101 | 2101 |
2102 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( | 2102 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( |
2103 ExtensionAction* action) { | 2103 ExtensionAction* action) { |
2104 ExtensionPopupGtk::Show( | 2104 ExtensionPopupGtk::Show( |
2105 action->GetPopupUrl(current_tab_id_), | 2105 action->GetPopupUrl(current_tab_id_), |
2106 owner_->browser_, | 2106 owner_->browser_, |
2107 event_box_.get(), | 2107 event_box_.get(), |
2108 ExtensionPopupGtk::SHOW_AND_INSPECT); | 2108 ExtensionPopupGtk::SHOW_AND_INSPECT); |
2109 } | 2109 } |
OLD | NEW |