Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(307)

Side by Side Diff: mandoline/ui/omnibox/omnibox_impl.cc

Issue 1286383003: Mandoline: Enable Android software keyboard for the Omnibox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review issues Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mandoline/ui/aura/window_tree_host_mojo.cc ('k') | mojo/converters/ime/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « mandoline/ui/aura/window_tree_host_mojo.cc ('k') | mojo/converters/ime/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698