OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
281 } | 281 } |
282 | 282 |
283 void ProfileItemView::OnBlur() { | 283 void ProfileItemView::OnBlur() { |
284 views::CustomButton::OnBlur(); | 284 views::CustomButton::OnBlur(); |
285 OnFocusStateChanged(false); | 285 OnFocusStateChanged(false); |
286 } | 286 } |
287 | 287 |
288 void ProfileItemView::OnHighlightStateChanged() { | 288 void ProfileItemView::OnHighlightStateChanged() { |
289 set_background(IsHighlighted() ? views::Background::CreateSolidBackground( | 289 set_background(IsHighlighted() ? views::Background::CreateSolidBackground( |
290 SkColorSetRGB(0xe3, 0xed, 0xf6)) : NULL); | 290 SkColorSetRGB(0xe3, 0xed, 0xf6)) : NULL); |
291 SkColor background_color = background() ? | |
292 background()->get_color() : views::BubbleDelegateView::kBackgroundColor; | |
293 name_label_->SetBackgroundColor(background_color); | |
msw
2011/12/08 05:46:30
Labels should find backgrounds up the view hierarc
| |
294 sync_state_label_->SetBackgroundColor(background_color); | |
295 edit_link_->SetBackgroundColor(background_color); | |
291 | 296 |
292 bool show_edit = IsHighlighted() && item_.active; | 297 bool show_edit = IsHighlighted() && item_.active; |
293 sync_state_label_->SetVisible(!show_edit); | 298 sync_state_label_->SetVisible(!show_edit); |
294 edit_link_->SetVisible(show_edit); | 299 edit_link_->SetVisible(show_edit); |
295 SchedulePaint(); | 300 SchedulePaint(); |
296 } | 301 } |
297 | 302 |
298 void ProfileItemView::OnFocusStateChanged(bool has_focus) { | 303 void ProfileItemView::OnFocusStateChanged(bool has_focus) { |
299 if (!has_focus && state() != views::CustomButton::BS_DISABLED) | 304 if (!has_focus && state() != views::CustomButton::BS_DISABLED) |
300 SetState(views::CustomButton::BS_NORMAL); | 305 SetState(views::CustomButton::BS_NORMAL); |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
481 item_views_.push_back(item_view); | 486 item_views_.push_back(item_view); |
482 } | 487 } |
483 | 488 |
484 separator_ = new views::Separator(); | 489 separator_ = new views::Separator(); |
485 AddChildView(separator_); | 490 AddChildView(separator_); |
486 | 491 |
487 add_profile_link_ = new views::Link( | 492 add_profile_link_ = new views::Link( |
488 l10n_util::GetStringUTF16(IDS_PROFILES_CREATE_NEW_PROFILE_LINK)); | 493 l10n_util::GetStringUTF16(IDS_PROFILES_CREATE_NEW_PROFILE_LINK)); |
489 add_profile_link_->set_listener(this); | 494 add_profile_link_->set_listener(this); |
490 add_profile_link_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 495 add_profile_link_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); |
496 add_profile_link_->SetBackgroundColor(color()); | |
491 add_profile_link_->SetEnabledColor(SkColorSetRGB(0xe3, 0xed, 0xf6)); | 497 add_profile_link_->SetEnabledColor(SkColorSetRGB(0xe3, 0xed, 0xf6)); |
492 AddChildView(add_profile_link_); | 498 AddChildView(add_profile_link_); |
493 | 499 |
494 PreferredSizeChanged(); | 500 PreferredSizeChanged(); |
495 } | 501 } |
OLD | NEW |