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/extensions/image_loader.h" | 10 #include "chrome/browser/extensions/image_loader.h" |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 } | 219 } |
220 | 220 |
221 gboolean ExtensionInfoBarGtk::OnButtonPress(GtkWidget* widget, | 221 gboolean ExtensionInfoBarGtk::OnButtonPress(GtkWidget* widget, |
222 GdkEventButton* event) { | 222 GdkEventButton* event) { |
223 if (event->button != 1) | 223 if (event->button != 1) |
224 return FALSE; | 224 return FALSE; |
225 | 225 |
226 DCHECK(button_); | 226 DCHECK(button_); |
227 | 227 |
228 context_menu_model_ = BuildMenuModel(); | 228 context_menu_model_ = BuildMenuModel(); |
229 if (!context_menu_model_) | 229 if (!context_menu_model_.get()) |
230 return FALSE; | 230 return FALSE; |
231 | 231 |
232 gtk_chrome_button_set_paint_state(GTK_CHROME_BUTTON(widget), | 232 gtk_chrome_button_set_paint_state(GTK_CHROME_BUTTON(widget), |
233 GTK_STATE_ACTIVE); | 233 GTK_STATE_ACTIVE); |
234 ShowMenuWithModel(widget, this, context_menu_model_); | 234 ShowMenuWithModel(widget, this, context_menu_model_.get()); |
235 | 235 |
236 return TRUE; | 236 return TRUE; |
237 } | 237 } |
238 | 238 |
239 gboolean ExtensionInfoBarGtk::OnExpose(GtkWidget* sender, | 239 gboolean ExtensionInfoBarGtk::OnExpose(GtkWidget* sender, |
240 GdkEventExpose* event) { | 240 GdkEventExpose* event) { |
241 TRACE_EVENT0("ui::gtk", "ExtensionInfoBarGtk::OnExpose"); | 241 TRACE_EVENT0("ui::gtk", "ExtensionInfoBarGtk::OnExpose"); |
242 | 242 |
243 // We also need to draw our infobar arrows over the renderer. | 243 // We also need to draw our infobar arrows over the renderer. |
244 static_cast<InfoBarContainerGtk*>(container())-> | 244 static_cast<InfoBarContainerGtk*>(container())-> |
245 PaintInfobarBitsOn(sender, event, this); | 245 PaintInfobarBitsOn(sender, event, this); |
246 | 246 |
247 return FALSE; | 247 return FALSE; |
248 } | 248 } |
OLD | NEW |