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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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(helper); |
551 } | 551 } |
552 | 552 |
553 void InsertPrefValue(base::ListValue* pref_value, | 553 void InsertPrefValue(base::ListValue* pref_value, |
554 int index, | 554 int index, |
555 const std::string& extension_id) { | 555 const std::string& extension_id) { |
556 base::DictionaryValue* entry = new base::DictionaryValue(); | 556 auto entry = base::MakeUnique<base::DictionaryValue>(); |
557 entry->SetString(ash::launcher::kPinnedAppsPrefAppIDPath, extension_id); | 557 entry->SetString(ash::launcher::kPinnedAppsPrefAppIDPath, extension_id); |
558 pref_value->Insert(index, entry); | 558 pref_value->Insert(index, std::move(entry)); |
559 } | 559 } |
560 | 560 |
561 void InsertRemoveAllPinsChange(syncer::SyncChangeList* list) { | 561 void InsertRemoveAllPinsChange(syncer::SyncChangeList* list) { |
562 for (const auto& sync_peer : app_service_->sync_items()) { | 562 for (const auto& sync_peer : app_service_->sync_items()) { |
563 sync_pb::EntitySpecifics specifics; | 563 sync_pb::EntitySpecifics specifics; |
564 sync_pb::AppListSpecifics* app_list_specifics = | 564 sync_pb::AppListSpecifics* app_list_specifics = |
565 specifics.mutable_app_list(); | 565 specifics.mutable_app_list(); |
566 app_list_specifics->set_item_id(sync_peer.first); | 566 app_list_specifics->set_item_id(sync_peer.first); |
567 app_list_specifics->set_item_type(sync_pb::AppListSpecifics::TYPE_APP); | 567 app_list_specifics->set_item_type(sync_pb::AppListSpecifics::TYPE_APP); |
568 syncer::SyncData sync_data = | 568 syncer::SyncData sync_data = |
(...skipping 3338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3907 EXPECT_TRUE(launcher_controller_->GetArcDeferredLauncher()->HasApp(app_id)); | 3907 EXPECT_TRUE(launcher_controller_->GetArcDeferredLauncher()->HasApp(app_id)); |
3908 | 3908 |
3909 std::string window_app_id("org.chromium.arc.1"); | 3909 std::string window_app_id("org.chromium.arc.1"); |
3910 CreateArcWindow(window_app_id); | 3910 CreateArcWindow(window_app_id); |
3911 arc_test_.app_instance()->SendTaskCreated(1, | 3911 arc_test_.app_instance()->SendTaskCreated(1, |
3912 arc_test_.fake_default_apps()[0]); | 3912 arc_test_.fake_default_apps()[0]); |
3913 | 3913 |
3914 EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(app_id)); | 3914 EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(app_id)); |
3915 EXPECT_FALSE(launcher_controller_->GetArcDeferredLauncher()->HasApp(app_id)); | 3915 EXPECT_FALSE(launcher_controller_->GetArcDeferredLauncher()->HasApp(app_id)); |
3916 } | 3916 } |
OLD | NEW |