Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Side by Side Diff: chrome/browser/ui/views/frame/opaque_browser_frame_view_layout_unittest.cc

Issue 2523783002: Top Chrome MD cleanup - get rid of most of GetLayoutInsets. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_layout.h" 5 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/ui/layout_constants.h" 10 #include "chrome/browser/ui/layout_constants.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 void ExpectTabStripAndMinimumSize(bool caption_buttons_on_left) { 229 void ExpectTabStripAndMinimumSize(bool caption_buttons_on_left) {
230 int caption_buttons_width = kCaptionButtonsWidth; 230 int caption_buttons_width = kCaptionButtonsWidth;
231 bool show_caption_buttons = delegate_->ShouldShowCaptionButtons(); 231 bool show_caption_buttons = delegate_->ShouldShowCaptionButtons();
232 bool maximized = delegate_->IsMaximized() || !show_caption_buttons; 232 bool maximized = delegate_->IsMaximized() || !show_caption_buttons;
233 if (avatar_button_) { 233 if (avatar_button_) {
234 caption_buttons_width += 234 caption_buttons_width +=
235 avatar_button_->GetPreferredSize().width() + 235 avatar_button_->GetPreferredSize().width() +
236 (maximized ? OBFVL::kCaptionSpacing 236 (maximized ? OBFVL::kCaptionSpacing
237 : -GetLayoutSize(NEW_TAB_BUTTON).width()); 237 : -GetLayoutSize(NEW_TAB_BUTTON).width());
238 } 238 }
239 int tabstrip_x = GetLayoutInsets(AVATAR_ICON).right(); 239 int tabstrip_x = GetLayoutConstant(AVATAR_ICON_PADDING);
240 if (show_caption_buttons && caption_buttons_on_left) { 240 if (show_caption_buttons && caption_buttons_on_left) {
241 int right_of_close = 241 int right_of_close =
242 maximized ? kMaximizedExtraCloseWidth : OBFVL::kFrameBorderThickness; 242 maximized ? kMaximizedExtraCloseWidth : OBFVL::kFrameBorderThickness;
243 tabstrip_x += caption_buttons_width + right_of_close; 243 tabstrip_x += caption_buttons_width + right_of_close;
244 } else if (!maximized) { 244 } else if (!maximized) {
245 tabstrip_x += kNonClientBorderThickness; 245 tabstrip_x += kNonClientBorderThickness;
246 } 246 }
247 gfx::Size tabstrip_min_size(delegate_->GetTabstripPreferredSize()); 247 gfx::Size tabstrip_min_size(delegate_->GetTabstripPreferredSize());
248 gfx::Rect tabstrip_bounds( 248 gfx::Rect tabstrip_bounds(
249 layout_manager_->GetBoundsForTabStrip(tabstrip_min_size, kWindowWidth)); 249 layout_manager_->GetBoundsForTabStrip(tabstrip_min_size, kWindowWidth));
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 426
427 for (int i = 0; i < 2; ++i) { 427 for (int i = 0; i < 2; ++i) {
428 root_view_->Layout(); 428 root_view_->Layout();
429 SCOPED_TRACE(i == 0 ? "Window is restored" : "Window is maximized"); 429 SCOPED_TRACE(i == 0 ? "Window is restored" : "Window is maximized");
430 ExpectCaptionButtons(false, 0); 430 ExpectCaptionButtons(false, 0);
431 ExpectTabStripAndMinimumSize(false); 431 ExpectTabStripAndMinimumSize(false);
432 ExpectAvatar(); 432 ExpectAvatar();
433 delegate_->set_maximized(true); 433 delegate_->set_maximized(true);
434 } 434 }
435 } 435 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698