summaryrefslogtreecommitdiffstats
path: root/ui/app_list
diff options
context:
space:
mode:
authorstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-08 21:27:22 +0000
committerstevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-08 21:27:22 +0000
commit6a26a905739eca0cf3777b032c81d8b3c49bb41b (patch)
treeb384dc5a316c3496b443e4d0087b1062fe184c6e /ui/app_list
parenta76f3e0dd50b85b58c87c432dd64d20680f9cfc8 (diff)
downloadchromium_src-6a26a905739eca0cf3777b032c81d8b3c49bb41b.zip
chromium_src-6a26a905739eca0cf3777b032c81d8b3c49bb41b.tar.gz
chromium_src-6a26a905739eca0cf3777b032c81d8b3c49bb41b.tar.bz2
Move AppListModel::Users to AppListViewDelegate
This is some minor re-factoring to simplify AppListModel in preparation for making it associated with a Profile for syncing. While not strictly necessary, it is confusing to have a list of "Users" associated with a model that describes the list of apps for a specific user. Also, the list of Users is only used by AppListMenu and can be maintained by AppListViewDelegate. One side effect of this change is that views will not be notified if the user list changes and therefore can not invalidate the menu. While this could be addressed, it shoudln't generally be possible to add a user while the app list UI is visible, so the added complexity did not seem worth supporting a theoretical edge case. BUG=315887 For ash/shell/app_list.cc: TBR=jamescook@chromium.org Review URL: https://codereview.chromium.org/63283003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233996 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/app_list')
-rw-r--r--ui/app_list/app_list.gyp1
-rw-r--r--ui/app_list/app_list_menu.cc5
-rw-r--r--ui/app_list/app_list_menu.h10
-rw-r--r--ui/app_list/app_list_model.cc11
-rw-r--r--ui/app_list/app_list_model.h30
-rw-r--r--ui/app_list/app_list_model_observer.h3
-rw-r--r--ui/app_list/app_list_model_unittest.cc19
-rw-r--r--ui/app_list/app_list_view_delegate.cc15
-rw-r--r--ui/app_list/app_list_view_delegate.h26
-rw-r--r--ui/app_list/cocoa/app_list_view_controller.mm5
-rw-r--r--ui/app_list/cocoa/apps_search_box_controller.mm3
-rw-r--r--ui/app_list/cocoa/apps_search_box_controller_unittest.mm38
-rw-r--r--ui/app_list/test/app_list_test_view_delegate.cc4
-rw-r--r--ui/app_list/test/app_list_test_view_delegate.h7
-rw-r--r--ui/app_list/views/app_list_menu_views.cc6
-rw-r--r--ui/app_list/views/app_list_menu_views.h5
-rw-r--r--ui/app_list/views/app_list_view.cc4
-rw-r--r--ui/app_list/views/app_list_view.h1
-rw-r--r--ui/app_list/views/search_box_view.cc2
19 files changed, 82 insertions, 113 deletions
diff --git a/ui/app_list/app_list.gyp b/ui/app_list/app_list.gyp
index c86c37c..b1d6834 100644
--- a/ui/app_list/app_list.gyp
+++ b/ui/app_list/app_list.gyp
@@ -41,6 +41,7 @@
'app_list_model.cc',
'app_list_model.h',
'app_list_model_observer.h',
+ 'app_list_view_delegate.cc',
'app_list_view_delegate.h',
'cocoa/app_list_pager_view.h',
'cocoa/app_list_pager_view.mm',
diff --git a/ui/app_list/app_list_menu.cc b/ui/app_list/app_list_menu.cc
index 896bcf9..8c0727c 100644
--- a/ui/app_list/app_list_menu.cc
+++ b/ui/app_list/app_list_menu.cc
@@ -13,11 +13,10 @@
namespace app_list {
-AppListMenu::AppListMenu(AppListViewDelegate* delegate,
- const AppListModel::Users& users)
+AppListMenu::AppListMenu(AppListViewDelegate* delegate)
: menu_model_(this),
delegate_(delegate),
- users_(users) {
+ users_(delegate->GetUsers()) {
InitMenu();
}
diff --git a/ui/app_list/app_list_menu.h b/ui/app_list/app_list_menu.h
index fa42b93..6520e1d 100644
--- a/ui/app_list/app_list_menu.h
+++ b/ui/app_list/app_list_menu.h
@@ -5,13 +5,11 @@
#ifndef UI_APP_LIST_APP_LIST_MENU_H_
#define UI_APP_LIST_APP_LIST_MENU_H_
-#include "ui/app_list/app_list_model.h"
+#include "ui/app_list/app_list_view_delegate.h"
#include "ui/base/models/simple_menu_model.h"
namespace app_list {
-class AppListViewDelegate;
-
// Menu for the app list. This is shown in the top right hand corner of the
// app list.
// TODO(benwells): We should consider moving this into Chrome.
@@ -26,9 +24,7 @@ class AppListMenu : public ui::SimpleMenuModel::Delegate {
SELECT_PROFILE,
};
- AppListMenu(
- AppListViewDelegate* delegate,
- const AppListModel::Users& users);
+ explicit AppListMenu(AppListViewDelegate* delegate);
virtual ~AppListMenu();
ui::SimpleMenuModel* menu_model() { return &menu_model_; }
@@ -45,7 +41,7 @@ class AppListMenu : public ui::SimpleMenuModel::Delegate {
ui::SimpleMenuModel menu_model_;
AppListViewDelegate* delegate_;
- AppListModel::Users users_;
+ AppListViewDelegate::Users users_;
DISALLOW_COPY_AND_ASSIGN(AppListMenu);
};
diff --git a/ui/app_list/app_list_model.cc b/ui/app_list/app_list_model.cc
index 40bb8e9..535fff2 100644
--- a/ui/app_list/app_list_model.cc
+++ b/ui/app_list/app_list_model.cc
@@ -11,10 +11,6 @@
namespace app_list {
-AppListModel::User::User() : active(false) {}
-
-AppListModel::User::~User() {}
-
AppListModel::AppListModel()
: item_list_(new AppListItemList),
search_box_(new SearchBoxModel),
@@ -44,13 +40,6 @@ void AppListModel::SetStatus(Status status) {
OnAppListModelStatusChanged());
}
-void AppListModel::SetUsers(const Users& users) {
- users_ = users;
- FOR_EACH_OBSERVER(AppListModelObserver,
- observers_,
- OnAppListModelUsersChanged());
-}
-
void AppListModel::SetSignedIn(bool signed_in) {
if (signed_in_ == signed_in)
return;
diff --git a/ui/app_list/app_list_model.h b/ui/app_list/app_list_model.h
index fbc7970..9b3235f 100644
--- a/ui/app_list/app_list_model.h
+++ b/ui/app_list/app_list_model.h
@@ -5,13 +5,9 @@
#ifndef UI_APP_LIST_APP_LIST_MODEL_H_
#define UI_APP_LIST_APP_LIST_MODEL_H_
-#include <vector>
-
#include "base/basictypes.h"
-#include "base/files/file_path.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
-#include "base/strings/string16.h"
#include "ui/app_list/app_list_export.h"
#include "ui/app_list/app_list_item_list.h"
#include "ui/base/models/list_model.h"
@@ -30,31 +26,12 @@ class SearchResult;
// the model for SearchBoxView. SearchResults owns a list of SearchResult.
class APP_LIST_EXPORT AppListModel {
public:
- // A user of the app list.
- struct APP_LIST_EXPORT User {
- User();
- ~User();
-
- // Whether or not this user is the current user of the app list.
- bool active;
-
- // The name of this user.
- base::string16 name;
-
- // The email address of this user.
- base::string16 email;
-
- // The path to this user's profile directory.
- base::FilePath profile_path;
- };
-
enum Status {
STATUS_NORMAL,
STATUS_SYNCING, // Syncing apps or installing synced apps.
};
typedef ui::ListModel<SearchResult> SearchResults;
- typedef std::vector<User> Users;
AppListModel();
~AppListModel();
@@ -63,7 +40,6 @@ class APP_LIST_EXPORT AppListModel {
void RemoveObserver(AppListModelObserver* observer);
void SetStatus(Status status);
- void SetUsers(const Users& profile_menu_items);
void SetSignedIn(bool signed_in);
AppListItemList* item_list() { return item_list_.get(); }
@@ -72,17 +48,11 @@ class APP_LIST_EXPORT AppListModel {
Status status() const { return status_; }
bool signed_in() const { return signed_in_; }
- const Users& users() const {
- return users_;
- }
-
private:
scoped_ptr<AppListItemList> item_list_;
scoped_ptr<SearchBoxModel> search_box_;
scoped_ptr<SearchResults> results_;
- Users users_;
-
bool signed_in_;
Status status_;
ObserverList<AppListModelObserver> observers_;
diff --git a/ui/app_list/app_list_model_observer.h b/ui/app_list/app_list_model_observer.h
index e409fa7..ddd0f74 100644
--- a/ui/app_list/app_list_model_observer.h
+++ b/ui/app_list/app_list_model_observer.h
@@ -14,9 +14,6 @@ class APP_LIST_EXPORT AppListModelObserver {
// Invoked when AppListModel's status has changed.
virtual void OnAppListModelStatusChanged() {}
- // Invoked when AppListModel's profile menu items have changed.
- virtual void OnAppListModelUsersChanged() {}
-
// Invoked when AppListModel's current user's signin status has changed.
virtual void OnAppListModelSigninStatusChanged() {}
diff --git a/ui/app_list/app_list_model_unittest.cc b/ui/app_list/app_list_model_unittest.cc
index 12486a6..944b71a 100644
--- a/ui/app_list/app_list_model_unittest.cc
+++ b/ui/app_list/app_list_model_unittest.cc
@@ -23,7 +23,6 @@ class TestObserver : public AppListModelObserver,
public:
TestObserver()
: status_changed_count_(0),
- users_changed_count_(0),
signin_changed_count_(0),
items_added_(0),
items_removed_(0),
@@ -37,10 +36,6 @@ class TestObserver : public AppListModelObserver,
++status_changed_count_;
}
- virtual void OnAppListModelUsersChanged() OVERRIDE {
- ++users_changed_count_;
- }
-
virtual void OnAppListModelSigninStatusChanged() OVERRIDE {
++signin_changed_count_;
}
@@ -62,7 +57,6 @@ class TestObserver : public AppListModelObserver,
}
int status_changed_count() const { return status_changed_count_; }
- int users_changed_count() const { return users_changed_count_; }
int signin_changed_count() const { return signin_changed_count_; }
size_t items_added() { return items_added_; }
size_t items_removed() { return items_removed_; }
@@ -70,7 +64,6 @@ class TestObserver : public AppListModelObserver,
void ResetCounts() {
status_changed_count_ = 0;
- users_changed_count_ = 0;
signin_changed_count_ = 0;
items_added_ = 0;
items_removed_ = 0;
@@ -79,7 +72,6 @@ class TestObserver : public AppListModelObserver,
private:
int status_changed_count_;
- int users_changed_count_;
int signin_changed_count_;
size_t items_added_;
size_t items_removed_;
@@ -130,17 +122,6 @@ TEST_F(AppListModelTest, SetStatus) {
EXPECT_EQ(2, observer_.status_changed_count());
}
-TEST_F(AppListModelTest, SetUsers) {
- EXPECT_EQ(0u, model_.users().size());
- AppListModel::Users users;
- users.push_back(AppListModel::User());
- users[0].name = UTF8ToUTF16("test");
- model_.SetUsers(users);
- EXPECT_EQ(1, observer_.users_changed_count());
- ASSERT_EQ(1u, model_.users().size());
- EXPECT_EQ(UTF8ToUTF16("test"), model_.users()[0].name);
-}
-
TEST_F(AppListModelTest, SetSignedIn) {
EXPECT_TRUE(model_.signed_in());
model_.SetSignedIn(false);
diff --git a/ui/app_list/app_list_view_delegate.cc b/ui/app_list/app_list_view_delegate.cc
new file mode 100644
index 0000000..2156cf5
--- /dev/null
+++ b/ui/app_list/app_list_view_delegate.cc
@@ -0,0 +1,15 @@
+// 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.
+
+#include "ui/app_list/app_list_view_delegate.h"
+
+namespace app_list {
+
+AppListViewDelegate::User::User() : active(false) {
+}
+
+AppListViewDelegate::User::~User() {
+}
+
+} // app_list
diff --git a/ui/app_list/app_list_view_delegate.h b/ui/app_list/app_list_view_delegate.h
index 822d14f..4a217db 100644
--- a/ui/app_list/app_list_view_delegate.h
+++ b/ui/app_list/app_list_view_delegate.h
@@ -5,7 +5,11 @@
#ifndef UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_
#define UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_
+#include <vector>
+
#include "base/callback_forward.h"
+#include "base/files/file_path.h"
+#include "base/strings/string16.h"
#include "base/strings/string16.h"
#include "ui/app_list/app_list_export.h"
@@ -30,6 +34,25 @@ class SigninDelegate;
class APP_LIST_EXPORT AppListViewDelegate {
public:
+ // A user of the app list.
+ struct APP_LIST_EXPORT User {
+ User();
+ ~User();
+
+ // Whether or not this user is the current user of the app list.
+ bool active;
+
+ // The name of this user.
+ base::string16 name;
+
+ // The email address of this user.
+ base::string16 email;
+
+ // The path to this user's profile directory.
+ base::FilePath profile_path;
+ };
+ typedef std::vector<User> Users;
+
// AppListView owns the delegate.
virtual ~AppListViewDelegate() {}
@@ -97,6 +120,9 @@ class APP_LIST_EXPORT AppListViewDelegate {
// Get the start page web contents. Owned by the AppListViewDelegate.
virtual content::WebContents* GetStartPageContents() = 0;
+
+ // Returns the list of users (for AppListMenu).
+ virtual const Users& GetUsers() const = 0;
};
} // namespace app_list
diff --git a/ui/app_list/cocoa/app_list_view_controller.mm b/ui/app_list/cocoa/app_list_view_controller.mm
index 5e5eea5..d9b4f54 100644
--- a/ui/app_list/cocoa/app_list_view_controller.mm
+++ b/ui/app_list/cocoa/app_list_view_controller.mm
@@ -88,7 +88,6 @@ class AppListModelObserverBridge : public AppListModelObserver {
private:
// Overridden from app_list::AppListModelObserver:
- virtual void OnAppListModelUsersChanged() OVERRIDE;
virtual void OnAppListModelSigninStatusChanged() OVERRIDE;
AppListViewController* parent_; // Weak. Owns us.
@@ -106,10 +105,6 @@ AppListModelObserverBridge::~AppListModelObserverBridge() {
[[parent_ appsGridController] model]->RemoveObserver(this);
}
-void AppListModelObserverBridge::OnAppListModelUsersChanged() {
- [parent_ onSigninStatusChanged];
-}
-
void AppListModelObserverBridge::OnAppListModelSigninStatusChanged() {
[parent_ onSigninStatusChanged];
}
diff --git a/ui/app_list/cocoa/apps_search_box_controller.mm b/ui/app_list/cocoa/apps_search_box_controller.mm
index 3d545bc..93a96cb 100644
--- a/ui/app_list/cocoa/apps_search_box_controller.mm
+++ b/ui/app_list/cocoa/apps_search_box_controller.mm
@@ -161,8 +161,7 @@ void SearchBoxModelObserverBridge::TextChanged() {
menuController_.reset();
appListMenu_.reset(
- new app_list::AppListMenu([delegate_ appListDelegate],
- [delegate_ appListModel]->users()));
+ new app_list::AppListMenu([delegate_ appListDelegate]));
menuController_.reset([[AppListMenuController alloc]
initWithSearchBoxController:self]);
[menuButton_ setMenu:[menuController_ menu]]; // Menu will populate here.
diff --git a/ui/app_list/cocoa/apps_search_box_controller_unittest.mm b/ui/app_list/cocoa/apps_search_box_controller_unittest.mm
index d410380..bbe7ce6 100644
--- a/ui/app_list/cocoa/apps_search_box_controller_unittest.mm
+++ b/ui/app_list/cocoa/apps_search_box_controller_unittest.mm
@@ -34,12 +34,12 @@
- (id)init {
if ((self = [super init])) {
- app_list::AppListModel::Users users(2);
+ app_list::AppListViewDelegate::Users users(2);
users[0].name = ASCIIToUTF16("user1");
users[1].name = ASCIIToUTF16("user2");
users[1].email = ASCIIToUTF16("user2@chromium.org");
users[1].active = true;
- appListModel_.SetUsers(users);
+ appListDelegate_.SetUsers(users);
}
return self;
}
@@ -52,6 +52,11 @@
return &appListDelegate_;
}
+- (app_list::test::AppListTestViewDelegate*)appListTestViewDelegate {
+ return &appListDelegate_;
+}
+
+
- (BOOL)control:(NSControl*)control
textView:(NSTextView*)textView
doCommandBySelector:(SEL)command {
@@ -75,8 +80,7 @@
namespace app_list {
namespace test {
-class AppsSearchBoxControllerTest : public ui::CocoaTest,
- public AppListModelObserver {
+class AppsSearchBoxControllerTest : public ui::CocoaTest {
public:
AppsSearchBoxControllerTest() {
Init();
@@ -88,14 +92,12 @@ class AppsSearchBoxControllerTest : public ui::CocoaTest,
NSMakeRect(0, 0, 400, 100)]);
delegate_.reset([[TestAppsSearchBoxDelegate alloc] init]);
[apps_search_box_controller_ setDelegate:delegate_];
- [delegate_ appListModel]->AddObserver(this);
ui::CocoaTest::SetUp();
[[test_window() contentView] addSubview:[apps_search_box_controller_ view]];
}
virtual void TearDown() OVERRIDE {
- [delegate_ appListModel]->RemoveObserver(this);
[apps_search_box_controller_ setDelegate:nil];
ui::CocoaTest::TearDown();
}
@@ -108,13 +110,6 @@ class AppsSearchBoxControllerTest : public ui::CocoaTest,
}
protected:
- // Overridden from app_list::AppListModelObserver:
- virtual void OnAppListModelUsersChanged() OVERRIDE {
- [apps_search_box_controller_ rebuildMenu];
- }
-
- virtual void OnAppListModelSigninStatusChanged() OVERRIDE {}
-
base::scoped_nsobject<TestAppsSearchBoxDelegate> delegate_;
base::scoped_nsobject<AppsSearchBoxController> apps_search_box_controller_;
@@ -163,7 +158,8 @@ TEST_F(AppsSearchBoxControllerTest, SearchBoxModel) {
TEST_F(AppsSearchBoxControllerTest, SearchBoxMenuSingleUser) {
// Set a single user. We need to set the delegate again because the
// AppListModel observer isn't hooked up in these tests.
- [delegate_ appListModel]->SetUsers(app_list::AppListModel::Users(1));
+ [delegate_ appListTestViewDelegate]->SetUsers(
+ app_list::AppListViewDelegate::Users(1));
[apps_search_box_controller_ setDelegate:delegate_];
NSPopUpButton* menu_control = [apps_search_box_controller_ menuControl];
@@ -186,8 +182,8 @@ TEST_F(AppsSearchBoxControllerTest, SearchBoxMenuSingleUser) {
// Test the popup menu items for the multi-profile case.
TEST_F(AppsSearchBoxControllerTest, SearchBoxMenu) {
- const app_list::AppListModel::Users& users =
- [delegate_ appListModel]->users();
+ const app_list::AppListViewDelegate::Users& users =
+ [delegate_ appListDelegate]->GetUsers();
NSPopUpButton* menu_control = [apps_search_box_controller_ menuControl];
EXPECT_TRUE([apps_search_box_controller_ appListMenu]);
ui::MenuModel* menu_model
@@ -235,7 +231,8 @@ TEST_F(AppsSearchBoxControllerTest, SearchBoxMenu) {
// Test adding another user, and changing an existing one.
TEST_F(AppsSearchBoxControllerTest, SearchBoxMenuChangingUsers) {
- app_list::AppListModel::Users users = [delegate_ appListModel]->users();
+ app_list::AppListViewDelegate::Users users =
+ [delegate_ appListDelegate]->GetUsers();
EXPECT_EQ(2u, users.size());
ui::MenuModel* menu_model
= [apps_search_box_controller_ appListMenu]->menu_model();
@@ -248,10 +245,13 @@ TEST_F(AppsSearchBoxControllerTest, SearchBoxMenuChangingUsers) {
[[[menu_control menu] itemAtIndex:1] title]);
users[0].name = ASCIIToUTF16("renamed user");
- app_list::AppListModel::User new_user;
+ app_list::AppListViewDelegate::User new_user;
new_user.name = ASCIIToUTF16("user3");
users.push_back(new_user);
- [delegate_ appListModel]->SetUsers(users);
+ [delegate_ appListTestViewDelegate]->SetUsers(users);
+ // Note: menu does not automatically get rebuilt. Force a rebuild (which
+ // would normally occur when the UI is closed / re-opend).
+ [apps_search_box_controller_ rebuildMenu];
// Should now be an extra item, and it should have correct titles.
EXPECT_EQ(3, [[menu_control menu] numberOfItems] - non_user_items);
diff --git a/ui/app_list/test/app_list_test_view_delegate.cc b/ui/app_list/test/app_list_test_view_delegate.cc
index 7cd3158..d04ae4e 100644
--- a/ui/app_list/test/app_list_test_view_delegate.cc
+++ b/ui/app_list/test/app_list_test_view_delegate.cc
@@ -44,5 +44,9 @@ content::WebContents* AppListTestViewDelegate::GetStartPageContents() {
return NULL;
}
+const AppListViewDelegate::Users& AppListTestViewDelegate::GetUsers() const {
+ return users_;
+}
+
} // namespace test
} // namespace app_list
diff --git a/ui/app_list/test/app_list_test_view_delegate.h b/ui/app_list/test/app_list_test_view_delegate.h
index c01a698..cffcdacd 100644
--- a/ui/app_list/test/app_list_test_view_delegate.h
+++ b/ui/app_list/test/app_list_test_view_delegate.h
@@ -23,6 +23,10 @@ class AppListTestViewDelegate : public AppListViewDelegate {
test_signin_delegate_ = signin_delegate;
}
+ void SetUsers(const Users& users) {
+ users_ = users;
+ }
+
// AppListViewDelegate overrides:
virtual bool ForceNativeDesktop() const OVERRIDE;
virtual void SetProfileByPath(const base::FilePath& profile_path) OVERRIDE {}
@@ -47,10 +51,13 @@ class AppListTestViewDelegate : public AppListViewDelegate {
virtual void ShowForProfileByPath(
const base::FilePath& profile_path) OVERRIDE {};
virtual content::WebContents* GetStartPageContents() OVERRIDE;
+ virtual const Users& GetUsers() const OVERRIDE;
private:
int dismiss_count_;
+ Users users_;
SigninDelegate* test_signin_delegate_; // Weak. Owned by test.
+
};
} // namespace test
diff --git a/ui/app_list/views/app_list_menu_views.cc b/ui/app_list/views/app_list_menu_views.cc
index 04c1f21..ee3e3e8 100644
--- a/ui/app_list/views/app_list_menu_views.cc
+++ b/ui/app_list/views/app_list_menu_views.cc
@@ -5,7 +5,6 @@
#include "ui/app_list/views/app_list_menu_views.h"
#include "grit/ui_resources.h"
-#include "ui/app_list/app_list_model.h"
#include "ui/app_list/app_list_view_delegate.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/views/controls/button/menu_button.h"
@@ -20,9 +19,8 @@ using views::MenuItemView;
namespace app_list {
-AppListMenuViews::AppListMenuViews(AppListViewDelegate* delegate,
- AppListModel* app_list_model)
- : AppListMenu(delegate, app_list_model->users()) {
+AppListMenuViews::AppListMenuViews(AppListViewDelegate* delegate)
+ : AppListMenu(delegate) {
menu_delegate_.reset(new views::MenuModelAdapter(menu_model()));
menu_ = new MenuItemView(menu_delegate_.get());
menu_runner_.reset(new views::MenuRunner(menu_));
diff --git a/ui/app_list/views/app_list_menu_views.h b/ui/app_list/views/app_list_menu_views.h
index 2dc3d01..32efc3a 100644
--- a/ui/app_list/views/app_list_menu_views.h
+++ b/ui/app_list/views/app_list_menu_views.h
@@ -20,14 +20,11 @@ class MenuButton;
namespace app_list {
-class AppListModel;
-
// Views implementation of the app list menu.
// TODO(benwells): We should consider moving this into Chrome.
class AppListMenuViews : public AppListMenu {
public:
- AppListMenuViews(AppListViewDelegate* delegate,
- AppListModel* model);
+ explicit AppListMenuViews(AppListViewDelegate* delegate);
virtual ~AppListMenuViews();
void RunMenuAt(views::MenuButton* button, const gfx::Point& point);
diff --git a/ui/app_list/views/app_list_view.cc b/ui/app_list/views/app_list_view.cc
index 7cd1fd5..187af93 100644
--- a/ui/app_list/views/app_list_view.cc
+++ b/ui/app_list/views/app_list_view.cc
@@ -340,8 +340,4 @@ void AppListView::OnAppListModelSigninStatusChanged() {
OnSigninStatusChanged();
}
-void AppListView::OnAppListModelUsersChanged() {
- OnSigninStatusChanged();
-}
-
} // namespace app_list
diff --git a/ui/app_list/views/app_list_view.h b/ui/app_list/views/app_list_view.h
index 96fe230..b7a7bdb 100644
--- a/ui/app_list/views/app_list_view.h
+++ b/ui/app_list/views/app_list_view.h
@@ -137,7 +137,6 @@ class APP_LIST_EXPORT AppListView : public views::BubbleDelegateView,
// Overridden from AppListModelObserver:
virtual void OnAppListModelSigninStatusChanged() OVERRIDE;
- virtual void OnAppListModelUsersChanged() OVERRIDE;
SigninDelegate* GetSigninDelegate();
diff --git a/ui/app_list/views/search_box_view.cc b/ui/app_list/views/search_box_view.cc
index 7c64874..ad0e2c5 100644
--- a/ui/app_list/views/search_box_view.cc
+++ b/ui/app_list/views/search_box_view.cc
@@ -162,7 +162,7 @@ bool SearchBoxView::HandleKeyEvent(views::Textfield* sender,
void SearchBoxView::OnMenuButtonClicked(View* source, const gfx::Point& point) {
if (!menu_)
- menu_.reset(new AppListMenuViews(view_delegate_, model_));
+ menu_.reset(new AppListMenuViews(view_delegate_));
const gfx::Point menu_location =
menu_button_->GetBoundsInScreen().bottom_right() +