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

Unified Diff: chrome/browser/ui/views/frame/avatar_button_manager.cc

Issue 1529703003: [EXPERIMENT] [MacViews] Enable and handle the profile switcher. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/frame/avatar_button_manager.cc
diff --git a/chrome/browser/ui/views/frame/avatar_button_manager.cc b/chrome/browser/ui/views/frame/avatar_button_manager.cc
index eb80888dc13525feebc3899d807d8f1a7b8e66f8..629e31a0d3d2143889d85be406b12d1d4c0b4cda 100644
--- a/chrome/browser/ui/views/frame/avatar_button_manager.cc
+++ b/chrome/browser/ui/views/frame/avatar_button_manager.cc
@@ -34,7 +34,7 @@ void AvatarButtonManager::Update(AvatarButtonStyle style) {
view_ = new NewAvatarButton(this, style, profile);
view_->set_id(VIEW_ID_AVATAR_BUTTON);
frame_view_->AddChildView(view_);
- frame->GetRootView()->Layout();
+ // frame->GetRootView()->Layout();
}
} else if (view_) {
delete view_;
@@ -43,6 +43,19 @@ void AvatarButtonManager::Update(AvatarButtonStyle style) {
}
}
+bool AvatarButtonManager::Intersects(const gfx::Rect& rect) const {
+ return view_ && view_->GetMirroredBounds().Intersects(rect);
+}
+
+bool AvatarButtonManager::HitTest(const gfx::Point& point) const {
+ if (!view_)
+ return false;
+
+ gfx::Point point_in_button(point);
+ views::View::ConvertPointToTarget(frame_view_, view_, &point_in_button);
+ return view_->HitTestPoint(point_in_button);
+}
+
void AvatarButtonManager::ButtonPreferredSizeChanged() {
// Perform a re-layout if the avatar button has changed, since that can affect
// the size of the tabs.

Powered by Google App Engine
This is Rietveld 408576698