OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/profiles/avatar_menu_bubble_view.h" | 5 #include "chrome/browser/ui/views/profiles/avatar_menu_bubble_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 delegate_->OnFocusStateChanged(false); | 194 delegate_->OnFocusStateChanged(false); |
195 } | 195 } |
196 | 196 |
197 | 197 |
198 // ProfileImageView ----------------------------------------------------------- | 198 // ProfileImageView ----------------------------------------------------------- |
199 | 199 |
200 // A custom image view that ignores mouse events so that the parent can receive | 200 // A custom image view that ignores mouse events so that the parent can receive |
201 // them instead. | 201 // them instead. |
202 class ProfileImageView : public views::ImageView { | 202 class ProfileImageView : public views::ImageView { |
203 public: | 203 public: |
204 virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE; | 204 // views::View: |
| 205 virtual bool CanProcessEventsWithinSubtree() const OVERRIDE; |
205 }; | 206 }; |
206 | 207 |
207 bool ProfileImageView::HitTestRect(const gfx::Rect& rect) const { | 208 bool ProfileImageView::CanProcessEventsWithinSubtree() const { |
| 209 // Send events to the parent view for handling. |
208 return false; | 210 return false; |
209 } | 211 } |
210 | 212 |
211 } // namespace | 213 } // namespace |
212 | 214 |
213 // ProfileItemView ------------------------------------------------------------ | 215 // ProfileItemView ------------------------------------------------------------ |
214 | 216 |
215 // Control that shows information about a single profile. | 217 // Control that shows information about a single profile. |
216 class ProfileItemView : public views::CustomButton, | 218 class ProfileItemView : public views::CustomButton, |
217 public HighlightDelegate { | 219 public HighlightDelegate { |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 Layout(); | 805 Layout(); |
804 if (GetBubbleFrameView()) | 806 if (GetBubbleFrameView()) |
805 SizeToContents(); | 807 SizeToContents(); |
806 } | 808 } |
807 | 809 |
808 void AvatarMenuBubbleView::SetBackgroundColors() { | 810 void AvatarMenuBubbleView::SetBackgroundColors() { |
809 for (size_t i = 0; i < item_views_.size(); ++i) { | 811 for (size_t i = 0; i < item_views_.size(); ++i) { |
810 item_views_[i]->OnHighlightStateChanged(); | 812 item_views_[i]->OnHighlightStateChanged(); |
811 } | 813 } |
812 } | 814 } |
OLD | NEW |