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/bundle_installed_bubble_gtk.h" | 5 #include "chrome/browser/ui/gtk/extensions/bundle_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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 gtk_box_pack_start(GTK_BOX(parent), extension_label, false, false, | 124 gtk_box_pack_start(GTK_BOX(parent), extension_label, false, false, |
125 kListItemPadding); | 125 kListItemPadding); |
126 } | 126 } |
127 } | 127 } |
128 | 128 |
129 void BundleInstalledBubbleGtk::BubbleClosing(BubbleGtk* bubble, | 129 void BundleInstalledBubbleGtk::BubbleClosing(BubbleGtk* bubble, |
130 bool closed_by_escape) { | 130 bool closed_by_escape) { |
131 // We need to allow the bubble to close and remove the widgets from | 131 // We need to allow the bubble to close and remove the widgets from |
132 // the window before we call Release() because close_button_ depends | 132 // the window before we call Release() because close_button_ depends |
133 // on all references being cleared before it is destroyed. | 133 // on all references being cleared before it is destroyed. |
134 MessageLoopForUI::current()->PostTask( | 134 base::MessageLoopForUI::current()->PostTask( |
135 FROM_HERE, | 135 FROM_HERE, base::Bind(&BundleInstalledBubbleGtk::Close, this)); |
136 base::Bind(&BundleInstalledBubbleGtk::Close, this)); | |
137 } | 136 } |
138 | 137 |
139 void BundleInstalledBubbleGtk::Close() { | 138 void BundleInstalledBubbleGtk::Close() { |
140 bubble_ = NULL; | 139 bubble_ = NULL; |
141 | 140 |
142 Release(); // Balanced in BundleInstalledBubbleGtk(). | 141 Release(); // Balanced in BundleInstalledBubbleGtk(). |
143 } | 142 } |
144 | 143 |
145 void BundleInstalledBubbleGtk::OnButtonClick(GtkWidget* button, | 144 void BundleInstalledBubbleGtk::OnButtonClick(GtkWidget* button, |
146 BundleInstalledBubbleGtk* bubble) { | 145 BundleInstalledBubbleGtk* bubble) { |
147 if (button == bubble->close_button_->widget()) | 146 if (button == bubble->close_button_->widget()) |
148 bubble->bubble_->Close(); | 147 bubble->bubble_->Close(); |
149 else | 148 else |
150 NOTREACHED(); | 149 NOTREACHED(); |
151 } | 150 } |
OLD | NEW |