Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/app_list/views/app_list_view.h" | 5 #include "ui/app_list/views/app_list_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 331 void AppListView::OnThemeChanged() { | 331 void AppListView::OnThemeChanged() { |
| 332 #if defined(OS_WIN) | 332 #if defined(OS_WIN) |
| 333 GetWidget()->Close(); | 333 GetWidget()->Close(); |
| 334 #endif | 334 #endif |
| 335 } | 335 } |
| 336 | 336 |
| 337 bool AppListView::ShouldHandleSystemCommands() const { | 337 bool AppListView::ShouldHandleSystemCommands() const { |
| 338 return true; | 338 return true; |
| 339 } | 339 } |
| 340 | 340 |
| 341 bool AppListView::ShouldDescendIntoChildForEventHandling( | |
| 342 gfx::NativeView child, | |
| 343 const gfx::Point& location) { | |
| 344 // On the start page, only descend into the search box widget. | |
| 345 // Ideally a scroll inside the search box would also be captured, since that's | |
| 346 // not meaningful. However, catching that here would also capture clicks on | |
| 347 // the microphone icon. | |
|
calamity
2015/02/12 04:32:24
You can always add SearchBoxView::OnScroll/Gesture
| |
| 348 ContentsView* contents_view = app_list_main_view_->contents_view(); | |
| 349 if (contents_view->GetActiveState() == AppListModel::STATE_START) | |
| 350 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
| |
| 351 | |
| 352 return views::BubbleDelegateView::ShouldDescendIntoChildForEventHandling( | |
| 353 child, location); | |
| 354 } | |
| 355 | |
| 341 void AppListView::Prerender() { | 356 void AppListView::Prerender() { |
| 342 app_list_main_view_->Prerender(); | 357 app_list_main_view_->Prerender(); |
| 343 } | 358 } |
| 344 | 359 |
| 345 void AppListView::OnProfilesChanged() { | 360 void AppListView::OnProfilesChanged() { |
| 346 app_list_main_view_->search_box_view()->InvalidateMenu(); | 361 app_list_main_view_->search_box_view()->InvalidateMenu(); |
| 347 } | 362 } |
| 348 | 363 |
| 349 void AppListView::OnShutdown() { | 364 void AppListView::OnShutdown() { |
| 350 // Nothing to do on views - the widget will soon be closed, which will tear | 365 // Nothing to do on views - the widget will soon be closed, which will tear |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 427 speech_view_->layer()->SetOpacity(0.0f); | 442 speech_view_->layer()->SetOpacity(0.0f); |
| 428 AddChildView(speech_view_); | 443 AddChildView(speech_view_); |
| 429 } | 444 } |
| 430 | 445 |
| 431 OnProfilesChanged(); | 446 OnProfilesChanged(); |
| 432 } | 447 } |
| 433 | 448 |
| 434 void AppListView::InitChildWidgets() { | 449 void AppListView::InitChildWidgets() { |
| 435 DCHECK(search_box_view_); | 450 DCHECK(search_box_view_); |
| 436 | 451 |
| 437 app_list_main_view_->InitWidgets(); | |
| 438 | |
| 439 // Create the search box widget. | 452 // Create the search box widget. |
| 440 views::Widget::InitParams search_box_widget_params( | 453 views::Widget::InitParams search_box_widget_params( |
| 441 views::Widget::InitParams::TYPE_CONTROL); | 454 views::Widget::InitParams::TYPE_CONTROL); |
| 442 search_box_widget_params.parent = GetWidget()->GetNativeView(); | 455 search_box_widget_params.parent = GetWidget()->GetNativeView(); |
| 443 search_box_widget_params.opacity = | 456 search_box_widget_params.opacity = |
| 444 views::Widget::InitParams::TRANSLUCENT_WINDOW; | 457 views::Widget::InitParams::TRANSLUCENT_WINDOW; |
| 445 | 458 |
| 446 // Create a widget for the SearchBoxView to live in. This allows the | 459 // Create a widget for the SearchBoxView to live in. This allows the |
| 447 // SearchBoxView to be on top of the custom launcher page's WebContents | 460 // SearchBoxView to be on top of the custom launcher page's WebContents |
| 448 // (otherwise the search box events will be captured by the WebContents). | 461 // (otherwise the search box events will be captured by the WebContents). |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 757 | 770 |
| 758 if (will_appear) { | 771 if (will_appear) { |
| 759 speech_view_->SetVisible(true); | 772 speech_view_->SetVisible(true); |
| 760 } else { | 773 } else { |
| 761 app_list_main_view_->SetVisible(true); | 774 app_list_main_view_->SetVisible(true); |
| 762 search_box_view_->search_box()->RequestFocus(); | 775 search_box_view_->search_box()->RequestFocus(); |
| 763 } | 776 } |
| 764 } | 777 } |
| 765 | 778 |
| 766 } // namespace app_list | 779 } // namespace app_list |
| OLD | NEW |