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_application.h" | 5 #include "mandoline/ui/omnibox/omnibox_application.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 SkColorSetA(0xDDDDDD, kOpacity))); | 137 SkColorSetA(0xDDDDDD, kOpacity))); |
138 widget_delegate->GetContentsView()->AddChildView(edit_); | 138 widget_delegate->GetContentsView()->AddChildView(edit_); |
139 widget_delegate->GetContentsView()->SetLayoutManager(this); | 139 widget_delegate->GetContentsView()->SetLayoutManager(this); |
140 | 140 |
141 // TODO(beng): we may be leaking these on subsequent calls to OnEmbed()... | 141 // TODO(beng): we may be leaking these on subsequent calls to OnEmbed()... |
142 // probably should only allow once instance per view. | 142 // probably should only allow once instance per view. |
143 views::Widget* widget = new views::Widget; | 143 views::Widget* widget = new views::Widget; |
144 views::Widget::InitParams params( | 144 views::Widget::InitParams params( |
145 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 145 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
146 params.native_widget = new views::NativeWidgetMus( | 146 params.native_widget = new views::NativeWidgetMus( |
147 widget, app_->shell(), root, mus::mojom::SURFACE_TYPE_DEFAULT); | 147 widget, app_->shell(), root, mus::mojom::SurfaceType::DEFAULT); |
148 params.delegate = widget_delegate; | 148 params.delegate = widget_delegate; |
149 params.bounds = root->bounds(); | 149 params.bounds = root->bounds(); |
150 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 150 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
151 widget->Init(params); | 151 widget->Init(params); |
152 widget->Show(); | 152 widget->Show(); |
153 widget->GetCompositor()->SetBackgroundColor( | 153 widget->GetCompositor()->SetBackgroundColor( |
154 SkColorSetA(SK_ColorBLACK, kOpacity)); | 154 SkColorSetA(SK_ColorBLACK, kOpacity)); |
155 | 155 |
156 ShowWindow(); | 156 ShowWindow(); |
157 } | 157 } |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 edit_->SelectAll(false); | 226 edit_->SelectAll(false); |
227 edit_->RequestFocus(); | 227 edit_->RequestFocus(); |
228 } | 228 } |
229 | 229 |
230 void OmniboxImpl::HideWindow() { | 230 void OmniboxImpl::HideWindow() { |
231 DCHECK(root_); | 231 DCHECK(root_); |
232 root_->SetVisible(false); | 232 root_->SetVisible(false); |
233 } | 233 } |
234 | 234 |
235 } // namespace mandoline | 235 } // namespace mandoline |
OLD | NEW |