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

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

Issue 1682373002: Misc. small changes in preparation for moving popup mode edge drawing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build Created 4 years, 10 months 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 (delegate_->IsMaximized() ? kMaximizedExtraCloseWidth 183 (delegate_->IsMaximized() ? kMaximizedExtraCloseWidth
184 : OBFVL::kFrameBorderThickness) - 184 : OBFVL::kFrameBorderThickness) -
185 kCaptionButtonsWidth - OBFVL::kCaptionSpacing; 185 kCaptionButtonsWidth - OBFVL::kCaptionSpacing;
186 } 186 }
187 187
188 int IconAndTitleY() const { 188 int IconAndTitleY() const {
189 // This approximates the real positioning algorithm, which is complicated. 189 // This approximates the real positioning algorithm, which is complicated.
190 int total_vertical_padding = 190 int total_vertical_padding =
191 (delegate_->IsMaximized() || !delegate_->ShouldShowCaptionButtons()) ? 191 (delegate_->IsMaximized() || !delegate_->ShouldShowCaptionButtons()) ?
192 (kCaptionButtonHeight - delegate_->GetIconSize()) : 192 (kCaptionButtonHeight - delegate_->GetIconSize()) :
193 (OBFVL::kFrameBorderThickness + 193 (OBFVL::kFrameBorderThickness + OBFVL::kTitlebarTopEdgeThickness);
194 OBFVL::kTitlebarTopAndBottomEdgeThickness);
195 return (total_vertical_padding + 1) / 2; 194 return (total_vertical_padding + 1) / 2;
196 } 195 }
197 196
198 void ExpectCaptionButtons(bool caption_buttons_on_left, int extra_height) { 197 void ExpectCaptionButtons(bool caption_buttons_on_left, int extra_height) {
199 if (!delegate_->ShouldShowCaptionButtons()) { 198 if (!delegate_->ShouldShowCaptionButtons()) {
200 EXPECT_FALSE(maximize_button_->visible()); 199 EXPECT_FALSE(maximize_button_->visible());
201 EXPECT_FALSE(minimize_button_->visible()); 200 EXPECT_FALSE(minimize_button_->visible());
202 EXPECT_FALSE(restore_button_->visible()); 201 EXPECT_FALSE(restore_button_->visible());
203 EXPECT_FALSE(close_button_->visible()); 202 EXPECT_FALSE(close_button_->visible());
204 return; 203 return;
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 436
438 for (int i = 0; i < 2; ++i) { 437 for (int i = 0; i < 2; ++i) {
439 root_view_->Layout(); 438 root_view_->Layout();
440 SCOPED_TRACE(i == 0 ? "Window is restored" : "Window is maximized"); 439 SCOPED_TRACE(i == 0 ? "Window is restored" : "Window is maximized");
441 ExpectCaptionButtons(false, 0); 440 ExpectCaptionButtons(false, 0);
442 ExpectTabStripAndMinimumSize(false); 441 ExpectTabStripAndMinimumSize(false);
443 ExpectAvatar(); 442 ExpectAvatar();
444 delegate_->set_maximized(true); 443 delegate_->set_maximized(true);
445 } 444 }
446 } 445 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698