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/opaque_non_client_view.h" | 5 #include "chrome/browser/views/frame/opaque_non_client_view.h" |
6 | 6 |
7 #include "chrome/app/theme/theme_resources.h" | 7 #include "chrome/app/theme/theme_resources.h" |
8 #include "chrome/browser/views/frame/browser_view.h" | 8 #include "chrome/browser/views/frame/browser_view.h" |
9 #include "chrome/browser/views/tabs/tab_strip.h" | 9 #include "chrome/browser/views/tabs/tab_strip.h" |
10 #include "chrome/common/gfx/chrome_font.h" | 10 #include "chrome/common/gfx/chrome_font.h" |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 client_bounds.height() + top_height + kWindowVerticalBorderBottomSize; | 460 client_bounds.height() + top_height + kWindowVerticalBorderBottomSize; |
461 return gfx::Rect(window_x, window_y, window_w, window_h); | 461 return gfx::Rect(window_x, window_y, window_w, window_h); |
462 } | 462 } |
463 | 463 |
464 gfx::Rect OpaqueNonClientView::GetBoundsForTabStrip(TabStrip* tabstrip) { | 464 gfx::Rect OpaqueNonClientView::GetBoundsForTabStrip(TabStrip* tabstrip) { |
465 int tabstrip_height = tabstrip->GetPreferredHeight(); | 465 int tabstrip_height = tabstrip->GetPreferredHeight(); |
466 int tabstrip_x = otr_avatar_bounds_.right(); | 466 int tabstrip_x = otr_avatar_bounds_.right(); |
467 int tabstrip_width = minimize_button_->x() - tabstrip_x; | 467 int tabstrip_width = minimize_button_->x() - tabstrip_x; |
468 if (frame_->IsMaximized()) | 468 if (frame_->IsMaximized()) |
469 tabstrip_width -= kNewTabIconWindowControlsSpacing; | 469 tabstrip_width -= kNewTabIconWindowControlsSpacing; |
470 return gfx::Rect(tabstrip_x, 0, tabstrip_width, tabstrip_height); | 470 return gfx::Rect(tabstrip_x, 0, std::max(0, tabstrip_width), |
| 471 tabstrip_height); |
471 } | 472 } |
472 | 473 |
473 void OpaqueNonClientView::UpdateWindowIcon() { | 474 void OpaqueNonClientView::UpdateWindowIcon() { |
474 if (window_icon_) | 475 if (window_icon_) |
475 window_icon_->Update(); | 476 window_icon_->Update(); |
476 } | 477 } |
477 | 478 |
478 /////////////////////////////////////////////////////////////////////////////// | 479 /////////////////////////////////////////////////////////////////////////////// |
479 // OpaqueNonClientView, TabIconView::TabContentsProvider implementation: | 480 // OpaqueNonClientView, TabIconView::TabContentsProvider implementation: |
480 | 481 |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1037 } | 1038 } |
1038 | 1039 |
1039 // static | 1040 // static |
1040 void OpaqueNonClientView::InitAppWindowResources() { | 1041 void OpaqueNonClientView::InitAppWindowResources() { |
1041 static bool initialized = false; | 1042 static bool initialized = false; |
1042 if (!initialized) { | 1043 if (!initialized) { |
1043 title_font_ = win_util::GetWindowTitleFont(); | 1044 title_font_ = win_util::GetWindowTitleFont(); |
1044 initialized = true; | 1045 initialized = true; |
1045 } | 1046 } |
1046 } | 1047 } |
OLD | NEW |