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