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

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

Issue 1682603002: [UI Views] Don't allow a ButtonListener and a MenuButtonListener (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 window_title_->SetVisible(delegate_->ShouldShowWindowTitle()); 160 window_title_->SetVisible(delegate_->ShouldShowWindowTitle());
161 window_title_->SetEnabledColor(SK_ColorWHITE); 161 window_title_->SetEnabledColor(SK_ColorWHITE);
162 window_title_->SetSubpixelRenderingEnabled(false); 162 window_title_->SetSubpixelRenderingEnabled(false);
163 window_title_->SetHorizontalAlignment(gfx::ALIGN_LEFT); 163 window_title_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
164 window_title_->set_id(VIEW_ID_WINDOW_TITLE); 164 window_title_->set_id(VIEW_ID_WINDOW_TITLE);
165 root_view_->AddChildView(window_title_); 165 root_view_->AddChildView(window_title_);
166 } 166 }
167 167
168 void AddNewAvatarButton() { 168 void AddNewAvatarButton() {
169 new_avatar_button_ = 169 new_avatar_button_ =
170 new views::MenuButton(nullptr, base::string16(), nullptr, false); 170 new views::MenuButton(base::string16(), nullptr, false);
171 new_avatar_button_->set_id(VIEW_ID_NEW_AVATAR_BUTTON); 171 new_avatar_button_->set_id(VIEW_ID_NEW_AVATAR_BUTTON);
172 root_view_->AddChildView(new_avatar_button_); 172 root_view_->AddChildView(new_avatar_button_);
173 delegate_->set_show_avatar(true); 173 delegate_->set_show_avatar(true);
174 } 174 }
175 175
176 int CaptionY() const { 176 int CaptionY() const {
177 return delegate_->IsMaximized() ? 177 return delegate_->IsMaximized() ?
178 0 : views::NonClientFrameView::kFrameShadowThickness; 178 0 : views::NonClientFrameView::kFrameShadowThickness;
179 } 179 }
180 180
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 437
438 for (int i = 0; i < 2; ++i) { 438 for (int i = 0; i < 2; ++i) {
439 root_view_->Layout(); 439 root_view_->Layout();
440 SCOPED_TRACE(i == 0 ? "Window is restored" : "Window is maximized"); 440 SCOPED_TRACE(i == 0 ? "Window is restored" : "Window is maximized");
441 ExpectCaptionButtons(false, 0); 441 ExpectCaptionButtons(false, 0);
442 ExpectTabStripAndMinimumSize(false); 442 ExpectTabStripAndMinimumSize(false);
443 ExpectAvatar(); 443 ExpectAvatar();
444 delegate_->set_maximized(true); 444 delegate_->set_maximized(true);
445 } 445 }
446 } 446 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/content_setting_bubble_contents.cc ('k') | chrome/browser/ui/views/menu_model_adapter_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698