OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/gtk/location_bar_view_gtk.h" | 5 #include "chrome/browser/gtk/location_bar_view_gtk.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "app/gfx/gtk_util.h" | 9 #include "app/gfx/gtk_util.h" |
10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
(...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 current_tab_id_ = ExtensionTabUtil::GetTabId(contents); | 718 current_tab_id_ = ExtensionTabUtil::GetTabId(contents); |
719 current_url_ = url; | 719 current_url_ = url; |
720 | 720 |
721 const ExtensionActionState* state = | 721 const ExtensionActionState* state = |
722 contents->GetPageActionState(page_action_); | 722 contents->GetPageActionState(page_action_); |
723 bool visible = state != NULL; | 723 bool visible = state != NULL; |
724 if (visible) { | 724 if (visible) { |
725 // Set the tooltip. | 725 // Set the tooltip. |
726 if (state->title().empty()) | 726 if (state->title().empty()) |
727 gtk_widget_set_tooltip_text(event_box_.get(), | 727 gtk_widget_set_tooltip_text(event_box_.get(), |
728 page_action_->name().c_str()); | 728 page_action_->title().c_str()); |
729 else | 729 else |
730 gtk_widget_set_tooltip_text(event_box_.get(), state->title().c_str()); | 730 gtk_widget_set_tooltip_text(event_box_.get(), state->title().c_str()); |
731 // Set the image. | 731 // Set the image. |
732 int index = state->icon_index(); | 732 int index = state->icon_index(); |
733 // The image index (if not within bounds) will be set to the first image. | 733 // The image index (if not within bounds) will be set to the first image. |
734 if (index < 0 || index >= static_cast<int>(pixbufs_.size())) | 734 if (index < 0 || index >= static_cast<int>(pixbufs_.size())) |
735 index = 0; | 735 index = 0; |
736 // The pixbuf might not be loaded yet. | 736 // The pixbuf might not be loaded yet. |
737 if (pixbufs_[index]) | 737 if (pixbufs_[index]) |
738 gtk_image_set_from_pixbuf(GTK_IMAGE(image_.get()), pixbufs_[index]); | 738 gtk_image_set_from_pixbuf(GTK_IMAGE(image_.get()), pixbufs_[index]); |
(...skipping 24 matching lines...) Expand all Loading... |
763 LocationBarViewGtk::PageActionViewGtk* page_action_view) { | 763 LocationBarViewGtk::PageActionViewGtk* page_action_view) { |
764 ExtensionBrowserEventRouter::GetInstance()->PageActionExecuted( | 764 ExtensionBrowserEventRouter::GetInstance()->PageActionExecuted( |
765 page_action_view->profile_, | 765 page_action_view->profile_, |
766 page_action_view->page_action_->extension_id(), | 766 page_action_view->page_action_->extension_id(), |
767 page_action_view->page_action_->id(), | 767 page_action_view->page_action_->id(), |
768 page_action_view->current_tab_id_, | 768 page_action_view->current_tab_id_, |
769 page_action_view->current_url_.spec(), | 769 page_action_view->current_url_.spec(), |
770 event->button); | 770 event->button); |
771 return true; | 771 return true; |
772 } | 772 } |
OLD | NEW |