OLD | NEW |
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/browser_view.h" | 5 #include "chrome/browser/views/frame/browser_view.h" |
6 | 6 |
7 #include "chrome/browser/browser.h" | 7 #include "chrome/browser/browser.h" |
8 #include "chrome/browser/profile.h" | 8 #include "chrome/browser/profile.h" |
9 #include "chrome/browser/tab_contents.h" | 9 #include "chrome/browser/tab_contents.h" |
10 #include "chrome/browser/view_ids.h" | 10 #include "chrome/browser/view_ids.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 } | 189 } |
190 | 190 |
191 bool BrowserView::IsBookmarkBarVisible() const { | 191 bool BrowserView::IsBookmarkBarVisible() const { |
192 BookmarkBarView* bookmark_bar_view = frame_->GetBookmarkBarView(); | 192 BookmarkBarView* bookmark_bar_view = frame_->GetBookmarkBarView(); |
193 if (!bookmark_bar_view) | 193 if (!bookmark_bar_view) |
194 return false; | 194 return false; |
195 | 195 |
196 if (bookmark_bar_view->IsNewTabPage() || bookmark_bar_view->IsAnimating()) | 196 if (bookmark_bar_view->IsNewTabPage() || bookmark_bar_view->IsAnimating()) |
197 return true; | 197 return true; |
198 | 198 |
199 CSize sz; | |
200 bookmark_bar_view->GetPreferredSize(&sz); | |
201 // 1 is the minimum in GetPreferredSize for the bookmark bar. | 199 // 1 is the minimum in GetPreferredSize for the bookmark bar. |
202 return sz.cy > 1; | 200 return bookmark_bar_view->GetPreferredSize().height() > 1; |
203 } | 201 } |
204 | 202 |
205 /////////////////////////////////////////////////////////////////////////////// | 203 /////////////////////////////////////////////////////////////////////////////// |
206 // BrowserView, ChromeViews::ClientView overrides: | 204 // BrowserView, ChromeViews::ClientView overrides: |
207 | 205 |
208 /* | 206 /* |
209 bool BrowserView::CanClose() const { | 207 bool BrowserView::CanClose() const { |
210 return true; | 208 return true; |
211 } | 209 } |
212 | 210 |
(...skipping 18 matching lines...) Expand all Loading... |
231 ChromeViews::View* parent, | 229 ChromeViews::View* parent, |
232 ChromeViews::View* child) { | 230 ChromeViews::View* child) { |
233 if (is_add && child == this && GetViewContainer() && !initialized_) { | 231 if (is_add && child == this && GetViewContainer() && !initialized_) { |
234 Init(); | 232 Init(); |
235 // Make sure not to call Init() twice if we get inserted into a different | 233 // Make sure not to call Init() twice if we get inserted into a different |
236 // ViewContainer. | 234 // ViewContainer. |
237 initialized_ = true; | 235 initialized_ = true; |
238 } | 236 } |
239 } | 237 } |
240 | 238 |
OLD | NEW |