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/omnibox/omnibox_view_views.h" | 5 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/property_bag.h" | 8 #include "base/property_bag.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 #include "ui/base/ime/text_input_client.h" | 39 #include "ui/base/ime/text_input_client.h" |
40 #include "ui/base/ime/text_input_type.h" | 40 #include "ui/base/ime/text_input_type.h" |
41 #include "ui/base/l10n/l10n_util.h" | 41 #include "ui/base/l10n/l10n_util.h" |
42 #include "ui/base/models/simple_menu_model.h" | 42 #include "ui/base/models/simple_menu_model.h" |
43 #include "ui/base/resource/resource_bundle.h" | 43 #include "ui/base/resource/resource_bundle.h" |
44 #include "ui/gfx/canvas.h" | 44 #include "ui/gfx/canvas.h" |
45 #include "ui/gfx/font.h" | 45 #include "ui/gfx/font.h" |
46 #include "ui/gfx/render_text.h" | 46 #include "ui/gfx/render_text.h" |
47 #include "ui/views/border.h" | 47 #include "ui/views/border.h" |
48 #include "ui/views/controls/textfield/textfield.h" | 48 #include "ui/views/controls/textfield/textfield.h" |
49 #include "ui/views/events/event.h" | |
50 #include "ui/views/ime/input_method.h" | 49 #include "ui/views/ime/input_method.h" |
51 #include "ui/views/layout/fill_layout.h" | 50 #include "ui/views/layout/fill_layout.h" |
52 #include "ui/views/views_delegate.h" | 51 #include "ui/views/views_delegate.h" |
53 #include "ui/views/widget/widget.h" | 52 #include "ui/views/widget/widget.h" |
54 | 53 |
55 #if defined(USE_AURA) | 54 #if defined(USE_AURA) |
56 #include "ui/aura/focus_manager.h" | 55 #include "ui/aura/focus_manager.h" |
57 #include "ui/aura/root_window.h" | 56 #include "ui/aura/root_window.h" |
58 #include "ui/compositor/layer.h" | 57 #include "ui/compositor/layer.h" |
59 #endif | 58 #endif |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 int OmniboxViewViews::GetMaxEditWidth(int entry_width) const { | 703 int OmniboxViewViews::GetMaxEditWidth(int entry_width) const { |
705 return entry_width; | 704 return entry_width; |
706 } | 705 } |
707 | 706 |
708 views::View* OmniboxViewViews::AddToView(views::View* parent) { | 707 views::View* OmniboxViewViews::AddToView(views::View* parent) { |
709 parent->AddChildView(this); | 708 parent->AddChildView(this); |
710 AddChildView(textfield_); | 709 AddChildView(textfield_); |
711 return this; | 710 return this; |
712 } | 711 } |
713 | 712 |
714 int OmniboxViewViews::OnPerformDrop(const views::DropTargetEvent& event) { | 713 int OmniboxViewViews::OnPerformDrop(const ui::DropTargetEvent& event) { |
715 NOTIMPLEMENTED(); | 714 NOTIMPLEMENTED(); |
716 return ui::DragDropTypes::DRAG_NONE; | 715 return ui::DragDropTypes::DRAG_NONE; |
717 } | 716 } |
718 | 717 |
719 //////////////////////////////////////////////////////////////////////////////// | 718 //////////////////////////////////////////////////////////////////////////////// |
720 // OmniboxViewViews, views::TextfieldController implementation: | 719 // OmniboxViewViews, views::TextfieldController implementation: |
721 | 720 |
722 void OmniboxViewViews::ContentsChanged(views::Textfield* sender, | 721 void OmniboxViewViews::ContentsChanged(views::Textfield* sender, |
723 const string16& new_contents) { | 722 const string16& new_contents) { |
724 } | 723 } |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 const ui::Range& range) { | 898 const ui::Range& range) { |
900 if (text != GetText()) | 899 if (text != GetText()) |
901 textfield_->SetText(text); | 900 textfield_->SetText(text); |
902 textfield_->SelectRange(range); | 901 textfield_->SelectRange(range); |
903 } | 902 } |
904 | 903 |
905 string16 OmniboxViewViews::GetSelectedText() const { | 904 string16 OmniboxViewViews::GetSelectedText() const { |
906 // TODO(oshima): Support instant, IME. | 905 // TODO(oshima): Support instant, IME. |
907 return textfield_->GetSelectedText(); | 906 return textfield_->GetSelectedText(); |
908 } | 907 } |
OLD | NEW |