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

Side by Side Diff: chrome/browser/views/browser_bubble.cc

Issue 295051: Constrain extension popups to a min/max size (Closed)
Patch Set: Created 11 years, 2 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/views/browser_bubble.h" 5 #include "chrome/browser/views/browser_bubble.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "chrome/browser/views/frame/browser_view.h" 8 #include "chrome/browser/views/frame/browser_view.h"
9 #include "views/widget/root_view.h" 9 #include "views/widget/root_view.h"
10 #include "views/window/window.h" 10 #include "views/window/window.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 void BrowserBubble::Reposition() { 88 void BrowserBubble::Reposition() {
89 gfx::Point top_left; 89 gfx::Point top_left;
90 views::View::ConvertPointToScreen(frame_->GetRootView(), &top_left); 90 views::View::ConvertPointToScreen(frame_->GetRootView(), &top_left);
91 MovePopup(top_left.x() + bounds_.x(), 91 MovePopup(top_left.x() + bounds_.x(),
92 top_left.y() + bounds_.y(), 92 top_left.y() + bounds_.y(),
93 bounds_.width(), 93 bounds_.width(),
94 bounds_.height()); 94 bounds_.height());
95 } 95 }
96 96
97 void BrowserBubble::ResizeToView() { 97 void BrowserBubble::ResizeToView() {
98 gfx::Size size = view_->GetPreferredSize(); 98 SetBounds(bounds_.x(), bounds_.y(), view_->width(), view_->height());
99 SetBounds(bounds_.x(), bounds_.y(), size.width(), size.height());
100 } 99 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698