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 <vector> | 10 #include <vector> |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "chrome/browser/ui/gtk/extensions/extension_popup_gtk.h" | 29 #include "chrome/browser/ui/gtk/extensions/extension_popup_gtk.h" |
30 #include "chrome/browser/ui/gtk/gtk_chrome_button.h" | 30 #include "chrome/browser/ui/gtk/gtk_chrome_button.h" |
31 #include "chrome/browser/ui/gtk/gtk_chrome_shrinkable_hbox.h" | 31 #include "chrome/browser/ui/gtk/gtk_chrome_shrinkable_hbox.h" |
32 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 32 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
33 #include "chrome/browser/ui/gtk/gtk_util.h" | 33 #include "chrome/browser/ui/gtk/gtk_util.h" |
34 #include "chrome/browser/ui/gtk/hover_controller_gtk.h" | 34 #include "chrome/browser/ui/gtk/hover_controller_gtk.h" |
35 #include "chrome/browser/ui/gtk/menu_gtk.h" | 35 #include "chrome/browser/ui/gtk/menu_gtk.h" |
36 #include "chrome/browser/ui/gtk/view_id_util.h" | 36 #include "chrome/browser/ui/gtk/view_id_util.h" |
37 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 37 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
38 #include "chrome/common/extensions/extension.h" | 38 #include "chrome/common/extensions/extension.h" |
39 #include "chrome/common/extensions/extension_manifest_constants.h" | |
40 #include "content/public/browser/notification_details.h" | 39 #include "content/public/browser/notification_details.h" |
41 #include "content/public/browser/notification_source.h" | 40 #include "content/public/browser/notification_source.h" |
| 41 #include "extensions/common/manifest_constants.h" |
42 #include "grit/theme_resources.h" | 42 #include "grit/theme_resources.h" |
43 #include "grit/ui_resources.h" | 43 #include "grit/ui_resources.h" |
44 #include "ui/base/accelerators/platform_accelerator_gtk.h" | 44 #include "ui/base/accelerators/platform_accelerator_gtk.h" |
45 #include "ui/base/resource/resource_bundle.h" | 45 #include "ui/base/resource/resource_bundle.h" |
46 #include "ui/gfx/canvas_skia_paint.h" | 46 #include "ui/gfx/canvas_skia_paint.h" |
47 #include "ui/gfx/gtk_compat.h" | 47 #include "ui/gfx/gtk_compat.h" |
48 #include "ui/gfx/gtk_util.h" | 48 #include "ui/gfx/gtk_util.h" |
49 #include "ui/gfx/image/image.h" | 49 #include "ui/gfx/image/image.h" |
50 #include "ui/gfx/image/image_skia_operations.h" | 50 #include "ui/gfx/image/image_skia_operations.h" |
51 | 51 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 case chrome::NOTIFICATION_WINDOW_CLOSED: | 182 case chrome::NOTIFICATION_WINDOW_CLOSED: |
183 DisconnectBrowserActionPopupAccelerator(); | 183 DisconnectBrowserActionPopupAccelerator(); |
184 break; | 184 break; |
185 case chrome::NOTIFICATION_EXTENSION_COMMAND_ADDED: | 185 case chrome::NOTIFICATION_EXTENSION_COMMAND_ADDED: |
186 case chrome::NOTIFICATION_EXTENSION_COMMAND_REMOVED: { | 186 case chrome::NOTIFICATION_EXTENSION_COMMAND_REMOVED: { |
187 std::pair<const std::string, const std::string>* payload = | 187 std::pair<const std::string, const std::string>* payload = |
188 content::Details<std::pair<const std::string, const std::string> >( | 188 content::Details<std::pair<const std::string, const std::string> >( |
189 details).ptr(); | 189 details).ptr(); |
190 if (extension_->id() == payload->first && | 190 if (extension_->id() == payload->first && |
191 payload->second == | 191 payload->second == |
192 extension_manifest_values::kBrowserActionCommandEvent) { | 192 extensions::manifest_values::kBrowserActionCommandEvent) { |
193 if (type == chrome::NOTIFICATION_EXTENSION_COMMAND_ADDED) | 193 if (type == chrome::NOTIFICATION_EXTENSION_COMMAND_ADDED) |
194 ConnectBrowserActionPopupAccelerator(); | 194 ConnectBrowserActionPopupAccelerator(); |
195 else | 195 else |
196 DisconnectBrowserActionPopupAccelerator(); | 196 DisconnectBrowserActionPopupAccelerator(); |
197 } | 197 } |
198 break; | 198 break; |
199 } | 199 } |
200 default: | 200 default: |
201 NOTREACHED(); | 201 NOTREACHED(); |
202 break; | 202 break; |
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1093 | 1093 |
1094 menu->PopupAsContext(gfx::Point(event->x_root, event->y_root), | 1094 menu->PopupAsContext(gfx::Point(event->x_root, event->y_root), |
1095 event->time); | 1095 event->time); |
1096 return TRUE; | 1096 return TRUE; |
1097 } | 1097 } |
1098 | 1098 |
1099 void BrowserActionsToolbarGtk::OnButtonShowOrHide(GtkWidget* sender) { | 1099 void BrowserActionsToolbarGtk::OnButtonShowOrHide(GtkWidget* sender) { |
1100 if (!resize_animation_.is_animating()) | 1100 if (!resize_animation_.is_animating()) |
1101 UpdateChevronVisibility(); | 1101 UpdateChevronVisibility(); |
1102 } | 1102 } |
OLD | NEW |