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/infobars/extension_infobar_gtk.h" | 5 #include "chrome/browser/ui/gtk/infobars/extension_infobar_gtk.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "chrome/browser/extensions/extension_context_menu_model.h" | 8 #include "chrome/browser/extensions/extension_context_menu_model.h" |
9 #include "chrome/browser/extensions/extension_host.h" | 9 #include "chrome/browser/extensions/extension_host.h" |
10 #include "chrome/browser/platform_util.h" | 10 #include "chrome/browser/platform_util.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 if (!browser) | 164 if (!browser) |
165 return NULL; | 165 return NULL; |
166 | 166 |
167 return new ExtensionContextMenuModel(extension, browser, NULL); | 167 return new ExtensionContextMenuModel(extension, browser, NULL); |
168 } | 168 } |
169 | 169 |
170 void ExtensionInfoBarGtk::OnSizeAllocate(GtkWidget* widget, | 170 void ExtensionInfoBarGtk::OnSizeAllocate(GtkWidget* widget, |
171 GtkAllocation* allocation) { | 171 GtkAllocation* allocation) { |
172 gfx::Size new_size(allocation->width, allocation->height); | 172 gfx::Size new_size(allocation->width, allocation->height); |
173 | 173 |
174 delegate_->extension_host()->view()->render_view_host()->view() | 174 delegate_->extension_host()->view()->render_view_host()->GetView() |
175 ->SetSize(new_size); | 175 ->SetSize(new_size); |
176 } | 176 } |
177 | 177 |
178 gboolean ExtensionInfoBarGtk::OnButtonPress(GtkWidget* widget, | 178 gboolean ExtensionInfoBarGtk::OnButtonPress(GtkWidget* widget, |
179 GdkEventButton* event) { | 179 GdkEventButton* event) { |
180 if (event->button != 1) | 180 if (event->button != 1) |
181 return FALSE; | 181 return FALSE; |
182 | 182 |
183 ui::MenuModel* model = BuildMenuModel(); | 183 ui::MenuModel* model = BuildMenuModel(); |
184 if (!model) | 184 if (!model) |
(...skipping 13 matching lines...) Expand all Loading... |
198 // We also need to draw our infobar arrows over the renderer. | 198 // We also need to draw our infobar arrows over the renderer. |
199 static_cast<InfoBarContainerGtk*>(container())-> | 199 static_cast<InfoBarContainerGtk*>(container())-> |
200 PaintInfobarBitsOn(sender, event, this); | 200 PaintInfobarBitsOn(sender, event, this); |
201 | 201 |
202 return FALSE; | 202 return FALSE; |
203 } | 203 } |
204 | 204 |
205 InfoBar* ExtensionInfoBarDelegate::CreateInfoBar(InfoBarTabHelper* owner) { | 205 InfoBar* ExtensionInfoBarDelegate::CreateInfoBar(InfoBarTabHelper* owner) { |
206 return new ExtensionInfoBarGtk(owner, this); | 206 return new ExtensionInfoBarGtk(owner, this); |
207 } | 207 } |
OLD | NEW |