OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "mandoline/ui/omnibox/omnibox_impl.h" | 5 #include "mandoline/ui/omnibox/omnibox_impl.h" |
6 | 6 |
7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
8 #include "components/view_manager/public/cpp/view_manager_client_factory.h" | 8 #include "components/view_manager/public/cpp/view_manager_client_factory.h" |
9 #include "mandoline/ui/aura/aura_init.h" | 9 #include "mandoline/ui/aura/aura_init.h" |
10 #include "mandoline/ui/aura/native_widget_view_manager.h" | 10 #include "mandoline/ui/aura/native_widget_view_manager.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 //////////////////////////////////////////////////////////////////////////////// | 49 //////////////////////////////////////////////////////////////////////////////// |
50 // OmniboxImpl, mojo::ViewManagerDelegate implementation: | 50 // OmniboxImpl, mojo::ViewManagerDelegate implementation: |
51 | 51 |
52 void OmniboxImpl::OnEmbed(mojo::View* root) { | 52 void OmniboxImpl::OnEmbed(mojo::View* root) { |
53 root_ = root; | 53 root_ = root; |
54 | 54 |
55 if (!aura_init_.get()) { | 55 if (!aura_init_.get()) { |
56 aura_init_.reset(new AuraInit(root, app_impl_->shell())); | 56 aura_init_.reset(new AuraInit(root, app_impl_->shell())); |
57 edit_ = new views::Textfield; | 57 edit_ = new views::Textfield; |
58 edit_->set_controller(this); | 58 edit_->set_controller(this); |
| 59 edit_->SetTextInputType(ui::TEXT_INPUT_TYPE_URL); |
59 } | 60 } |
60 | 61 |
61 const int kOpacity = 0xC0; | 62 const int kOpacity = 0xC0; |
62 views::WidgetDelegateView* widget_delegate = new views::WidgetDelegateView; | 63 views::WidgetDelegateView* widget_delegate = new views::WidgetDelegateView; |
63 widget_delegate->GetContentsView()->set_background( | 64 widget_delegate->GetContentsView()->set_background( |
64 views::Background::CreateSolidBackground( | 65 views::Background::CreateSolidBackground( |
65 SkColorSetA(0xDDDDDD, kOpacity))); | 66 SkColorSetA(0xDDDDDD, kOpacity))); |
66 widget_delegate->GetContentsView()->AddChildView(edit_); | 67 widget_delegate->GetContentsView()->AddChildView(edit_); |
67 widget_delegate->GetContentsView()->SetLayoutManager(this); | 68 widget_delegate->GetContentsView()->SetLayoutManager(this); |
68 | 69 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 root_->SetFocus(); | 156 root_->SetFocus(); |
156 root_->MoveToFront(); | 157 root_->MoveToFront(); |
157 } | 158 } |
158 | 159 |
159 void OmniboxImpl::HideWindow() { | 160 void OmniboxImpl::HideWindow() { |
160 DCHECK(root_); | 161 DCHECK(root_); |
161 root_->SetVisible(false); | 162 root_->SetVisible(false); |
162 } | 163 } |
163 | 164 |
164 } // namespace mandoline | 165 } // namespace mandoline |
OLD | NEW |