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/xp_frame.h" | 5 #include "chrome/browser/xp_frame.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/gfx/native_theme.h" | 10 #include "base/gfx/native_theme.h" |
(...skipping 1872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1883 } | 1883 } |
1884 | 1884 |
1885 void XPFrame::ProfileChanged(Profile* profile) { | 1885 void XPFrame::ProfileChanged(Profile* profile) { |
1886 browser_view_->ProfileChanged(profile); | 1886 browser_view_->ProfileChanged(profile); |
1887 } | 1887 } |
1888 | 1888 |
1889 void XPFrame::FocusToolbar() { | 1889 void XPFrame::FocusToolbar() { |
1890 browser_view_->FocusToolbar(); | 1890 browser_view_->FocusToolbar(); |
1891 } | 1891 } |
1892 | 1892 |
| 1893 bool XPFrame::IsBookmarkBarVisible() const { |
| 1894 if (!bookmark_bar_view_.get()) |
| 1895 return false; |
| 1896 |
| 1897 if (bookmark_bar_view_->IsNewTabPage() || bookmark_bar_view_->IsAnimating()) |
| 1898 return true; |
| 1899 |
| 1900 CSize sz; |
| 1901 bookmark_bar_view_->GetPreferredSize(&sz); |
| 1902 // 1 is the minimum in GetPreferredSize for the bookmark bar. |
| 1903 return sz.cy > 1; |
| 1904 } |
| 1905 |
1893 void XPFrame::MoveToFront(bool should_activate) { | 1906 void XPFrame::MoveToFront(bool should_activate) { |
1894 int flags = SWP_NOMOVE | SWP_NOSIZE; | 1907 int flags = SWP_NOMOVE | SWP_NOSIZE; |
1895 if (!should_activate) { | 1908 if (!should_activate) { |
1896 flags |= SWP_NOACTIVATE; | 1909 flags |= SWP_NOACTIVATE; |
1897 } | 1910 } |
1898 SetWindowPos(HWND_TOP, 0, 0, 0, 0, flags); | 1911 SetWindowPos(HWND_TOP, 0, 0, 0, 0, flags); |
1899 SetForegroundWindow(*this); | 1912 SetForegroundWindow(*this); |
1900 } | 1913 } |
1901 | 1914 |
1902 HWND XPFrame::GetHWND() const { | 1915 HWND XPFrame::GetHWND() const { |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2490 | 2503 |
2491 // Only do a layout if the current contents is non-null. We assume that if the | 2504 // Only do a layout if the current contents is non-null. We assume that if the |
2492 // contents is NULL, we're either being destroyed, or ShowTabContents is going | 2505 // contents is NULL, we're either being destroyed, or ShowTabContents is going |
2493 // to be invoked with a non-null TabContents again so that there is no need | 2506 // to be invoked with a non-null TabContents again so that there is no need |
2494 // in doing a layout now (and would result in extra work/invalidation on | 2507 // in doing a layout now (and would result in extra work/invalidation on |
2495 // tab switches). | 2508 // tab switches). |
2496 if (changed && current_tab) | 2509 if (changed && current_tab) |
2497 Layout(); | 2510 Layout(); |
2498 } | 2511 } |
2499 | 2512 |
OLD | NEW |