Commit cb1f14b8 authored by calamity@chromium.org's avatar calamity@chromium.org

Add Hide and Show to the app list SearchBoxView.

This CL adds a Show and Hide to the app list SearchBoxView in preparation
for work pertaining to the experimental app list. The Show and Hide also
require that the AppListView's background repaints which have required
changes to the AppListView, AppListMainView and SearchBoxViewDelegate.

BUG=349727

Review URL: https://codereview.chromium.org/185623002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255899 0039d316-1c4b-4281-b951-d872f2087c98
parent aa4c5113
...@@ -55,8 +55,8 @@ void AppListBackground::Paint(gfx::Canvas* canvas, ...@@ -55,8 +55,8 @@ void AppListBackground::Paint(gfx::Canvas* canvas,
paint.setStyle(SkPaint::kFill_Style); paint.setStyle(SkPaint::kFill_Style);
int contents_top = bounds.y(); int contents_top = bounds.y();
if (main_view_->visible()) { views::View* search_box_view = main_view_->search_box_view();
views::View* search_box_view = main_view_->search_box_view(); if (main_view_->visible() && search_box_view->visible()) {
const gfx::Rect search_box_view_bounds = const gfx::Rect search_box_view_bounds =
search_box_view->ConvertRectToWidget(search_box_view->GetLocalBounds()); search_box_view->ConvertRectToWidget(search_box_view->GetLocalBounds());
gfx::Rect search_box_rect(bounds.x(), gfx::Rect search_box_rect(bounds.x(),
......
...@@ -204,6 +204,13 @@ void AppListMainView::OnItemIconLoaded(IconLoader* loader) { ...@@ -204,6 +204,13 @@ void AppListMainView::OnItemIconLoaded(IconLoader* loader) {
} }
} }
void AppListMainView::ChildVisibilityChanged(views::View* child) {
// Repaint the AppListView's background which will repaint the background for
// the search box.
if (child == search_box_view_ && parent())
parent()->SchedulePaint();
}
void AppListMainView::ActivateApp(AppListItem* item, int event_flags) { void AppListMainView::ActivateApp(AppListItem* item, int event_flags) {
// TODO(jennyz): Activate the folder via AppListModel notification. // TODO(jennyz): Activate the folder via AppListModel notification.
if (item->GetItemType() == AppListFolderItem::kItemType) if (item->GetItemType() == AppListFolderItem::kItemType)
......
...@@ -75,6 +75,9 @@ class APP_LIST_EXPORT AppListMainView : public views::View, ...@@ -75,6 +75,9 @@ class APP_LIST_EXPORT AppListMainView : public views::View,
// Invoked from an IconLoader when icon loading is finished. // Invoked from an IconLoader when icon loading is finished.
void OnItemIconLoaded(IconLoader* loader); void OnItemIconLoaded(IconLoader* loader);
// Overridden from views::View:
virtual void ChildVisibilityChanged(views::View* child) OVERRIDE;
// Overridden from AppsGridViewDelegate: // Overridden from AppsGridViewDelegate:
virtual void ActivateApp(AppListItem* item, int event_flags) OVERRIDE; virtual void ActivateApp(AppListItem* item, int event_flags) OVERRIDE;
virtual void GetShortcutPathForApp( virtual void GetShortcutPathForApp(
......
...@@ -411,6 +411,12 @@ void AppListView::Layout() { ...@@ -411,6 +411,12 @@ void AppListView::Layout() {
} }
} }
void AppListView::SchedulePaintInRect(const gfx::Rect& rect) {
BubbleDelegateView::SchedulePaintInRect(rect);
if (GetBubbleFrameView())
GetBubbleFrameView()->SchedulePaint();
}
void AppListView::OnWidgetDestroying(views::Widget* widget) { void AppListView::OnWidgetDestroying(views::Widget* widget) {
BubbleDelegateView::OnWidgetDestroying(widget); BubbleDelegateView::OnWidgetDestroying(widget);
if (delegate_ && widget == GetWidget()) if (delegate_ && widget == GetWidget())
......
...@@ -124,6 +124,7 @@ class APP_LIST_EXPORT AppListView : public views::BubbleDelegateView, ...@@ -124,6 +124,7 @@ class APP_LIST_EXPORT AppListView : public views::BubbleDelegateView,
// Overridden from views::View: // Overridden from views::View:
virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
virtual void Layout() OVERRIDE; virtual void Layout() OVERRIDE;
virtual void SchedulePaintInRect(const gfx::Rect& rect) OVERRIDE;
// Overridden from views::WidgetObserver: // Overridden from views::WidgetObserver:
virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE; virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment