| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 ChromeLauncherAppMenuItems items; | 272 ChromeLauncherAppMenuItems items; |
| 273 items.push_back(base::MakeUnique<ChromeLauncherAppMenuItem>( | 273 items.push_back(base::MakeUnique<ChromeLauncherAppMenuItem>( |
| 274 base::string16(), nullptr, false)); | 274 base::string16(), nullptr, false)); |
| 275 items.push_back(base::MakeUnique<ChromeLauncherAppMenuItem>( | 275 items.push_back(base::MakeUnique<ChromeLauncherAppMenuItem>( |
| 276 base::string16(), nullptr, false)); | 276 base::string16(), nullptr, false)); |
| 277 return items; | 277 return items; |
| 278 } | 278 } |
| 279 ash::ShelfMenuModel* CreateApplicationMenu(int event_flags) override { | 279 ash::ShelfMenuModel* CreateApplicationMenu(int event_flags) override { |
| 280 return NULL; | 280 return NULL; |
| 281 } | 281 } |
| 282 bool CanPin() const override { | |
| 283 return GetPinnableForAppID(app_id(), launcher_controller()->profile()) == | |
| 284 AppListControllerDelegate::PIN_EDITABLE; | |
| 285 } | |
| 286 | 282 |
| 287 private: | 283 private: |
| 288 DISALLOW_COPY_AND_ASSIGN(TestV2AppLauncherItemController); | 284 DISALLOW_COPY_AND_ASSIGN(TestV2AppLauncherItemController); |
| 289 }; | 285 }; |
| 290 | 286 |
| 291 } // namespace | 287 } // namespace |
| 292 | 288 |
| 293 class ChromeLauncherControllerImplTest : public BrowserWithTestWindowTest { | 289 class ChromeLauncherControllerImplTest : public BrowserWithTestWindowTest { |
| 294 protected: | 290 protected: |
| 295 ChromeLauncherControllerImplTest() | 291 ChromeLauncherControllerImplTest() |
| (...skipping 3773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4069 | 4065 |
| 4070 // Pinned state should not change. | 4066 // Pinned state should not change. |
| 4071 EXPECT_EQ("AppList, Chrome, App1, App2", GetPinnedAppStatus()); | 4067 EXPECT_EQ("AppList, Chrome, App1, App2", GetPinnedAppStatus()); |
| 4072 launcher_controller_->UnpinAppWithID(extension2_->id()); | 4068 launcher_controller_->UnpinAppWithID(extension2_->id()); |
| 4073 EXPECT_EQ("AppList, Chrome, App1", GetPinnedAppStatus()); | 4069 EXPECT_EQ("AppList, Chrome, App1", GetPinnedAppStatus()); |
| 4074 | 4070 |
| 4075 // Resume syncing and sync information overrides local copy. | 4071 // Resume syncing and sync information overrides local copy. |
| 4076 StartAppSyncService(copy_sync_list); | 4072 StartAppSyncService(copy_sync_list); |
| 4077 EXPECT_EQ("AppList, Chrome, App1, App2", GetPinnedAppStatus()); | 4073 EXPECT_EQ("AppList, Chrome, App1, App2", GetPinnedAppStatus()); |
| 4078 } | 4074 } |
| OLD | NEW |