OLD | NEW |
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/avatar_menu_bubble_view.h" | 5 #include "chrome/browser/ui/views/avatar_menu_bubble_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 delegate_->OnFocusStateChanged(false); | 177 delegate_->OnFocusStateChanged(false); |
178 } | 178 } |
179 | 179 |
180 | 180 |
181 // ProfileImageView ----------------------------------------------------------- | 181 // ProfileImageView ----------------------------------------------------------- |
182 | 182 |
183 // A custom image view that ignores mouse events so that the parent can receive | 183 // A custom image view that ignores mouse events so that the parent can receive |
184 // them instead. | 184 // them instead. |
185 class ProfileImageView : public views::ImageView { | 185 class ProfileImageView : public views::ImageView { |
186 public: | 186 public: |
187 virtual bool HitTest(const gfx::Point& l) const OVERRIDE; | 187 virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE; |
188 }; | 188 }; |
189 | 189 |
190 bool ProfileImageView::HitTest(const gfx::Point& l) const { | 190 bool ProfileImageView::HitTestRect(const gfx::Rect& rect) const { |
191 return false; | 191 return false; |
192 } | 192 } |
193 | 193 |
194 | 194 |
195 // ProfileItemView ------------------------------------------------------------ | 195 // ProfileItemView ------------------------------------------------------------ |
196 | 196 |
197 // Control that shows information about a single profile. | 197 // Control that shows information about a single profile. |
198 class ProfileItemView : public views::CustomButton, | 198 class ProfileItemView : public views::CustomButton, |
199 public HighlightDelegate { | 199 public HighlightDelegate { |
200 public: | 200 public: |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 add_profile_link_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 551 add_profile_link_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); |
552 add_profile_link_->SetBackgroundColor(color()); | 552 add_profile_link_->SetBackgroundColor(color()); |
553 add_profile_link_->SetEnabledColor(SkColorSetRGB(0xe3, 0xed, 0xf6)); | 553 add_profile_link_->SetEnabledColor(SkColorSetRGB(0xe3, 0xed, 0xf6)); |
554 AddChildView(add_profile_link_); | 554 AddChildView(add_profile_link_); |
555 | 555 |
556 // If the bubble has already been shown then resize and reposition the bubble. | 556 // If the bubble has already been shown then resize and reposition the bubble. |
557 Layout(); | 557 Layout(); |
558 if (GetBubbleFrameView()) | 558 if (GetBubbleFrameView()) |
559 SizeToContents(); | 559 SizeToContents(); |
560 } | 560 } |
OLD | NEW |