| 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 "ui/views/controls/combobox/combobox.h" | 5 #include "ui/views/controls/combobox/combobox.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "base/logging.h" | 9 #include "base/logging.h" |
| 8 #include "ui/accessibility/ax_view_state.h" | 10 #include "ui/accessibility/ax_view_state.h" |
| 9 #include "ui/base/ime/input_method.h" | 11 #include "ui/base/ime/input_method.h" |
| 10 #include "ui/base/models/combobox_model.h" | 12 #include "ui/base/models/combobox_model.h" |
| 11 #include "ui/base/models/combobox_model_observer.h" | 13 #include "ui/base/models/combobox_model_observer.h" |
| 12 #include "ui/base/resource/resource_bundle.h" | 14 #include "ui/base/resource/resource_bundle.h" |
| 13 #include "ui/events/event.h" | 15 #include "ui/events/event.h" |
| 14 #include "ui/gfx/animation/throb_animation.h" | 16 #include "ui/gfx/animation/throb_animation.h" |
| 15 #include "ui/gfx/canvas.h" | 17 #include "ui/gfx/canvas.h" |
| 16 #include "ui/gfx/color_palette.h" | 18 #include "ui/gfx/color_palette.h" |
| (...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 ShowDropDownMenu(source_type); | 682 ShowDropDownMenu(source_type); |
| 681 } | 683 } |
| 682 } | 684 } |
| 683 | 685 |
| 684 void Combobox::UpdateBorder() { | 686 void Combobox::UpdateBorder() { |
| 685 scoped_ptr<FocusableBorder> border(new FocusableBorder()); | 687 scoped_ptr<FocusableBorder> border(new FocusableBorder()); |
| 686 if (style_ == STYLE_ACTION) | 688 if (style_ == STYLE_ACTION) |
| 687 border->SetInsets(5, 10, 5, 10); | 689 border->SetInsets(5, 10, 5, 10); |
| 688 if (invalid_) | 690 if (invalid_) |
| 689 border->SetColor(gfx::kGoogleRed700); | 691 border->SetColor(gfx::kGoogleRed700); |
| 690 SetBorder(border.Pass()); | 692 SetBorder(std::move(border)); |
| 691 } | 693 } |
| 692 | 694 |
| 693 void Combobox::AdjustBoundsForRTLUI(gfx::Rect* rect) const { | 695 void Combobox::AdjustBoundsForRTLUI(gfx::Rect* rect) const { |
| 694 rect->set_x(GetMirroredXForRect(*rect)); | 696 rect->set_x(GetMirroredXForRect(*rect)); |
| 695 } | 697 } |
| 696 | 698 |
| 697 void Combobox::PaintText(gfx::Canvas* canvas) { | 699 void Combobox::PaintText(gfx::Canvas* canvas) { |
| 698 gfx::Insets insets = GetInsets(); | 700 gfx::Insets insets = GetInsets(); |
| 699 insets += gfx::Insets(0, Textfield::kTextPadding, 0, Textfield::kTextPadding); | 701 insets += gfx::Insets(0, Textfield::kTextPadding, 0, Textfield::kTextPadding); |
| 700 | 702 |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 920 return gfx::Size(width, font_list.GetHeight()); | 922 return gfx::Size(width, font_list.GetHeight()); |
| 921 } | 923 } |
| 922 | 924 |
| 923 PrefixSelector* Combobox::GetPrefixSelector() { | 925 PrefixSelector* Combobox::GetPrefixSelector() { |
| 924 if (!selector_) | 926 if (!selector_) |
| 925 selector_.reset(new PrefixSelector(this)); | 927 selector_.reset(new PrefixSelector(this)); |
| 926 return selector_.get(); | 928 return selector_.get(); |
| 927 } | 929 } |
| 928 | 930 |
| 929 } // namespace views | 931 } // namespace views |
| OLD | NEW |