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

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

Issue 2893343002: Resize avatar button as appropriate for opaque browser frame. (Closed)
Patch Set: comment Created 3 years, 7 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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.h" 5 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "chrome/app/vector_icons/vector_icons.h" 8 #include "chrome/app/vector_icons/vector_icons.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/profiles/avatar_menu.h" 10 #include "chrome/browser/profiles/avatar_menu.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 : ThemeProperties::GetDefaultColor( 64 : ThemeProperties::GetDefaultColor(
65 color_id, browser_view_->IsIncognito()); 65 color_id, browser_view_->IsIncognito());
66 } 66 }
67 67
68 views::View* BrowserNonClientFrameView::GetProfileSwitcherView() const { 68 views::View* BrowserNonClientFrameView::GetProfileSwitcherView() const {
69 return nullptr; 69 return nullptr;
70 } 70 }
71 71
72 void BrowserNonClientFrameView::UpdateClientArea() {} 72 void BrowserNonClientFrameView::UpdateClientArea() {}
73 73
74 void BrowserNonClientFrameView::ChildPreferredSizeChanged(views::View* child) {
75 if (child == GetProfileSwitcherView()) {
76 // Perform a re-layout if the avatar button has changed, since that can
77 // affect the size of the tabs.
78 frame()->GetRootView()->Layout();
79 }
80 }
81
74 void BrowserNonClientFrameView::VisibilityChanged(views::View* starting_from, 82 void BrowserNonClientFrameView::VisibilityChanged(views::View* starting_from,
75 bool is_visible) { 83 bool is_visible) {
76 // UpdateTaskbarDecoration() calls DrawTaskbarDecoration(), but that does 84 // UpdateTaskbarDecoration() calls DrawTaskbarDecoration(), but that does
77 // nothing if the window is not visible. So even if we've already gotten the 85 // nothing if the window is not visible. So even if we've already gotten the
78 // up-to-date decoration, we need to run the update procedure again here when 86 // up-to-date decoration, we need to run the update procedure again here when
79 // the window becomes visible. 87 // the window becomes visible.
80 if (is_visible) 88 if (is_visible)
81 OnProfileAvatarChanged(base::FilePath()); 89 OnProfileAvatarChanged(base::FilePath());
82 } 90 }
83 91
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 // safety. See crbug.com/313800. 279 // safety. See crbug.com/313800.
272 gfx::Image decoration; 280 gfx::Image decoration;
273 AvatarMenu::GetImageForMenuButton( 281 AvatarMenu::GetImageForMenuButton(
274 browser_view()->browser()->profile()->GetPath(), &decoration); 282 browser_view()->browser()->profile()->GetPath(), &decoration);
275 // This can happen if the user deletes the current profile. 283 // This can happen if the user deletes the current profile.
276 if (decoration.IsEmpty()) 284 if (decoration.IsEmpty())
277 return; 285 return;
278 chrome::DrawTaskbarDecoration(frame_->GetNativeWindow(), &decoration); 286 chrome::DrawTaskbarDecoration(frame_->GetNativeWindow(), &decoration);
279 #endif 287 #endif
280 } 288 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698