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

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

Issue 657653002: Move app list search box into AppListView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 2 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 6424c21c4e31045faf427d24846209dc98e495c5..b5014017066e82a74894ccd65c1966aa87acd64c 100644
--- a/ui/app_list/views/app_list_view.cc
+++ b/ui/app_list/views/app_list_view.cc
@@ -21,7 +21,6 @@
#include "ui/app_list/views/app_list_view_observer.h"
#include "ui/app_list/views/apps_container_view.h"
#include "ui/app_list/views/contents_view.h"
-#include "ui/app_list/views/search_box_view.h"
#include "ui/app_list/views/speech_view.h"
#include "ui/app_list/views/start_page_view.h"
#include "ui/base/ui_base_switches.h"
@@ -151,6 +150,7 @@ class HideViewAnimationObserver : public ui::ImplicitAnimationObserver {
AppListView::AppListView(AppListViewDelegate* delegate)
: delegate_(delegate),
app_list_main_view_(NULL),
+ search_box_view_(NULL),
speech_view_(NULL),
experimental_banner_view_(NULL),
overlay_view_(NULL),
@@ -332,7 +332,14 @@ void AppListView::InitAsBubbleInternal(gfx::NativeView parent,
app_list_main_view_->SetPaintToLayer(true);
app_list_main_view_->SetFillsBoundsOpaquely(false);
app_list_main_view_->layer()->SetMasksToBounds(true);
- app_list_main_view_->Init(parent, initial_apps_page);
+
+ search_box_view_ = new SearchBoxView(app_list_main_view_, delegate_);
+ search_box_view_->SetPaintToLayer(true);
+ search_box_view_->SetFillsBoundsOpaquely(false);
+ search_box_view_->layer()->SetMasksToBounds(true);
+ AddChildView(search_box_view_);
+
+ app_list_main_view_->Init(parent, initial_apps_page, search_box_view_);
// Speech recognition is available only when the start page exists.
if (delegate_ && delegate_->IsSpeechRecognitionEnabled()) {
@@ -493,6 +500,9 @@ bool AppListView::AcceleratorPressed(const ui::Accelerator& accelerator) {
}
void AppListView::Layout() {
+ search_box_view_->SetBoundsRect(
+ app_list_main_view_->contents_view()->GetDefaultSearchBoxBounds());
+
const gfx::Rect contents_bounds = GetContentsBounds();
app_list_main_view_->SetBoundsRect(contents_bounds);

Powered by Google App Engine
This is Rietveld 408576698