| 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/extensions/extension_installed_bubble_gtk.h" | 5 #include "chrome/browser/ui/gtk/extensions/extension_installed_bubble_gtk.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 // Manage label. | 313 // Manage label. |
| 314 GtkWidget* manage_label = gtk_label_new( | 314 GtkWidget* manage_label = gtk_label_new( |
| 315 l10n_util::GetStringUTF8(IDS_EXTENSION_INSTALLED_MANAGE_INFO).c_str()); | 315 l10n_util::GetStringUTF8(IDS_EXTENSION_INSTALLED_MANAGE_INFO).c_str()); |
| 316 gtk_util::SetLabelWidth(manage_label, kTextColumnWidth); | 316 gtk_util::SetLabelWidth(manage_label, kTextColumnWidth); |
| 317 gtk_box_pack_start(GTK_BOX(text_column), manage_label, FALSE, FALSE, 0); | 317 gtk_box_pack_start(GTK_BOX(text_column), manage_label, FALSE, FALSE, 0); |
| 318 } | 318 } |
| 319 | 319 |
| 320 // Create and pack the close button. | 320 // Create and pack the close button. |
| 321 GtkWidget* close_column = gtk_vbox_new(FALSE, 0); | 321 GtkWidget* close_column = gtk_vbox_new(FALSE, 0); |
| 322 gtk_box_pack_start(GTK_BOX(bubble_content), close_column, FALSE, FALSE, 0); | 322 gtk_box_pack_start(GTK_BOX(bubble_content), close_column, FALSE, FALSE, 0); |
| 323 close_button_.reset(CustomDrawButton::CloseButton(theme_provider)); | 323 close_button_.reset(CustomDrawButton::CloseButtonBubble(theme_provider)); |
| 324 g_signal_connect(close_button_->widget(), "clicked", | 324 g_signal_connect(close_button_->widget(), "clicked", |
| 325 G_CALLBACK(OnButtonClick), this); | 325 G_CALLBACK(OnButtonClick), this); |
| 326 gtk_box_pack_start(GTK_BOX(close_column), close_button_->widget(), | 326 gtk_box_pack_start(GTK_BOX(close_column), close_button_->widget(), |
| 327 FALSE, FALSE, 0); | 327 FALSE, FALSE, 0); |
| 328 | 328 |
| 329 BubbleGtk::FrameStyle frame_style = BubbleGtk::ANCHOR_TOP_RIGHT; | 329 BubbleGtk::FrameStyle frame_style = BubbleGtk::ANCHOR_TOP_RIGHT; |
| 330 | 330 |
| 331 gfx::Rect bounds = gtk_util::WidgetBounds(reference_widget); | 331 gfx::Rect bounds = gtk_util::WidgetBounds(reference_widget); |
| 332 if (type_ == OMNIBOX_KEYWORD) { | 332 if (type_ == OMNIBOX_KEYWORD) { |
| 333 // Reverse the arrow for omnibox keywords, since the bubble will be on the | 333 // Reverse the arrow for omnibox keywords, since the bubble will be on the |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 // on all references being cleared before it is destroyed. | 391 // on all references being cleared before it is destroyed. |
| 392 MessageLoopForUI::current()->PostTask( | 392 MessageLoopForUI::current()->PostTask( |
| 393 FROM_HERE, | 393 FROM_HERE, |
| 394 base::Bind(&ExtensionInstalledBubbleGtk::Close, this)); | 394 base::Bind(&ExtensionInstalledBubbleGtk::Close, this)); |
| 395 } | 395 } |
| 396 | 396 |
| 397 void ExtensionInstalledBubbleGtk::Close() { | 397 void ExtensionInstalledBubbleGtk::Close() { |
| 398 Release(); // Balanced in ctor. | 398 Release(); // Balanced in ctor. |
| 399 bubble_ = NULL; | 399 bubble_ = NULL; |
| 400 } | 400 } |
| OLD | NEW |