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_popup_gtk.h" | 5 #include "chrome/browser/ui/gtk/extensions/extension_popup_gtk.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 if (attached) { | 115 if (attached) { |
116 // Make sure that the popup won't go away when the inspector is activated. | 116 // Make sure that the popup won't go away when the inspector is activated. |
117 if (bubble_) | 117 if (bubble_) |
118 bubble_->StopGrabbingInput(); | 118 bubble_->StopGrabbingInput(); |
119 | 119 |
120 being_inspected_ = true; | 120 being_inspected_ = true; |
121 } else { | 121 } else { |
122 // If the devtools window is closing, we post a task to ourselves to | 122 // If the devtools window is closing, we post a task to ourselves to |
123 // close the popup. This gives the devtools window a chance to finish | 123 // close the popup. This gives the devtools window a chance to finish |
124 // detaching from the inspected RenderViewHost. | 124 // detaching from the inspected RenderViewHost. |
125 MessageLoop::current()->PostTask( | 125 base::MessageLoop::current()->PostTask( |
126 FROM_HERE, | 126 FROM_HERE, |
127 base::Bind(&ExtensionPopupGtk::DestroyPopupWithoutResult, | 127 base::Bind(&ExtensionPopupGtk::DestroyPopupWithoutResult, |
128 weak_factory_.GetWeakPtr())); | 128 weak_factory_.GetWeakPtr())); |
129 } | 129 } |
130 } | 130 } |
131 | 131 |
132 void ExtensionPopupGtk::BubbleClosing(BubbleGtk* bubble, | 132 void ExtensionPopupGtk::BubbleClosing(BubbleGtk* bubble, |
133 bool closed_by_escape) { | 133 bool closed_by_escape) { |
134 current_extension_popup_ = NULL; | 134 current_extension_popup_ = NULL; |
135 delete this; | 135 delete this; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 193 |
194 void ExtensionPopupGtk::DestroyPopupWithoutResult() { | 194 void ExtensionPopupGtk::DestroyPopupWithoutResult() { |
195 DestroyPopup(); | 195 DestroyPopup(); |
196 } | 196 } |
197 | 197 |
198 gfx::Rect ExtensionPopupGtk::GetViewBounds() { | 198 gfx::Rect ExtensionPopupGtk::GetViewBounds() { |
199 GtkAllocation allocation; | 199 GtkAllocation allocation; |
200 gtk_widget_get_allocation(host_->view()->native_view(), &allocation); | 200 gtk_widget_get_allocation(host_->view()->native_view(), &allocation); |
201 return gfx::Rect(allocation); | 201 return gfx::Rect(allocation); |
202 } | 202 } |
OLD | NEW |