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/find_bar_view.h" | 5 #include "chrome/browser/ui/views/find_bar_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" |
10 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
11 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
12 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
13 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/themes/theme_properties.h" | 15 #include "chrome/browser/themes/theme_properties.h" |
15 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 16 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
16 #include "chrome/browser/ui/find_bar/find_bar_state.h" | 17 #include "chrome/browser/ui/find_bar/find_bar_state.h" |
17 #include "chrome/browser/ui/find_bar/find_bar_state_factory.h" | 18 #include "chrome/browser/ui/find_bar/find_bar_state_factory.h" |
18 #include "chrome/browser/ui/find_bar/find_notification_details.h" | 19 #include "chrome/browser/ui/find_bar/find_notification_details.h" |
19 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 20 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 IDR_FIND_DIALOG_RIGHT); | 534 IDR_FIND_DIALOG_RIGHT); |
534 | 535 |
535 preferred_height_ = rb.GetImageSkiaNamed(IDR_FIND_DIALOG_MIDDLE)->height(); | 536 preferred_height_ = rb.GetImageSkiaNamed(IDR_FIND_DIALOG_MIDDLE)->height(); |
536 | 537 |
537 static const int kImages[] = IMAGE_GRID(IDR_TEXTFIELD); | 538 static const int kImages[] = IMAGE_GRID(IDR_TEXTFIELD); |
538 find_text_border_.reset(views::Painter::CreateImageGridPainter(kImages)); | 539 find_text_border_.reset(views::Painter::CreateImageGridPainter(kImages)); |
539 } | 540 } |
540 | 541 |
541 void FindBarView::InitViewsForMaterial() { | 542 void FindBarView::InitViewsForMaterial() { |
542 // The background color is not used since there's no arrow. | 543 // The background color is not used since there's no arrow. |
543 SetBorder(make_scoped_ptr(new views::BubbleBorder( | 544 SetBorder(base::WrapUnique(new views::BubbleBorder( |
544 views::BubbleBorder::NONE, views::BubbleBorder::SMALL_SHADOW, | 545 views::BubbleBorder::NONE, views::BubbleBorder::SMALL_SHADOW, |
545 SK_ColorGREEN))); | 546 SK_ColorGREEN))); |
546 | 547 |
547 match_count_text_ = new MatchCountLabel(); | 548 match_count_text_ = new MatchCountLabel(); |
548 match_count_text_->SetEventTargeter( | 549 match_count_text_->SetEventTargeter( |
549 make_scoped_ptr(new views::ViewTargeter(this))); | 550 base::WrapUnique(new views::ViewTargeter(this))); |
550 AddChildViewAt(match_count_text_, 1); | 551 AddChildViewAt(match_count_text_, 1); |
551 | 552 |
552 separator_ = new views::Separator(views::Separator::VERTICAL); | 553 separator_ = new views::Separator(views::Separator::VERTICAL); |
553 separator_->SetBorder(views::Border::CreateEmptyBorder( | 554 separator_->SetBorder(views::Border::CreateEmptyBorder( |
554 0, kSeparatorLeftSpacing, 0, kSeparatorRightSpacing)); | 555 0, kSeparatorLeftSpacing, 0, kSeparatorRightSpacing)); |
555 AddChildViewAt(separator_, 2); | 556 AddChildViewAt(separator_, 2); |
556 | 557 |
557 find_text_->SetBorder(views::Border::NullBorder()); | 558 find_text_->SetBorder(views::Border::NullBorder()); |
558 | 559 |
559 views::BoxLayout* manager = | 560 views::BoxLayout* manager = |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
656 SkColor text_color = | 657 SkColor text_color = |
657 theme->GetSystemColor(ui::NativeTheme::kColorId_TextfieldDefaultColor); | 658 theme->GetSystemColor(ui::NativeTheme::kColorId_TextfieldDefaultColor); |
658 match_count_text_->SetEnabledColor(SkColorSetA(text_color, 0x69)); | 659 match_count_text_->SetEnabledColor(SkColorSetA(text_color, 0x69)); |
659 separator_->SetColor(SkColorSetA(text_color, 0x26)); | 660 separator_->SetColor(SkColorSetA(text_color, 0x26)); |
660 } | 661 } |
661 | 662 |
662 SkColor FindBarView::GetTextColorForIcon() { | 663 SkColor FindBarView::GetTextColorForIcon() { |
663 return GetNativeTheme()->GetSystemColor( | 664 return GetNativeTheme()->GetSystemColor( |
664 ui::NativeTheme::kColorId_TextfieldDefaultColor); | 665 ui::NativeTheme::kColorId_TextfieldDefaultColor); |
665 } | 666 } |
OLD | NEW |