Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 295 kIconLeftSpacing + | 295 kIconLeftSpacing + |
| 296 (delegate && delegate->ShouldShowWindowIcon() ? | 296 (delegate && delegate->ShouldShowWindowIcon() ? |
| 297 (IconSize() + kTitleLogoSpacing) : 0); | 297 (IconSize() + kTitleLogoSpacing) : 0); |
| 298 #if !defined(OS_CHROMEOS) | 298 #if !defined(OS_CHROMEOS) |
| 299 min_titlebar_width += | 299 min_titlebar_width += |
| 300 minimize_button_->GetMinimumSize().width() + | 300 minimize_button_->GetMinimumSize().width() + |
| 301 restore_button_->GetMinimumSize().width() + | 301 restore_button_->GetMinimumSize().width() + |
| 302 close_button_->GetMinimumSize().width(); | 302 close_button_->GetMinimumSize().width(); |
| 303 #endif | 303 #endif |
| 304 min_size.set_width(std::max(min_size.width(), min_titlebar_width)); | 304 min_size.set_width(std::max(min_size.width(), min_titlebar_width)); |
| 305 | |
| 306 // Ensure that the minimum width is enough to hold a tab strip with minimum | |
| 307 // width at its usual insets. | |
| 308 if (browser_view_->IsTabStripVisible()) { | |
| 309 AbstractTabStripView* tabstrip = browser_view_->tabstrip(); | |
| 310 int min_tabstrip_width = tabstrip->GetMinimumSize().width(); | |
| 311 int min_tabstrip_area_width = | |
| 312 width() - GetBoundsForTabStrip(tabstrip).width() + min_tabstrip_width; | |
|
Peter Kasting
2011/10/06 20:31:33
This worries me because it is flexible. For examp
| |
| 313 min_size.set_width(std::max(min_tabstrip_area_width, min_size.width())); | |
| 314 } | |
| 315 | |
| 305 return min_size; | 316 return min_size; |
| 306 } | 317 } |
| 307 | 318 |
| 308 /////////////////////////////////////////////////////////////////////////////// | 319 /////////////////////////////////////////////////////////////////////////////// |
| 309 // OpaqueBrowserFrameView, views::NonClientFrameView implementation: | 320 // OpaqueBrowserFrameView, views::NonClientFrameView implementation: |
| 310 | 321 |
| 311 gfx::Rect OpaqueBrowserFrameView::GetBoundsForClientView() const { | 322 gfx::Rect OpaqueBrowserFrameView::GetBoundsForClientView() const { |
| 312 return client_view_bounds_; | 323 return client_view_bounds_; |
| 313 } | 324 } |
| 314 | 325 |
| (...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1137 g_browser_process->profile_manager()->GetProfileInfoCache(); | 1148 g_browser_process->profile_manager()->GetProfileInfoCache(); |
| 1138 Profile* profile = browser_view_->browser()->profile(); | 1149 Profile* profile = browser_view_->browser()->profile(); |
| 1139 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); | 1150 size_t index = cache.GetIndexOfProfileWithPath(profile->GetPath()); |
| 1140 if (index != std::string::npos) { | 1151 if (index != std::string::npos) { |
| 1141 avatar_button_->SetIcon(cache.GetAvatarIconOfProfileAtIndex(index)); | 1152 avatar_button_->SetIcon(cache.GetAvatarIconOfProfileAtIndex(index)); |
| 1142 avatar_button_->SetText(UTF16ToWideHack( | 1153 avatar_button_->SetText(UTF16ToWideHack( |
| 1143 cache.GetNameOfProfileAtIndex(index))); | 1154 cache.GetNameOfProfileAtIndex(index))); |
| 1144 } | 1155 } |
| 1145 } | 1156 } |
| 1146 } | 1157 } |
| OLD | NEW |