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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 new ChromeLauncherAppMenuItem(base::string16(), NULL, false)); | 286 new ChromeLauncherAppMenuItem(base::string16(), NULL, false)); |
287 items.push_back( | 287 items.push_back( |
288 new ChromeLauncherAppMenuItem(base::string16(), NULL, false)); | 288 new ChromeLauncherAppMenuItem(base::string16(), NULL, false)); |
289 return items; | 289 return items; |
290 } | 290 } |
291 ash::ShelfMenuModel* CreateApplicationMenu(int event_flags) override { | 291 ash::ShelfMenuModel* CreateApplicationMenu(int event_flags) override { |
292 return NULL; | 292 return NULL; |
293 } | 293 } |
294 bool IsDraggable() override { return false; } | 294 bool IsDraggable() override { return false; } |
295 bool CanPin() const override { | 295 bool CanPin() const override { |
296 return GetPinnableForAppID(app_id(), launcher_controller()->GetProfile()) == | 296 return GetPinnableForAppID(app_id(), launcher_controller()->profile()) == |
297 AppListControllerDelegate::PIN_EDITABLE; | 297 AppListControllerDelegate::PIN_EDITABLE; |
298 } | 298 } |
299 bool ShouldShowTooltip() override { return false; } | 299 bool ShouldShowTooltip() override { return false; } |
300 | 300 |
301 private: | 301 private: |
302 DISALLOW_COPY_AND_ASSIGN(TestV2AppLauncherItemController); | 302 DISALLOW_COPY_AND_ASSIGN(TestV2AppLauncherItemController); |
303 }; | 303 }; |
304 | 304 |
305 } // namespace | 305 } // namespace |
306 | 306 |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 | 540 |
541 void SetAppIconLoaders(std::unique_ptr<AppIconLoader> loader1, | 541 void SetAppIconLoaders(std::unique_ptr<AppIconLoader> loader1, |
542 std::unique_ptr<AppIconLoader> loader2) { | 542 std::unique_ptr<AppIconLoader> loader2) { |
543 std::vector<std::unique_ptr<AppIconLoader>> loaders; | 543 std::vector<std::unique_ptr<AppIconLoader>> loaders; |
544 loaders.push_back(std::move(loader1)); | 544 loaders.push_back(std::move(loader1)); |
545 loaders.push_back(std::move(loader2)); | 545 loaders.push_back(std::move(loader2)); |
546 launcher_controller_->SetAppIconLoadersForTest(loaders); | 546 launcher_controller_->SetAppIconLoadersForTest(loaders); |
547 } | 547 } |
548 | 548 |
549 void SetLauncherControllerHelper(LauncherControllerHelper* helper) { | 549 void SetLauncherControllerHelper(LauncherControllerHelper* helper) { |
550 launcher_controller_->SetLauncherControllerHelperForTest(helper); | 550 launcher_controller_->SetLauncherControllerHelperForTest( |
| 551 base::WrapUnique<LauncherControllerHelper>(helper)); |
551 } | 552 } |
552 | 553 |
553 void InsertPrefValue(base::ListValue* pref_value, | 554 void InsertPrefValue(base::ListValue* pref_value, |
554 int index, | 555 int index, |
555 const std::string& extension_id) { | 556 const std::string& extension_id) { |
556 auto entry = base::MakeUnique<base::DictionaryValue>(); | 557 auto entry = base::MakeUnique<base::DictionaryValue>(); |
557 entry->SetString(ash::launcher::kPinnedAppsPrefAppIDPath, extension_id); | 558 entry->SetString(ash::launcher::kPinnedAppsPrefAppIDPath, extension_id); |
558 pref_value->Insert(index, std::move(entry)); | 559 pref_value->Insert(index, std::move(entry)); |
559 } | 560 } |
560 | 561 |
(...skipping 3448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4009 app_service_->GetPinPosition(extension_misc::kChromeAppId))); | 4010 app_service_->GetPinPosition(extension_misc::kChromeAppId))); |
4010 EXPECT_TRUE( | 4011 EXPECT_TRUE( |
4011 position_1.Equals(app_service_->GetPinPosition(extension1_->id()))); | 4012 position_1.Equals(app_service_->GetPinPosition(extension1_->id()))); |
4012 EXPECT_TRUE( | 4013 EXPECT_TRUE( |
4013 position_1.Equals(app_service_->GetPinPosition(extension1_->id()))); | 4014 position_1.Equals(app_service_->GetPinPosition(extension1_->id()))); |
4014 EXPECT_TRUE( | 4015 EXPECT_TRUE( |
4015 position_2.Equals(app_service_->GetPinPosition(extension2_->id()))); | 4016 position_2.Equals(app_service_->GetPinPosition(extension2_->id()))); |
4016 EXPECT_TRUE( | 4017 EXPECT_TRUE( |
4017 position_3.Equals(app_service_->GetPinPosition(extension3_->id()))); | 4018 position_3.Equals(app_service_->GetPinPosition(extension3_->id()))); |
4018 } | 4019 } |
OLD | NEW |