OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/views/location_bar_view.h" | 5 #include "chrome/browser/views/location_bar_view.h" |
6 | 6 |
7 #include "app/gfx/chrome_canvas.h" | 7 #include "app/gfx/chrome_canvas.h" |
8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
10 #include "app/win_util.h" | 10 #include "app/win_util.h" |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 views::Border::CreateEmptyBorder(kTopInset, kLeftInset, kBottomInset, | 665 views::Border::CreateEmptyBorder(kTopInset, kLeftInset, kBottomInset, |
666 kRightInset)); | 666 kRightInset)); |
667 partial_label_.set_border( | 667 partial_label_.set_border( |
668 views::Border::CreateEmptyBorder(kTopInset, kLeftInset, kBottomInset, | 668 views::Border::CreateEmptyBorder(kTopInset, kLeftInset, kBottomInset, |
669 kRightInset)); | 669 kRightInset)); |
670 } | 670 } |
671 | 671 |
672 LocationBarView::SelectedKeywordView::~SelectedKeywordView() { | 672 LocationBarView::SelectedKeywordView::~SelectedKeywordView() { |
673 } | 673 } |
674 | 674 |
675 void LocationBarView::SelectedKeywordView::SetFont(const ChromeFont& font) { | 675 void LocationBarView::SelectedKeywordView::SetFont(const gfx::Font& font) { |
676 full_label_.SetFont(font); | 676 full_label_.SetFont(font); |
677 partial_label_.SetFont(font); | 677 partial_label_.SetFont(font); |
678 } | 678 } |
679 | 679 |
680 void LocationBarView::SelectedKeywordView::Paint(ChromeCanvas* canvas) { | 680 void LocationBarView::SelectedKeywordView::Paint(ChromeCanvas* canvas) { |
681 canvas->TranslateInt(0, kBackgroundYOffset); | 681 canvas->TranslateInt(0, kBackgroundYOffset); |
682 background_painter_.Paint(width(), height() - kTopInset, canvas); | 682 background_painter_.Paint(width(), height() - kTopInset, canvas); |
683 canvas->TranslateInt(0, -kBackgroundYOffset); | 683 canvas->TranslateInt(0, -kBackgroundYOffset); |
684 } | 684 } |
685 | 685 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 } | 756 } |
757 } | 757 } |
758 | 758 |
759 LocationBarView::KeywordHintView::~KeywordHintView() { | 759 LocationBarView::KeywordHintView::~KeywordHintView() { |
760 // Labels are freed by us. Remove them so that View doesn't | 760 // Labels are freed by us. Remove them so that View doesn't |
761 // try to free them too. | 761 // try to free them too. |
762 RemoveChildView(&leading_label_); | 762 RemoveChildView(&leading_label_); |
763 RemoveChildView(&trailing_label_); | 763 RemoveChildView(&trailing_label_); |
764 } | 764 } |
765 | 765 |
766 void LocationBarView::KeywordHintView::SetFont(const ChromeFont& font) { | 766 void LocationBarView::KeywordHintView::SetFont(const gfx::Font& font) { |
767 leading_label_.SetFont(font); | 767 leading_label_.SetFont(font); |
768 trailing_label_.SetFont(font); | 768 trailing_label_.SetFont(font); |
769 } | 769 } |
770 | 770 |
771 void LocationBarView::KeywordHintView::SetColor(const SkColor& color) { | 771 void LocationBarView::KeywordHintView::SetColor(const SkColor& color) { |
772 leading_label_.SetColor(color); | 772 leading_label_.SetColor(color); |
773 trailing_label_.SetColor(color); | 773 trailing_label_.SetColor(color); |
774 } | 774 } |
775 | 775 |
776 void LocationBarView::KeywordHintView::SetKeyword(const std::wstring& keyword) { | 776 void LocationBarView::KeywordHintView::SetKeyword(const std::wstring& keyword) { |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1206 location_entry_->SetFocus(); | 1206 location_entry_->SetFocus(); |
1207 } | 1207 } |
1208 | 1208 |
1209 void LocationBarView::SaveStateToContents(TabContents* contents) { | 1209 void LocationBarView::SaveStateToContents(TabContents* contents) { |
1210 location_entry_->SaveStateToTab(contents); | 1210 location_entry_->SaveStateToTab(contents); |
1211 } | 1211 } |
1212 | 1212 |
1213 void LocationBarView::Revert() { | 1213 void LocationBarView::Revert() { |
1214 location_entry_->RevertAll(); | 1214 location_entry_->RevertAll(); |
1215 } | 1215 } |
OLD | NEW |