Commit ee6d9cc2 authored by Weidong Guo's avatar Weidong Guo Committed by Commit Bot

Fix homecher launching app behavior

Changes:
In homecher, folder or search result page is closed when an app is
launched or a search result is opened.

Bug: 853846
Change-Id: I92edf732b01bb9c5b0f97ff2206bd09b2b6130ca
Reviewed-on: https://chromium-review.googlesource.com/1175417
Commit-Queue: Weidong Guo <weidongg@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583282}
parent 3def0f9e
...@@ -568,6 +568,9 @@ void AppListControllerImpl::OpenSearchResult(const std::string& result_id, ...@@ -568,6 +568,9 @@ void AppListControllerImpl::OpenSearchResult(const std::string& result_id,
if (client_) if (client_)
client_->OpenSearchResult(result_id, event_flags); client_->OpenSearchResult(result_id, event_flags);
if (IsHomeLauncherEnabledInTabletMode() && presenter_.IsVisible())
presenter_.GetView()->ResetToInitialState();
} }
void AppListControllerImpl::InvokeSearchResultAction( void AppListControllerImpl::InvokeSearchResultAction(
...@@ -614,6 +617,9 @@ void AppListControllerImpl::ActivateItem(const std::string& id, ...@@ -614,6 +617,9 @@ void AppListControllerImpl::ActivateItem(const std::string& id,
int event_flags) { int event_flags) {
if (client_) if (client_)
client_->ActivateItem(id, event_flags); client_->ActivateItem(id, event_flags);
if (IsHomeLauncherEnabledInTabletMode() && presenter_.IsVisible())
presenter_.GetView()->ResetToInitialState();
} }
void AppListControllerImpl::GetContextMenuModel( void AppListControllerImpl::GetContextMenuModel(
......
...@@ -395,6 +395,10 @@ void AppListView::Dismiss() { ...@@ -395,6 +395,10 @@ void AppListView::Dismiss() {
GetWidget()->Deactivate(); GetWidget()->Deactivate();
} }
void AppListView::ResetToInitialState() {
app_list_main_view_->contents_view()->Back();
}
void AppListView::SetAppListOverlayVisible(bool visible) { void AppListView::SetAppListOverlayVisible(bool visible) {
DCHECK(overlay_view_); DCHECK(overlay_view_);
......
...@@ -126,6 +126,9 @@ class APP_LIST_EXPORT AppListView : public views::WidgetDelegateView, ...@@ -126,6 +126,9 @@ class APP_LIST_EXPORT AppListView : public views::WidgetDelegateView,
// Dismisses the UI, cleans up and sets the state to CLOSED. // Dismisses the UI, cleans up and sets the state to CLOSED.
void Dismiss(); void Dismiss();
// Resets the UI to initial state.
void ResetToInitialState();
// Enables/disables a semi-transparent overlay over the app list (good for // Enables/disables a semi-transparent overlay over the app list (good for
// hiding the app list when a modal dialog is being shown). // hiding the app list when a modal dialog is being shown).
void SetAppListOverlayVisible(bool visible); void SetAppListOverlayVisible(bool visible);
......
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