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

Side by Side Diff: chrome/browser/views/old_frames/simple_vista_frame.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/old_frames/simple_vista_frame.h" 5 #include "chrome/browser/views/old_frames/simple_vista_frame.h"
6 6
7 #include "chrome/app/theme/theme_resources.h" 7 #include "chrome/app/theme/theme_resources.h"
8 #include "chrome/browser/browser.h" 8 #include "chrome/browser/browser.h"
9 #include "chrome/browser/profile.h" 9 #include "chrome/browser/profile.h"
10 #include "chrome/browser/tab_contents.h" 10 #include "chrome/browser/tab_contents.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 196
197 void SimpleVistaFrame::Layout() { 197 void SimpleVistaFrame::Layout() {
198 VistaFrame::Layout(); 198 VistaFrame::Layout();
199 199
200 // This happens while executing Init(). 200 // This happens while executing Init().
201 if (!location_bar_) 201 if (!location_bar_)
202 return; 202 return;
203 203
204 if (browser_->ShouldDisplayURLField()) { 204 if (browser_->ShouldDisplayURLField()) {
205 TabContentsContainerView* container = GetTabContentsContainer(); 205 TabContentsContainerView* container = GetTabContentsContainer();
206 CSize s; 206 gfx::Size s = location_bar_->GetPreferredSize();
207 location_bar_->GetPreferredSize(&s);
208 location_bar_->SetBounds(container->x() - kLocationBarOutdent, 207 location_bar_->SetBounds(container->x() - kLocationBarOutdent,
209 container->y() - kLocationBarOutdent, 208 container->y() - kLocationBarOutdent,
210 container->width() + kLocationBarOutdent * 2, 209 container->width() + kLocationBarOutdent * 2,
211 s.cy); 210 s.height());
212 container->SetBounds(container->x(), 211 container->SetBounds(container->x(),
213 location_bar_->y() + location_bar_->height() - 212 location_bar_->y() + location_bar_->height() -
214 kLocationBarSpacing, container->width(), 213 kLocationBarSpacing, container->width(),
215 container->height() - location_bar_->height() + 214 container->height() - location_bar_->height() +
216 3); 215 3);
217 location_bar_->SetVisible(true); 216 location_bar_->SetVisible(true);
218 location_bar_->Layout(); 217 location_bar_->Layout();
219 } else { 218 } else {
220 location_bar_->SetVisible(false); 219 location_bar_->SetVisible(false);
221 } 220 }
222 } 221 }
223 222
224 void SimpleVistaFrame::InitAfterHWNDCreated() { 223 void SimpleVistaFrame::InitAfterHWNDCreated() {
225 icon_manager_.reset(new WebAppIconManager(*this)); 224 icon_manager_.reset(new WebAppIconManager(*this));
226 VistaFrame::InitAfterHWNDCreated(); 225 VistaFrame::InitAfterHWNDCreated();
227 } 226 }
228 227
229 TabContents* SimpleVistaFrame::GetTabContents() { 228 TabContents* SimpleVistaFrame::GetTabContents() {
230 return browser_->GetSelectedTabContents(); 229 return browser_->GetSelectedTabContents();
231 } 230 }
232 231
233 void SimpleVistaFrame::OnInputInProgress(bool in_progress) { 232 void SimpleVistaFrame::OnInputInProgress(bool in_progress) {
234 } 233 }
235 234
236 void SimpleVistaFrame::UpdateLocationBar() { 235 void SimpleVistaFrame::UpdateLocationBar() {
237 if (location_bar_ && location_bar_->IsVisible()) 236 if (location_bar_ && location_bar_->IsVisible())
238 location_bar_->Update(NULL); 237 location_bar_->Update(NULL);
239 } 238 }
240 239
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698