| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/views/frame/opaque_browser_frame_view.h" | 5 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 NOTREACHED() << "Got a notification we didn't register for!"; | 421 NOTREACHED() << "Got a notification we didn't register for!"; |
| 422 break; | 422 break; |
| 423 } | 423 } |
| 424 } | 424 } |
| 425 | 425 |
| 426 /////////////////////////////////////////////////////////////////////////////// | 426 /////////////////////////////////////////////////////////////////////////////// |
| 427 // OpaqueBrowserFrameView, OpaqueBrowserFrameViewLayoutDelegate implementation: | 427 // OpaqueBrowserFrameView, OpaqueBrowserFrameViewLayoutDelegate implementation: |
| 428 | 428 |
| 429 bool OpaqueBrowserFrameView::ShouldShowWindowIcon() const { | 429 bool OpaqueBrowserFrameView::ShouldShowWindowIcon() const { |
| 430 views::WidgetDelegate* delegate = frame()->widget_delegate(); | 430 views::WidgetDelegate* delegate = frame()->widget_delegate(); |
| 431 // ShouldShowTitleBar defaults to true. |
| 432 if (platform_observer_ && !platform_observer_->ShouldShowTitleBar()) |
| 433 return false; |
| 431 return delegate && delegate->ShouldShowWindowIcon(); | 434 return delegate && delegate->ShouldShowWindowIcon(); |
| 432 } | 435 } |
| 433 | 436 |
| 434 bool OpaqueBrowserFrameView::ShouldShowWindowTitle() const { | 437 bool OpaqueBrowserFrameView::ShouldShowWindowTitle() const { |
| 435 // |delegate| may be NULL if called from callback of InputMethodChanged while | 438 // |delegate| may be NULL if called from callback of InputMethodChanged while |
| 436 // a window is being destroyed. | 439 // a window is being destroyed. |
| 437 // See more discussion at http://crosbug.com/8958 | 440 // See more discussion at http://crosbug.com/8958 |
| 438 views::WidgetDelegate* delegate = frame()->widget_delegate(); | 441 views::WidgetDelegate* delegate = frame()->widget_delegate(); |
| 442 // ShouldShowTitleBar defaults to true. |
| 443 if (platform_observer_ && !platform_observer_->ShouldShowTitleBar()) |
| 444 return false; |
| 439 return delegate && delegate->ShouldShowWindowTitle(); | 445 return delegate && delegate->ShouldShowWindowTitle(); |
| 440 } | 446 } |
| 441 | 447 |
| 442 base::string16 OpaqueBrowserFrameView::GetWindowTitle() const { | 448 base::string16 OpaqueBrowserFrameView::GetWindowTitle() const { |
| 443 return frame()->widget_delegate()->GetWindowTitle(); | 449 return frame()->widget_delegate()->GetWindowTitle(); |
| 444 } | 450 } |
| 445 | 451 |
| 446 int OpaqueBrowserFrameView::GetIconSize() const { | 452 int OpaqueBrowserFrameView::GetIconSize() const { |
| 447 #if defined(OS_WIN) | 453 #if defined(OS_WIN) |
| 448 // This metric scales up if either the titlebar height or the titlebar font | 454 // This metric scales up if either the titlebar height or the titlebar font |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 894 | 900 |
| 895 int OpaqueBrowserFrameView::GetTopAreaHeight() const { | 901 int OpaqueBrowserFrameView::GetTopAreaHeight() const { |
| 896 gfx::ImageSkia* frame_image = GetFrameImage(); | 902 gfx::ImageSkia* frame_image = GetFrameImage(); |
| 897 int top_area_height = frame_image->height(); | 903 int top_area_height = frame_image->height(); |
| 898 if (browser_view()->IsTabStripVisible()) { | 904 if (browser_view()->IsTabStripVisible()) { |
| 899 top_area_height = std::max(top_area_height, | 905 top_area_height = std::max(top_area_height, |
| 900 GetBoundsForTabStrip(browser_view()->tabstrip()).bottom()); | 906 GetBoundsForTabStrip(browser_view()->tabstrip()).bottom()); |
| 901 } | 907 } |
| 902 return top_area_height; | 908 return top_area_height; |
| 903 } | 909 } |
| OLD | NEW |