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

Side by Side Diff: chrome/browser/views/frame/aero_glass_non_client_view.cc

Issue 7344: Convert GetPreferredSize from:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/frame/aero_glass_non_client_view.h" 5 #include "chrome/browser/views/frame/aero_glass_non_client_view.h"
6 6
7 #include "chrome/app/theme/theme_resources.h" 7 #include "chrome/app/theme/theme_resources.h"
8 #include "chrome/browser/views/frame/browser_view2.h" 8 #include "chrome/browser/views/frame/browser_view2.h"
9 #include "chrome/browser/views/tabs/tab_strip.h" 9 #include "chrome/browser/views/tabs/tab_strip.h"
10 #include "chrome/common/gfx/chrome_canvas.h" 10 #include "chrome/common/gfx/chrome_canvas.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 PaintClientEdge(canvas); 235 PaintClientEdge(canvas);
236 } 236 }
237 } 237 }
238 238
239 void AeroGlassNonClientView::Layout() { 239 void AeroGlassNonClientView::Layout() {
240 LayoutOTRAvatar(); 240 LayoutOTRAvatar();
241 LayoutDistributorLogo(); 241 LayoutDistributorLogo();
242 LayoutClientView(); 242 LayoutClientView();
243 } 243 }
244 244
245 void AeroGlassNonClientView::GetPreferredSize(CSize* out) { 245 gfx::Size AeroGlassNonClientView::GetPreferredSize() {
246 DCHECK(out); 246 gfx::Size prefsize = frame_->client_view()->GetPreferredSize();
247 frame_->client_view()->GetPreferredSize(out); 247 prefsize.Enlarge(2 * kWindowHorizontalClientEdgeWidth,
248 out->cx += 2 * kWindowHorizontalClientEdgeWidth; 248 CalculateNonClientTopHeight() +
249 out->cy += CalculateNonClientTopHeight() + kWindowBottomClientEdgeHeight; 249 kWindowBottomClientEdgeHeight);
250 return prefsize;
250 } 251 }
251 252
252 void AeroGlassNonClientView::DidChangeBounds(const CRect& previous, 253 void AeroGlassNonClientView::DidChangeBounds(const CRect& previous,
253 const CRect& current) { 254 const CRect& current) {
254 Layout(); 255 Layout();
255 } 256 }
256 257
257 void AeroGlassNonClientView::ViewHierarchyChanged(bool is_add, 258 void AeroGlassNonClientView::ViewHierarchyChanged(bool is_add,
258 ChromeViews::View* parent, 259 ChromeViews::View* parent,
259 ChromeViews::View* child) { 260 ChromeViews::View* child) {
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 resources_ = new AeroGlassWindowResources; 425 resources_ = new AeroGlassWindowResources;
425 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 426 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
426 SkBitmap* image = rb.GetBitmapNamed(IDR_DISTRIBUTOR_LOGO); 427 SkBitmap* image = rb.GetBitmapNamed(IDR_DISTRIBUTOR_LOGO);
427 if (!image->isNull()) 428 if (!image->isNull())
428 distributor_logo_ = *image; 429 distributor_logo_ = *image;
429 430
430 initialized = true; 431 initialized = true;
431 } 432 }
432 } 433 }
433 434
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698