| OLD | NEW | 
|     1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |     1 // Copyright (c) 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/browser_actions_toolbar_gtk.h" |     5 #include "chrome/browser/ui/gtk/browser_actions_toolbar_gtk.h" | 
|     6  |     6  | 
|     7 #include <gtk/gtk.h> |     7 #include <gtk/gtk.h> | 
|     8  |     8  | 
|     9 #include <algorithm> |     9 #include <algorithm> | 
|    10 #include <utility> |    10 #include <utility> | 
| (...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1060       gtk_chrome_shrinkable_hbox_get_visible_child_count( |  1060       gtk_chrome_shrinkable_hbox_get_visible_child_count( | 
|  1061           GTK_CHROME_SHRINKABLE_HBOX(button_hbox_.get())); |  1061           GTK_CHROME_SHRINKABLE_HBOX(button_hbox_.get())); | 
|  1062   for (int i = visible_icon_count; i < button_count(); ++i) { |  1062   for (int i = visible_icon_count; i < button_count(); ++i) { | 
|  1063     int model_index = i; |  1063     int model_index = i; | 
|  1064     if (profile_->IsOffTheRecord()) |  1064     if (profile_->IsOffTheRecord()) | 
|  1065       model_index = model_->IncognitoIndexToOriginal(i); |  1065       model_index = model_->IncognitoIndexToOriginal(i); | 
|  1066  |  1066  | 
|  1067     const Extension* extension = model_->toolbar_items()[model_index].get(); |  1067     const Extension* extension = model_->toolbar_items()[model_index].get(); | 
|  1068     BrowserActionButton* button = extension_button_map_[extension->id()].get(); |  1068     BrowserActionButton* button = extension_button_map_[extension->id()].get(); | 
|  1069  |  1069  | 
|  1070     overflow_menu_model_->AddItem(model_index, UTF8ToUTF16(extension->name())); |  1070     overflow_menu_model_->AddItem(model_index, | 
 |  1071                                   base::UTF8ToUTF16(extension->name())); | 
|  1071     overflow_menu_model_->SetIcon(overflow_menu_model_->GetItemCount() - 1, |  1072     overflow_menu_model_->SetIcon(overflow_menu_model_->GetItemCount() - 1, | 
|  1072                                   button->GetIcon()); |  1073                                   button->GetIcon()); | 
|  1073  |  1074  | 
|  1074     // TODO(estade): set the menu item's tooltip. |  1075     // TODO(estade): set the menu item's tooltip. | 
|  1075   } |  1076   } | 
|  1076  |  1077  | 
|  1077   overflow_menu_.reset(new MenuGtk(this, overflow_menu_model_.get())); |  1078   overflow_menu_.reset(new MenuGtk(this, overflow_menu_model_.get())); | 
|  1078   signals_.Connect(overflow_menu_->widget(), "button-press-event", |  1079   signals_.Connect(overflow_menu_->widget(), "button-press-event", | 
|  1079                    G_CALLBACK(OnOverflowMenuButtonPressThunk), this); |  1080                    G_CALLBACK(OnOverflowMenuButtonPressThunk), this); | 
|  1080  |  1081  | 
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1117  |  1118  | 
|  1118   menu->PopupAsContext(gfx::Point(event->x_root, event->y_root), |  1119   menu->PopupAsContext(gfx::Point(event->x_root, event->y_root), | 
|  1119                        event->time); |  1120                        event->time); | 
|  1120   return TRUE; |  1121   return TRUE; | 
|  1121 } |  1122 } | 
|  1122  |  1123  | 
|  1123 void BrowserActionsToolbarGtk::OnButtonShowOrHide(GtkWidget* sender) { |  1124 void BrowserActionsToolbarGtk::OnButtonShowOrHide(GtkWidget* sender) { | 
|  1124   if (!resize_animation_.is_animating()) |  1125   if (!resize_animation_.is_animating()) | 
|  1125     UpdateChevronVisibility(); |  1126     UpdateChevronVisibility(); | 
|  1126 } |  1127 } | 
| OLD | NEW |