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

Unified Diff: ui/app_list/views/app_list_view.cc

Issue 894203004: Add a proper shadow to the experimental app list search box. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@make_doodle_clickable
Patch Set: Created 5 years, 11 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 | ui/app_list/views/contents_animator.cc » ('j') | ui/app_list/views/contents_view.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/app_list_view.cc
diff --git a/ui/app_list/views/app_list_view.cc b/ui/app_list/views/app_list_view.cc
index e2d3e095d7634c6cfb9b4c98a322f152a5cf627c..cd773783d964157a154f05d0673b0932747ab627 100644
--- a/ui/app_list/views/app_list_view.cc
+++ b/ui/app_list/views/app_list_view.cc
@@ -109,6 +109,27 @@ class AppListOverlayView : public views::View {
DISALLOW_COPY_AND_ASSIGN(AppListOverlayView);
};
+// An event targeter for the search box widget which will ignore events that
+// are on the search box's shadow.
+class SearchBoxWindowTargeter : public wm::MaskedWindowTargeter {
tapted 2015/02/03 23:56:31 this needs to be in USE_AURA as well. And wm::Mask
calamity 2015/02/04 03:37:01 Done.
+ public:
+ SearchBoxWindowTargeter(aura::Window* window, views::View* content_view)
+ : wm::MaskedWindowTargeter(window), content_view_(content_view) {}
tapted 2015/02/03 23:56:31 nit: can you pass content_view->GetWidget()->GetNa
calamity 2015/02/04 03:37:01 Done.
+ ~SearchBoxWindowTargeter() override {}
+
+ private:
+ // wm::MaskedWindowTargeter:
+ bool GetHitTestMask(aura::Window* window, gfx::Path* mask) const override {
+ mask->addRect(gfx::RectToSkRect(content_view_->ConvertRectToWidget(
tapted 2015/02/03 23:56:31 Q: Is the ConvertRectToWidget bit needed (I only a
calamity 2015/02/04 03:37:01 Yeah, it can be removed.
+ content_view_->GetContentsBounds())));
+ return true;
+ }
+
+ views::View* content_view_;
+
+ DISALLOW_COPY_AND_ASSIGN(SearchBoxWindowTargeter);
+};
+
} // namespace
// An animation observer to hide the view at the end of the animation.
@@ -426,6 +447,13 @@ void AppListView::InitChildWidgets() {
search_box_widget_->Init(search_box_widget_params);
search_box_widget_->SetContentsView(search_box_view_);
+#if defined(USE_AURA)
Matt Giuca 2015/02/03 07:29:23 Adding Trent to get opinion about this (as the res
+ // Mouse events on the search box shadow should not be captured.
+ aura::Window* window = search_box_widget_->GetNativeWindow();
+ window->SetEventTargeter(scoped_ptr<ui::EventTargeter>(
+ new SearchBoxWindowTargeter(window, search_box_view_)));
+#endif
+
app_list_main_view_->contents_view()->Layout();
}
« no previous file with comments | « no previous file | ui/app_list/views/contents_animator.cc » ('j') | ui/app_list/views/contents_view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698