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

Unified Diff: mandoline/ui/omnibox/omnibox_impl.cc

Issue 1134003004: mandoline/omnibox: Add some opacity. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mandoline/ui/omnibox/omnibox_impl.cc
diff --git a/mandoline/ui/omnibox/omnibox_impl.cc b/mandoline/ui/omnibox/omnibox_impl.cc
index cef777ced0dcb1881df5d4c37d7d08bf9a960c40..b88a57f9877a088b1345e7ba4222636f99e78a2e 100644
--- a/mandoline/ui/omnibox/omnibox_impl.cc
+++ b/mandoline/ui/omnibox/omnibox_impl.cc
@@ -60,9 +60,11 @@ void OmniboxImpl::OnEmbed(mojo::View* root,
edit_->set_controller(this);
}
+ const int kOpacity = 0xC0;
views::WidgetDelegateView* widget_delegate = new views::WidgetDelegateView;
widget_delegate->GetContentsView()->set_background(
- views::Background::CreateSolidBackground(0xFFDDDDDD));
+ views::Background::CreateSolidBackground(
+ SkColorSetA(0xDDDDDD, kOpacity)));
widget_delegate->GetContentsView()->AddChildView(edit_);
widget_delegate->GetContentsView()->SetLayoutManager(this);
@@ -75,8 +77,11 @@ void OmniboxImpl::OnEmbed(mojo::View* root,
new NativeWidgetViewManager(widget, app_impl_->shell(), root);
params.delegate = widget_delegate;
params.bounds = root->bounds().To<gfx::Rect>();
+ params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
widget->Init(params);
widget->Show();
+ widget->GetCompositor()->SetBackgroundColor(
+ SkColorSetA(SK_ColorBLACK, kOpacity));
root->SetFocus();
edit_->SetText(url_.To<base::string16>());
edit_->SelectAll(false);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698