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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 current_extension_popup_ = NULL; | 133 current_extension_popup_ = NULL; |
134 delete this; | 134 delete this; |
135 } | 135 } |
136 | 136 |
137 void ExtensionPopupGtk::OnExtensionPreferredSizeChanged( | 137 void ExtensionPopupGtk::OnExtensionPreferredSizeChanged( |
138 ExtensionViewGtk* view, | 138 ExtensionViewGtk* view, |
139 const gfx::Size& new_size) { | 139 const gfx::Size& new_size) { |
140 int width = std::max(kMinWidth, std::min(kMaxWidth, new_size.width())); | 140 int width = std::max(kMinWidth, std::min(kMaxWidth, new_size.width())); |
141 int height = std::max(kMinHeight, std::min(kMaxHeight, new_size.height())); | 141 int height = std::max(kMinHeight, std::min(kMaxHeight, new_size.height())); |
142 | 142 |
143 view->render_view_host()->view()->SetSize(gfx::Size(width, height)); | 143 view->render_view_host()->GetView()->SetSize(gfx::Size(width, height)); |
144 gtk_widget_set_size_request(view->native_view(), width, height); | 144 gtk_widget_set_size_request(view->native_view(), width, height); |
145 } | 145 } |
146 | 146 |
147 bool ExtensionPopupGtk::DestroyPopup() { | 147 bool ExtensionPopupGtk::DestroyPopup() { |
148 if (!bubble_) { | 148 if (!bubble_) { |
149 NOTREACHED(); | 149 NOTREACHED(); |
150 return false; | 150 return false; |
151 } | 151 } |
152 | 152 |
153 bubble_->Close(); | 153 bubble_->Close(); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 190 |
191 void ExtensionPopupGtk::DestroyPopupWithoutResult() { | 191 void ExtensionPopupGtk::DestroyPopupWithoutResult() { |
192 DestroyPopup(); | 192 DestroyPopup(); |
193 } | 193 } |
194 | 194 |
195 gfx::Rect ExtensionPopupGtk::GetViewBounds() { | 195 gfx::Rect ExtensionPopupGtk::GetViewBounds() { |
196 GtkAllocation allocation; | 196 GtkAllocation allocation; |
197 gtk_widget_get_allocation(host_->view()->native_view(), &allocation); | 197 gtk_widget_get_allocation(host_->view()->native_view(), &allocation); |
198 return gfx::Rect(allocation); | 198 return gfx::Rect(allocation); |
199 } | 199 } |
OLD | NEW |