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

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

Issue 913133007: Allow scroll events to open custom launcher pages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
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 f2083749f9ab8f7652ca6e3123777a8f1a78193e..803de7431655998b02536284ab7f76515bf36aa6 100644
--- a/ui/app_list/views/app_list_view.cc
+++ b/ui/app_list/views/app_list_view.cc
@@ -338,6 +338,21 @@ bool AppListView::ShouldHandleSystemCommands() const {
return true;
}
+bool AppListView::ShouldDescendIntoChildForEventHandling(
+ gfx::NativeView child,
+ const gfx::Point& location) {
+ // On the start page, only descend into the search box widget.
+ // Ideally a scroll inside the search box would also be captured, since that's
+ // not meaningful. However, catching that here would also capture clicks on
+ // the microphone icon.
calamity 2015/02/12 04:32:24 You can always add SearchBoxView::OnScroll/Gesture
+ ContentsView* contents_view = app_list_main_view_->contents_view();
+ if (contents_view->GetActiveState() == AppListModel::STATE_START)
+ return child == search_box_widget_->GetNativeView();
calamity 2015/02/12 04:32:24 You're also going to need the google logo webview
tapted 2015/02/13 04:18:41 Yes. Also: darn. Turns out matching up |child| wi
+
+ return views::BubbleDelegateView::ShouldDescendIntoChildForEventHandling(
+ child, location);
+}
+
void AppListView::Prerender() {
app_list_main_view_->Prerender();
}
@@ -434,8 +449,6 @@ void AppListView::InitContents(gfx::NativeView parent, int initial_apps_page) {
void AppListView::InitChildWidgets() {
DCHECK(search_box_view_);
- app_list_main_view_->InitWidgets();
-
// Create the search box widget.
views::Widget::InitParams search_box_widget_params(
views::Widget::InitParams::TYPE_CONTROL);

Powered by Google App Engine
This is Rietveld 408576698