Commit dce5e75f authored by mgiuca's avatar mgiuca Committed by Commit bot

Deleted AppListViewDelegateObserver class (was unused).

BUG=600915

Review-Url: https://codereview.chromium.org/2350623002
Cr-Commit-Position: refs/heads/master@{#420559}
parent 0fb374e6
...@@ -61,7 +61,6 @@ ...@@ -61,7 +61,6 @@
#include "extensions/common/manifest_constants.h" #include "extensions/common/manifest_constants.h"
#include "extensions/common/manifest_handlers/launcher_page_info.h" #include "extensions/common/manifest_handlers/launcher_page_info.h"
#include "ui/app_list/app_list_switches.h" #include "ui/app_list/app_list_switches.h"
#include "ui/app_list/app_list_view_delegate_observer.h"
#include "ui/app_list/search_box_model.h" #include "ui/app_list/search_box_model.h"
#include "ui/app_list/search_controller.h" #include "ui/app_list/search_controller.h"
#include "ui/app_list/speech_ui_model.h" #include "ui/app_list/speech_ui_model.h"
...@@ -687,16 +686,6 @@ AppListViewDelegate::GetUsers() const { ...@@ -687,16 +686,6 @@ AppListViewDelegate::GetUsers() const {
return users_; return users_;
} }
void AppListViewDelegate::AddObserver(
app_list::AppListViewDelegateObserver* observer) {
observers_.AddObserver(observer);
}
void AppListViewDelegate::RemoveObserver(
app_list::AppListViewDelegateObserver* observer) {
observers_.RemoveObserver(observer);
}
void AppListViewDelegate::OnTemplateURLServiceChanged() { void AppListViewDelegate::OnTemplateURLServiceChanged() {
TemplateURLService* template_url_service = TemplateURLService* template_url_service =
TemplateURLServiceFactory::GetForProfile(profile_); TemplateURLServiceFactory::GetForProfile(profile_);
...@@ -720,9 +709,6 @@ void AppListViewDelegate::Observe(int type, ...@@ -720,9 +709,6 @@ void AppListViewDelegate::Observe(int type,
const content::NotificationDetails& details) { const content::NotificationDetails& details) {
DCHECK_EQ(chrome::NOTIFICATION_APP_TERMINATING, type); DCHECK_EQ(chrome::NOTIFICATION_APP_TERMINATING, type);
FOR_EACH_OBSERVER(app_list::AppListViewDelegateObserver, observers_,
OnShutdown());
SetProfile(nullptr); // Ensures launcher page web contents are torn down. SetProfile(nullptr); // Ensures launcher page web contents are torn down.
// SigninManagerFactory is not a leaky singleton (unlike this class), and // SigninManagerFactory is not a leaky singleton (unlike this class), and
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "base/memory/scoped_vector.h" #include "base/memory/scoped_vector.h"
#include "base/observer_list.h"
#include "base/scoped_observer.h" #include "base/scoped_observer.h"
#include "chrome/browser/profiles/profile_attributes_storage.h" #include "chrome/browser/profiles/profile_attributes_storage.h"
#include "chrome/browser/search/hotword_client.h" #include "chrome/browser/search/hotword_client.h"
...@@ -112,8 +111,6 @@ class AppListViewDelegate : public app_list::AppListViewDelegate, ...@@ -112,8 +111,6 @@ class AppListViewDelegate : public app_list::AppListViewDelegate,
#endif #endif
bool IsSpeechRecognitionEnabled() override; bool IsSpeechRecognitionEnabled() override;
const Users& GetUsers() const override; const Users& GetUsers() const override;
void AddObserver(app_list::AppListViewDelegateObserver* observer) override;
void RemoveObserver(app_list::AppListViewDelegateObserver* observer) override;
// Overridden from TemplateURLServiceObserver: // Overridden from TemplateURLServiceObserver:
void OnTemplateURLServiceChanged() override; void OnTemplateURLServiceChanged() override;
...@@ -192,8 +189,6 @@ class AppListViewDelegate : public app_list::AppListViewDelegate, ...@@ -192,8 +189,6 @@ class AppListViewDelegate : public app_list::AppListViewDelegate,
std::unique_ptr<AppSyncUIStateWatcher> app_sync_ui_state_watcher_; std::unique_ptr<AppSyncUIStateWatcher> app_sync_ui_state_watcher_;
#endif #endif
base::ObserverList<app_list::AppListViewDelegateObserver> observers_;
ScopedObserver<TemplateURLService, AppListViewDelegate> ScopedObserver<TemplateURLService, AppListViewDelegate>
template_url_service_observer_; template_url_service_observer_;
......
...@@ -32,7 +32,6 @@ class View; ...@@ -32,7 +32,6 @@ class View;
namespace app_list { namespace app_list {
class AppListModel; class AppListModel;
class AppListViewDelegateObserver;
class SearchResult; class SearchResult;
class SpeechUIModel; class SpeechUIModel;
...@@ -146,10 +145,6 @@ class APP_LIST_EXPORT AppListViewDelegate { ...@@ -146,10 +145,6 @@ class APP_LIST_EXPORT AppListViewDelegate {
// Returns the list of users (for AppListMenu). // Returns the list of users (for AppListMenu).
virtual const Users& GetUsers() const = 0; virtual const Users& GetUsers() const = 0;
// Adds/removes an observer for profile changes.
virtual void AddObserver(AppListViewDelegateObserver* observer) {}
virtual void RemoveObserver(AppListViewDelegateObserver* observer) {}
}; };
} // namespace app_list } // namespace app_list
......
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_APP_LIST_APP_LIST_VIEW_DELEGATE_OBSERVER_H_
#define UI_APP_LIST_APP_LIST_VIEW_DELEGATE_OBSERVER_H_
#include "ui/app_list/app_list_export.h"
namespace app_list {
// TODO(mgiuca): Remove this class; it isn't used any more.
class APP_LIST_EXPORT AppListViewDelegateObserver {
public:
// Invoked on Chrome shutdown. This is only needed on Mac, since reference-
// counting in Objective-C means that simply closing the window isn't enough
// to guarantee references to Chrome objects are gone.
virtual void OnShutdown() = 0;
protected:
virtual ~AppListViewDelegateObserver() {}
};
} // namespace app_list
#endif // UI_APP_LIST_APP_LIST_VIEW_DELEGATE_OBSERVER_H_
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "ui/app_list/app_list_model.h" #include "ui/app_list/app_list_model.h"
#include "ui/app_list/app_list_switches.h" #include "ui/app_list/app_list_switches.h"
#include "ui/app_list/app_list_view_delegate_observer.h"
#include "ui/app_list/test/app_list_test_model.h" #include "ui/app_list/test/app_list_test_model.h"
#include "ui/gfx/image/image_skia.h" #include "ui/gfx/image/image_skia.h"
...@@ -105,15 +104,5 @@ void AppListTestViewDelegate::ReplaceTestModel(int item_count) { ...@@ -105,15 +104,5 @@ void AppListTestViewDelegate::ReplaceTestModel(int item_count) {
model_->PopulateApps(item_count); model_->PopulateApps(item_count);
} }
void AppListTestViewDelegate::AddObserver(
AppListViewDelegateObserver* observer) {
observers_.AddObserver(observer);
}
void AppListTestViewDelegate::RemoveObserver(
AppListViewDelegateObserver* observer) {
observers_.RemoveObserver(observer);
}
} // namespace test } // namespace test
} // namespace app_list } // namespace app_list
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "base/callback_forward.h" #include "base/callback_forward.h"
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/observer_list.h"
#include "ui/app_list/app_list_view_delegate.h" #include "ui/app_list/app_list_view_delegate.h"
#include "ui/app_list/speech_ui_model.h" #include "ui/app_list/speech_ui_model.h"
...@@ -83,8 +82,6 @@ class AppListTestViewDelegate : public AppListViewDelegate { ...@@ -83,8 +82,6 @@ class AppListTestViewDelegate : public AppListViewDelegate {
#endif #endif
bool IsSpeechRecognitionEnabled() override; bool IsSpeechRecognitionEnabled() override;
const Users& GetUsers() const override; const Users& GetUsers() const override;
void AddObserver(AppListViewDelegateObserver* observer) override;
void RemoveObserver(AppListViewDelegateObserver* observer) override;
// Do a bulk replacement of the items in the model. // Do a bulk replacement of the items in the model.
void ReplaceTestModel(int item_count); void ReplaceTestModel(int item_count);
...@@ -100,7 +97,6 @@ class AppListTestViewDelegate : public AppListViewDelegate { ...@@ -100,7 +97,6 @@ class AppListTestViewDelegate : public AppListViewDelegate {
std::map<size_t, int> open_search_result_counts_; std::map<size_t, int> open_search_result_counts_;
Users users_; Users users_;
std::unique_ptr<AppListTestModel> model_; std::unique_ptr<AppListTestModel> model_;
base::ObserverList<AppListViewDelegateObserver> observers_;
SpeechUIModel speech_ui_; SpeechUIModel speech_ui_;
base::TimeDelta auto_launch_timeout_; base::TimeDelta auto_launch_timeout_;
......
...@@ -202,13 +202,11 @@ AppListView::AppListView(AppListViewDelegate* delegate) ...@@ -202,13 +202,11 @@ AppListView::AppListView(AppListViewDelegate* delegate)
animation_observer_(new HideViewAnimationObserver()) { animation_observer_(new HideViewAnimationObserver()) {
CHECK(delegate); CHECK(delegate);
delegate_->AddObserver(this);
delegate_->GetSpeechUI()->AddObserver(this); delegate_->GetSpeechUI()->AddObserver(this);
} }
AppListView::~AppListView() { AppListView::~AppListView() {
delegate_->GetSpeechUI()->RemoveObserver(this); delegate_->GetSpeechUI()->RemoveObserver(this);
delegate_->RemoveObserver(this);
animation_observer_.reset(); animation_observer_.reset();
// Remove child views first to ensure no remaining dependencies on delegate_. // Remove child views first to ensure no remaining dependencies on delegate_.
RemoveAllChildViews(true); RemoveAllChildViews(true);
...@@ -348,11 +346,6 @@ bool AppListView::ShouldDescendIntoChildForEventHandling( ...@@ -348,11 +346,6 @@ bool AppListView::ShouldDescendIntoChildForEventHandling(
ShouldDescendIntoChildForEventHandling(child, location); ShouldDescendIntoChildForEventHandling(child, location);
} }
void AppListView::OnShutdown() {
// Nothing to do on views - the widget will soon be closed, which will tear
// everything down.
}
void AppListView::SetProfileByPath(const base::FilePath& profile_path) { void AppListView::SetProfileByPath(const base::FilePath& profile_path) {
delegate_->SetProfileByPath(profile_path); delegate_->SetProfileByPath(profile_path);
app_list_main_view_->ModelChanged(); app_list_main_view_->ModelChanged();
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "base/observer_list.h" #include "base/observer_list.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "ui/app_list/app_list_export.h" #include "ui/app_list/app_list_export.h"
#include "ui/app_list/app_list_view_delegate_observer.h"
#include "ui/app_list/speech_ui_model_observer.h" #include "ui/app_list/speech_ui_model_observer.h"
#include "ui/views/bubble/bubble_dialog_delegate.h" #include "ui/views/bubble/bubble_dialog_delegate.h"
#include "ui/views/widget/widget.h" #include "ui/views/widget/widget.h"
...@@ -43,7 +42,6 @@ class AppListViewTestApi; ...@@ -43,7 +42,6 @@ class AppListViewTestApi;
// AppListView is the top-level view and controller of app list UI. It creates // AppListView is the top-level view and controller of app list UI. It creates
// and hosts a AppsGridView and passes AppListModel to it for display. // and hosts a AppsGridView and passes AppListModel to it for display.
class APP_LIST_EXPORT AppListView : public views::BubbleDialogDelegateView, class APP_LIST_EXPORT AppListView : public views::BubbleDialogDelegateView,
public AppListViewDelegateObserver,
public SpeechUIModelObserver { public SpeechUIModelObserver {
public: public:
// Does not take ownership of |delegate|. // Does not take ownership of |delegate|.
...@@ -98,9 +96,6 @@ class APP_LIST_EXPORT AppListView : public views::BubbleDialogDelegateView, ...@@ -98,9 +96,6 @@ class APP_LIST_EXPORT AppListView : public views::BubbleDialogDelegateView,
gfx::NativeView child, gfx::NativeView child,
const gfx::Point& location) override; const gfx::Point& location) override;
// Overridden from AppListViewDelegateObserver:
void OnShutdown() override;
void SetProfileByPath(const base::FilePath& profile_path); void SetProfileByPath(const base::FilePath& profile_path);
void AddObserver(AppListViewObserver* observer); void AddObserver(AppListViewObserver* observer);
......
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