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

Side by Side Diff: chrome/browser/ui/views/constrained_window_views.cc

Issue 11269022: Add Vector2d classes that represent offsets, instead of using Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: RenderText fixup Created 8 years, 1 month 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/views/constrained_window_views.h" 5 #include "chrome/browser/ui/views/constrained_window_views.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 DCHECK(enable_chrome_style_); 744 DCHECK(enable_chrome_style_);
745 ConstrainedWindowTabHelperDelegate* tab_helper_delegate = 745 ConstrainedWindowTabHelperDelegate* tab_helper_delegate =
746 ConstrainedWindowTabHelper::FromWebContents(web_contents_)->delegate(); 746 ConstrainedWindowTabHelper::FromWebContents(web_contents_)->delegate();
747 gfx::Point point; 747 gfx::Point point;
748 if (!tab_helper_delegate || 748 if (!tab_helper_delegate ||
749 !tab_helper_delegate->GetConstrainedWindowTopCenter(&point)) { 749 !tab_helper_delegate->GetConstrainedWindowTopCenter(&point)) {
750 Widget::CenterWindow(size); 750 Widget::CenterWindow(size);
751 return; 751 return;
752 } 752 }
753 753
754 SetBounds(gfx::Rect(point - gfx::Point(size.width() / 2, 0), size)); 754 SetBounds(gfx::Rect(point - gfx::Vector2d(size.width() / 2, 0), size));
755 } 755 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698