summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorcalamity <calamity@chromium.org>2014-12-10 01:01:31 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-10 09:01:46 +0000
commit9b73eaff36bbb2f6038d8500e4fbc1838936294c (patch)
treefd4ecfac0a186de80e3b0da29fc9a7eb0824e558 /ui
parent99ec6733eda11730c9a30ad338d8ed4bbf6791d4 (diff)
downloadchromium_src-9b73eaff36bbb2f6038d8500e4fbc1838936294c.zip
chromium_src-9b73eaff36bbb2f6038d8500e4fbc1838936294c.tar.gz
chromium_src-9b73eaff36bbb2f6038d8500e4fbc1838936294c.tar.bz2
Remove app uninstall from ui/app_list.
This CL removes an obsolete codepath that updated the app list search results when an app was uninstalled. This was enabled by https://codereview.chromium.org/781643003/. BUG=438120 Review URL: https://codereview.chromium.org/776193002 Cr-Commit-Position: refs/heads/master@{#307661}
Diffstat (limited to 'ui')
-rw-r--r--ui/app_list/cocoa/app_list_view_controller.mm4
-rw-r--r--ui/app_list/cocoa/apps_search_results_controller.h1
-rw-r--r--ui/app_list/cocoa/apps_search_results_controller_unittest.mm19
-rw-r--r--ui/app_list/cocoa/apps_search_results_model_bridge.mm10
-rw-r--r--ui/app_list/search_result.cc4
-rw-r--r--ui/app_list/search_result.h1
-rw-r--r--ui/app_list/search_result_observer.h3
-rw-r--r--ui/app_list/views/app_list_main_view.cc10
-rw-r--r--ui/app_list/views/app_list_main_view.h1
-rw-r--r--ui/app_list/views/search_result_list_view.cc5
-rw-r--r--ui/app_list/views/search_result_list_view.h2
-rw-r--r--ui/app_list/views/search_result_list_view_delegate.h3
-rw-r--r--ui/app_list/views/search_result_list_view_unittest.cc1
-rw-r--r--ui/app_list/views/search_result_page_view_unittest.cc1
-rw-r--r--ui/app_list/views/search_result_view.cc4
-rw-r--r--ui/app_list/views/search_result_view.h1
16 files changed, 0 insertions, 70 deletions
diff --git a/ui/app_list/cocoa/app_list_view_controller.mm b/ui/app_list/cocoa/app_list_view_controller.mm
index f4de6a1..3007fae 100644
--- a/ui/app_list/cocoa/app_list_view_controller.mm
+++ b/ui/app_list/cocoa/app_list_view_controller.mm
@@ -361,10 +361,6 @@ void AppListModelObserverBridge::OnShutdown() {
}
}
-- (void)redoSearch {
- [self modelTextDidChange];
-}
-
- (void)onProfilesChanged {
[appsSearchBoxController_ rebuildMenu];
}
diff --git a/ui/app_list/cocoa/apps_search_results_controller.h b/ui/app_list/cocoa/apps_search_results_controller.h
index 52290c7..063fde6 100644
--- a/ui/app_list/cocoa/apps_search_results_controller.h
+++ b/ui/app_list/cocoa/apps_search_results_controller.h
@@ -24,7 +24,6 @@ class SearchResult;
- (app_list::AppListModel*)appListModel;
- (void)openResult:(app_list::SearchResult*)result;
-- (void)redoSearch;
@end
diff --git a/ui/app_list/cocoa/apps_search_results_controller_unittest.mm b/ui/app_list/cocoa/apps_search_results_controller_unittest.mm
index ed840b5..a839208 100644
--- a/ui/app_list/cocoa/apps_search_results_controller_unittest.mm
+++ b/ui/app_list/cocoa/apps_search_results_controller_unittest.mm
@@ -21,11 +21,9 @@
@private
app_list::test::AppListTestModel appListModel_;
app_list::SearchResult* lastOpenedResult_;
- int redoSearchCount_;
}
@property(readonly, nonatomic) app_list::SearchResult* lastOpenedResult;
-@property(readonly, nonatomic) int redoSearchCount;
- (void)quitMessageLoop;
@@ -34,7 +32,6 @@
@implementation TestAppsSearchResultsDelegate
@synthesize lastOpenedResult = lastOpenedResult_;
-@synthesize redoSearchCount = redoSearchCount_;
- (app_list::AppListModel*)appListModel {
return &appListModel_;
@@ -44,10 +41,6 @@
lastOpenedResult_ = result;
}
-- (void)redoSearch {
- ++redoSearchCount_;
-}
-
- (void)quitMessageLoop {
base::MessageLoop::current()->QuitNow();
}
@@ -300,17 +293,5 @@ TEST_F(AppsSearchResultsControllerTest, ContextMenus) {
EXPECT_NSEQ(@"Menu For: Result 1", [[menu itemAtIndex:0] title]);
}
-// Test that observing a search result item uninstall performs the search again.
-TEST_F(AppsSearchResultsControllerTest, UninstallReperformsSearch) {
- base::MessageLoopForUI message_loop;
- EXPECT_EQ(0, [delegate_ redoSearchCount]);
- ModelResultAt(0)->NotifyItemUninstalled();
- [delegate_ performSelector:@selector(quitMessageLoop)
- withObject:nil
- afterDelay:0];
- message_loop.Run();
- EXPECT_EQ(1, [delegate_ redoSearchCount]);
-}
-
} // namespace test
} // namespace app_list
diff --git a/ui/app_list/cocoa/apps_search_results_model_bridge.mm b/ui/app_list/cocoa/apps_search_results_model_bridge.mm
index 3712318..18acb2f 100644
--- a/ui/app_list/cocoa/apps_search_results_model_bridge.mm
+++ b/ui/app_list/cocoa/apps_search_results_model_bridge.mm
@@ -48,7 +48,6 @@ class AppsSearchResultsModelBridge::ItemObserver : public SearchResultObserver {
void OnIsInstallingChanged() override {}
void OnPercentDownloadedChanged() override {}
void OnItemInstalled() override {}
- void OnItemUninstalled() override;
private:
AppsSearchResultsModelBridge* bridge_; // Weak. Owns us.
@@ -59,15 +58,6 @@ class AppsSearchResultsModelBridge::ItemObserver : public SearchResultObserver {
DISALLOW_COPY_AND_ASSIGN(ItemObserver);
};
-void AppsSearchResultsModelBridge::ItemObserver::OnItemUninstalled() {
- // Performing the search again will destroy |this|, so post a task. This also
- // ensures that the AppSearchProvider has observed the uninstall before
- // performing the search again, otherwise it will provide a NULL result.
- [[bridge_->parent_ delegate] performSelector:@selector(redoSearch)
- withObject:nil
- afterDelay:0];
-}
-
AppsSearchResultsModelBridge::AppsSearchResultsModelBridge(
AppsSearchResultsController* results_controller)
: parent_(results_controller) {
diff --git a/ui/app_list/search_result.cc b/ui/app_list/search_result.cc
index 653d089..4eee232 100644
--- a/ui/app_list/search_result.cc
+++ b/ui/app_list/search_result.cc
@@ -85,10 +85,6 @@ void SearchResult::NotifyItemInstalled() {
FOR_EACH_OBSERVER(SearchResultObserver, observers_, OnItemInstalled());
}
-void SearchResult::NotifyItemUninstalled() {
- FOR_EACH_OBSERVER(SearchResultObserver, observers_, OnItemUninstalled());
-}
-
void SearchResult::AddObserver(SearchResultObserver* observer) {
observers_.AddObserver(observer);
}
diff --git a/ui/app_list/search_result.h b/ui/app_list/search_result.h
index dd955a6..a6636e4 100644
--- a/ui/app_list/search_result.h
+++ b/ui/app_list/search_result.h
@@ -114,7 +114,6 @@ class APP_LIST_EXPORT SearchResult {
int GetPreferredIconDimension() const;
void NotifyItemInstalled();
- void NotifyItemUninstalled();
void AddObserver(SearchResultObserver* observer);
void RemoveObserver(SearchResultObserver* observer);
diff --git a/ui/app_list/search_result_observer.h b/ui/app_list/search_result_observer.h
index 09249ae..d8f8900 100644
--- a/ui/app_list/search_result_observer.h
+++ b/ui/app_list/search_result_observer.h
@@ -26,9 +26,6 @@ class APP_LIST_EXPORT SearchResultObserver {
// Invoked when the item represented by the SearchResult is installed.
virtual void OnItemInstalled() {}
- // Invoked when the item represented by the SearchResult is uninstalled.
- virtual void OnItemUninstalled() {}
-
// Invoked just before the SearchResult is destroyed.
virtual void OnResultDestroying() {}
diff --git a/ui/app_list/views/app_list_main_view.cc b/ui/app_list/views/app_list_main_view.cc
index ef551d3..1bcf728 100644
--- a/ui/app_list/views/app_list_main_view.cc
+++ b/ui/app_list/views/app_list_main_view.cc
@@ -347,14 +347,4 @@ void AppListMainView::OnResultInstalled(SearchResult* result) {
search_box_view_->ClearSearch();
}
-void AppListMainView::OnResultUninstalled(SearchResult* result) {
- // Resubmit the query via a posted task so that all observers for the
- // uninstall notification are notified.
- base::MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(&AppListMainView::QueryChanged,
- weak_ptr_factory_.GetWeakPtr(),
- search_box_view_));
-}
-
} // namespace app_list
diff --git a/ui/app_list/views/app_list_main_view.h b/ui/app_list/views/app_list_main_view.h
index 81f2683..5d1a131 100644
--- a/ui/app_list/views/app_list_main_view.h
+++ b/ui/app_list/views/app_list_main_view.h
@@ -111,7 +111,6 @@ class APP_LIST_EXPORT AppListMainView : public views::View,
// Overridden from SearchResultListViewDelegate:
void OnResultInstalled(SearchResult* result) override;
- void OnResultUninstalled(SearchResult* result) override;
AppListViewDelegate* delegate_; // Owned by parent view (AppListView).
AppListModel* model_; // Unowned; ownership is handled by |delegate_|.
diff --git a/ui/app_list/views/search_result_list_view.cc b/ui/app_list/views/search_result_list_view.cc
index a6d64a58..dea0a86 100644
--- a/ui/app_list/views/search_result_list_view.cc
+++ b/ui/app_list/views/search_result_list_view.cc
@@ -248,9 +248,4 @@ void SearchResultListView::OnSearchResultInstalled(SearchResultView* view) {
delegate_->OnResultInstalled(view->result());
}
-void SearchResultListView::OnSearchResultUninstalled(SearchResultView* view) {
- if (delegate_ && view->result())
- delegate_->OnResultUninstalled(view->result());
-}
-
} // namespace app_list
diff --git a/ui/app_list/views/search_result_list_view.h b/ui/app_list/views/search_result_list_view.h
index e01b4aa..7acf75e 100644
--- a/ui/app_list/views/search_result_list_view.h
+++ b/ui/app_list/views/search_result_list_view.h
@@ -45,8 +45,6 @@ class APP_LIST_EXPORT SearchResultListView : public gfx::AnimationDelegate,
void OnSearchResultInstalled(SearchResultView* view);
- void OnSearchResultUninstalled(SearchResultView* view);
-
// Overridden from views::View:
bool OnKeyPressed(const ui::KeyEvent& event) override;
gfx::Size GetPreferredSize() const override;
diff --git a/ui/app_list/views/search_result_list_view_delegate.h b/ui/app_list/views/search_result_list_view_delegate.h
index b2e15fb..cd5f51b 100644
--- a/ui/app_list/views/search_result_list_view_delegate.h
+++ b/ui/app_list/views/search_result_list_view_delegate.h
@@ -16,9 +16,6 @@ class APP_LIST_EXPORT SearchResultListViewDelegate {
// Called when the app represented by |result| is installed.
virtual void OnResultInstalled(SearchResult* result) = 0;
- // Called when the app represented by |result| is uninstalled.
- virtual void OnResultUninstalled(SearchResult* result) = 0;
-
protected:
virtual ~SearchResultListViewDelegate() {}
};
diff --git a/ui/app_list/views/search_result_list_view_unittest.cc b/ui/app_list/views/search_result_list_view_unittest.cc
index 38f346b..f5beab6 100644
--- a/ui/app_list/views/search_result_list_view_unittest.cc
+++ b/ui/app_list/views/search_result_list_view_unittest.cc
@@ -113,7 +113,6 @@ class SearchResultListViewTest : public views::ViewsTestBase,
private:
void OnResultInstalled(SearchResult* result) override {}
- void OnResultUninstalled(SearchResult* result) override {}
AppListTestViewDelegate view_delegate_;
scoped_ptr<SearchResultListView> view_;
diff --git a/ui/app_list/views/search_result_page_view_unittest.cc b/ui/app_list/views/search_result_page_view_unittest.cc
index 33cdaed..e89657e 100644
--- a/ui/app_list/views/search_result_page_view_unittest.cc
+++ b/ui/app_list/views/search_result_page_view_unittest.cc
@@ -68,7 +68,6 @@ class SearchResultPageViewTest : public views::ViewsTestBase,
private:
void OnResultInstalled(SearchResult* result) override {}
- void OnResultUninstalled(SearchResult* result) override {}
SearchResultListView* list_view_;
SearchResultTileItemListView* tile_list_view_;
diff --git a/ui/app_list/views/search_result_view.cc b/ui/app_list/views/search_result_view.cc
index 42a1280..1a73c14 100644
--- a/ui/app_list/views/search_result_view.cc
+++ b/ui/app_list/views/search_result_view.cc
@@ -320,10 +320,6 @@ void SearchResultView::OnItemInstalled() {
list_view_->OnSearchResultInstalled(this);
}
-void SearchResultView::OnItemUninstalled() {
- list_view_->OnSearchResultUninstalled(this);
-}
-
void SearchResultView::OnSearchResultActionActivated(size_t index,
int event_flags) {
// |result_| could be NULL when result list is changing.
diff --git a/ui/app_list/views/search_result_view.h b/ui/app_list/views/search_result_view.h
index b41e8c2..f84f7af 100644
--- a/ui/app_list/views/search_result_view.h
+++ b/ui/app_list/views/search_result_view.h
@@ -87,7 +87,6 @@ class SearchResultView : public views::CustomButton,
void OnIsInstallingChanged() override;
void OnPercentDownloadedChanged() override;
void OnItemInstalled() override;
- void OnItemUninstalled() override;
// SearchResultActionsViewDelegate overrides:
void OnSearchResultActionActivated(size_t index, int event_flags) override;