| 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/tabs/tab_strip.h" | 10 #include "chrome/browser/tabs/tab_strip.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 } | 181 } |
| 182 | 182 |
| 183 void BrowserView::FocusToolbar() { | 183 void BrowserView::FocusToolbar() { |
| 184 toolbar_->RequestFocus(); | 184 toolbar_->RequestFocus(); |
| 185 } | 185 } |
| 186 | 186 |
| 187 void BrowserView::DestroyBrowser() { | 187 void BrowserView::DestroyBrowser() { |
| 188 frame_->DestroyBrowser(); | 188 frame_->DestroyBrowser(); |
| 189 } | 189 } |
| 190 | 190 |
| 191 bool BrowserView::IsBookmarkBarVisible() const { |
| 192 BookmarkBarView* bookmark_bar_view = frame_->GetBookmarkBarView(); |
| 193 if (!bookmark_bar_view) |
| 194 return false; |
| 195 |
| 196 if (bookmark_bar_view->IsNewTabPage() || bookmark_bar_view->IsAnimating()) |
| 197 return true; |
| 198 |
| 199 CSize sz; |
| 200 bookmark_bar_view->GetPreferredSize(&sz); |
| 201 // 1 is the minimum in GetPreferredSize for the bookmark bar. |
| 202 return sz.cy > 1; |
| 203 } |
| 204 |
| 191 /////////////////////////////////////////////////////////////////////////////// | 205 /////////////////////////////////////////////////////////////////////////////// |
| 192 // BrowserView, ChromeViews::ClientView overrides: | 206 // BrowserView, ChromeViews::ClientView overrides: |
| 193 | 207 |
| 194 /* | 208 /* |
| 195 bool BrowserView::CanClose() const { | 209 bool BrowserView::CanClose() const { |
| 196 return true; | 210 return true; |
| 197 } | 211 } |
| 198 | 212 |
| 199 int BrowserView::NonClientHitTest(const gfx::Point& point) { | 213 int BrowserView::NonClientHitTest(const gfx::Point& point) { |
| 200 return HTCLIENT; | 214 return HTCLIENT; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 217 ChromeViews::View* parent, | 231 ChromeViews::View* parent, |
| 218 ChromeViews::View* child) { | 232 ChromeViews::View* child) { |
| 219 if (is_add && child == this && GetViewContainer() && !initialized_) { | 233 if (is_add && child == this && GetViewContainer() && !initialized_) { |
| 220 Init(); | 234 Init(); |
| 221 // Make sure not to call Init() twice if we get inserted into a different | 235 // Make sure not to call Init() twice if we get inserted into a different |
| 222 // ViewContainer. | 236 // ViewContainer. |
| 223 initialized_ = true; | 237 initialized_ = true; |
| 224 } | 238 } |
| 225 } | 239 } |
| 226 | 240 |
| OLD | NEW |