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

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

Issue 2616523004: Layout avatar button
Patch Set: More stuff Created 3 years, 11 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/containers/adapters.h" 8 #include "base/containers/adapters.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/profiles/profiles_state.h" 10 #include "chrome/browser/profiles/profiles_state.h"
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 // We set the icon bounds to a small rectangle in the top leading corner 326 // We set the icon bounds to a small rectangle in the top leading corner
327 // if there are no icons on the leading side. 327 // if there are no icons on the leading side.
328 const int frame_thickness = FrameBorderThickness(false); 328 const int frame_thickness = FrameBorderThickness(false);
329 window_icon_bounds_ = gfx::Rect( 329 window_icon_bounds_ = gfx::Rect(
330 frame_thickness + kIconLeftSpacing, frame_thickness, size, size); 330 frame_thickness + kIconLeftSpacing, frame_thickness, size, size);
331 } 331 }
332 } 332 }
333 } 333 }
334 334
335 void OpaqueBrowserFrameViewLayout::LayoutNewStyleAvatar(views::View* host) { 335 void OpaqueBrowserFrameViewLayout::LayoutNewStyleAvatar(views::View* host) {
336
336 if (!new_avatar_button_) 337 if (!new_avatar_button_)
337 return; 338 return;
338 339
339 int button_width = new_avatar_button_->GetPreferredSize().width(); 340 int button_width = new_avatar_button_->GetPreferredSize().width();
340 int button_width_with_offset = button_width + kCaptionSpacing; 341 int button_width_with_offset = button_width + kCaptionSpacing;
341 342
342 int button_x = 343 int button_x =
343 host->width() - trailing_button_start_ - button_width_with_offset; 344 host->width() - trailing_button_start_ - button_width_with_offset;
344 int button_y = CaptionButtonY(!IsTitleBarCondensed()); 345 int button_y = CaptionButtonY(!IsTitleBarCondensed());
345 346
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 602
602 void OpaqueBrowserFrameViewLayout::ViewAdded(views::View* host, 603 void OpaqueBrowserFrameViewLayout::ViewAdded(views::View* host,
603 views::View* view) { 604 views::View* view) {
604 SetView(view->id(), view); 605 SetView(view->id(), view);
605 } 606 }
606 607
607 void OpaqueBrowserFrameViewLayout::ViewRemoved(views::View* host, 608 void OpaqueBrowserFrameViewLayout::ViewRemoved(views::View* host,
608 views::View* view) { 609 views::View* view) {
609 SetView(view->id(), nullptr); 610 SetView(view->id(), nullptr);
610 } 611 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/native_browser_frame.h ('k') | chrome/browser/ui/views/profiles/new_avatar_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698