Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: chrome/browser/ui/gtk/extensions/extension_popup_gtk.cc

Issue 9702068: Move extension pop-ups and notifications to the new auto-resize code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: small update Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 NOTREACHED() << "Received unexpected notification"; 129 NOTREACHED() << "Received unexpected notification";
130 } 130 }
131 } 131 }
132 132
133 void ExtensionPopupGtk::BubbleClosing(BubbleGtk* bubble, 133 void ExtensionPopupGtk::BubbleClosing(BubbleGtk* bubble,
134 bool closed_by_escape) { 134 bool closed_by_escape) {
135 current_extension_popup_ = NULL; 135 current_extension_popup_ = NULL;
136 delete this; 136 delete this;
137 } 137 }
138 138
139 void ExtensionPopupGtk::OnExtensionPreferredSizeChanged( 139 void ExtensionPopupGtk::OnExtensionSizeChanged(
140 ExtensionViewGtk* view, 140 ExtensionViewGtk* view,
141 const gfx::Size& new_size) { 141 const gfx::Size& new_size) {
142 int width = std::max(kMinWidth, std::min(kMaxWidth, new_size.width())); 142 int width = std::max(kMinWidth, std::min(kMaxWidth, new_size.width()));
143 int height = std::max(kMinHeight, std::min(kMaxHeight, new_size.height())); 143 int height = std::max(kMinHeight, std::min(kMaxHeight, new_size.height()));
144 144
145 view->render_view_host()->GetView()->SetSize(gfx::Size(width, height)); 145 view->render_view_host()->GetView()->SetSize(gfx::Size(width, height));
146 gtk_widget_set_size_request(view->native_view(), width, height); 146 gtk_widget_set_size_request(view->native_view(), width, height);
147 } 147 }
148 148
149 bool ExtensionPopupGtk::DestroyPopup() { 149 bool ExtensionPopupGtk::DestroyPopup() {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 192
193 void ExtensionPopupGtk::DestroyPopupWithoutResult() { 193 void ExtensionPopupGtk::DestroyPopupWithoutResult() {
194 DestroyPopup(); 194 DestroyPopup();
195 } 195 }
196 196
197 gfx::Rect ExtensionPopupGtk::GetViewBounds() { 197 gfx::Rect ExtensionPopupGtk::GetViewBounds() {
198 GtkAllocation allocation; 198 GtkAllocation allocation;
199 gtk_widget_get_allocation(host_->view()->native_view(), &allocation); 199 gtk_widget_get_allocation(host_->view()->native_view(), &allocation);
200 return gfx::Rect(allocation); 200 return gfx::Rect(allocation);
201 } 201 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698