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

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

Issue 1785643002: Update avatar icon when nonclient frame view is added to view hierarchy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More consistent calling of GetNativeWindow() Created 4 years, 9 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/browser_non_client_frame_view_ash.h" 5 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/ash_layout_constants.h" 9 #include "ash/ash_layout_constants.h"
10 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" 10 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 AddChildView(caption_button_container_); 109 AddChildView(caption_button_container_);
110 110
111 // Initializing the TabIconView is expensive, so only do it if we need to. 111 // Initializing the TabIconView is expensive, so only do it if we need to.
112 if (browser_view()->ShouldShowWindowIcon()) { 112 if (browser_view()->ShouldShowWindowIcon()) {
113 window_icon_ = new TabIconView(this, nullptr); 113 window_icon_ = new TabIconView(this, nullptr);
114 window_icon_->set_is_light(true); 114 window_icon_->set_is_light(true);
115 AddChildView(window_icon_); 115 AddChildView(window_icon_);
116 window_icon_->Update(); 116 window_icon_->Update();
117 } 117 }
118 118
119 UpdateAvatar();
120
121 if (UsePackagedAppHeaderStyle() || UseWebAppHeaderStyle()) { 119 if (UsePackagedAppHeaderStyle() || UseWebAppHeaderStyle()) {
122 ash::DefaultHeaderPainter* header_painter = new ash::DefaultHeaderPainter; 120 ash::DefaultHeaderPainter* header_painter = new ash::DefaultHeaderPainter;
123 header_painter_.reset(header_painter); 121 header_painter_.reset(header_painter);
124 header_painter->Init(frame(), this, caption_button_container_); 122 header_painter->Init(frame(), this, caption_button_container_);
125 if (UseWebAppHeaderStyle()) { 123 if (UseWebAppHeaderStyle()) {
126 web_app_left_header_view_ = new WebAppLeftHeaderView(browser_view()); 124 web_app_left_header_view_ = new WebAppLeftHeaderView(browser_view());
127 AddChildView(web_app_left_header_view_); 125 AddChildView(web_app_left_header_view_);
128 header_painter->UpdateLeftHeaderView(web_app_left_header_view_); 126 header_painter->UpdateLeftHeaderView(web_app_left_header_view_);
129 } else if (window_icon_) { 127 } else if (window_icon_) {
130 header_painter->UpdateLeftHeaderView(window_icon_); 128 header_painter->UpdateLeftHeaderView(window_icon_);
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 // TODO(pkasting): The "2 *" part of this makes no sense to me. 564 // TODO(pkasting): The "2 *" part of this makes no sense to me.
567 canvas->TileImageInt(*right, 0, 0, w - (2 * kClientEdgeThickness) - img_w, 565 canvas->TileImageInt(*right, 0, 0, w - (2 * kClientEdgeThickness) - img_w,
568 img_y, img_w, img_h); 566 img_y, img_w, img_h);
569 567
570 // Toolbar/content separator. 568 // Toolbar/content separator.
571 toolbar_bounds.Inset(kClientEdgeThickness, h - kClientEdgeThickness, 569 toolbar_bounds.Inset(kClientEdgeThickness, h - kClientEdgeThickness,
572 kClientEdgeThickness, 0); 570 kClientEdgeThickness, 0);
573 canvas->FillRect(toolbar_bounds, separator_color); 571 canvas->FillRect(toolbar_bounds, separator_color);
574 } 572 }
575 } 573 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698