Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Side by Side Diff: chrome/browser/ui/ash/chrome_launcher_prefs.cc

Issue 1973603002: arc: Make Play Store item persistance in shelf. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chrome_launcher_prefs.h" 5 #include "chrome/browser/ui/ash/chrome_launcher_prefs.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/strings/string_number_conversions.h" 12 #include "base/strings/string_number_conversions.h"
13 #include "base/values.h" 13 #include "base/values.h"
14 #include "chrome/browser/app_mode/app_mode_utils.h" 14 #include "chrome/browser/app_mode/app_mode_utils.h"
15 #include "chrome/browser/chromeos/arc/arc_support_host.h"
15 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h" 16 #include "chrome/browser/ui/ash/launcher/launcher_controller_helper.h"
16 #include "chrome/common/extensions/extension_constants.h" 17 #include "chrome/common/extensions/extension_constants.h"
17 #include "chrome/common/pref_names.h" 18 #include "chrome/common/pref_names.h"
18 #include "components/pref_registry/pref_registry_syncable.h" 19 #include "components/pref_registry/pref_registry_syncable.h"
19 #include "components/prefs/pref_service.h" 20 #include "components/prefs/pref_service.h"
20 #include "components/prefs/scoped_user_pref_update.h" 21 #include "components/prefs/scoped_user_pref_update.h"
21 #include "ui/display/screen.h" 22 #include "ui/display/screen.h"
22 23
23 namespace ash { 24 namespace ash {
24 25
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 dictionary->GetString(kPinnedAppsPrefAppIDPath, &app_id) && 319 dictionary->GetString(kPinnedAppsPrefAppIDPath, &app_id) &&
319 helper->IsValidIDForCurrentUser(app_id) && 320 helper->IsValidIDForCurrentUser(app_id) &&
320 std::find(apps.begin(), apps.end(), app_id) == apps.end() && 321 std::find(apps.begin(), apps.end(), app_id) == apps.end() &&
321 (!dictionary->GetBoolean(kPinnedAppsPrefPinnedByPolicy, 322 (!dictionary->GetBoolean(kPinnedAppsPrefPinnedByPolicy,
322 &pinned_by_policy) || 323 &pinned_by_policy) ||
323 !pinned_by_policy)) { 324 !pinned_by_policy)) {
324 apps.push_back(app_id); 325 apps.push_back(app_id);
325 } 326 }
326 } 327 }
327 328
329 apps.push_back(ArcSupportHost::kHostAppId);
330
328 // If not added yet, the chrome item will be the last item in the list. 331 // If not added yet, the chrome item will be the last item in the list.
329 if (!chrome_listed) 332 if (!chrome_listed)
330 apps.push_back(extension_misc::kChromeAppId); 333 apps.push_back(extension_misc::kChromeAppId);
331 334
332 // If not added yet, place the app list item at the beginning of the list. 335 // If not added yet, place the app list item at the beginning of the list.
333 if (std::find(apps.begin(), apps.end(), kPinnedAppsPlaceholder) == apps.end()) 336 if (std::find(apps.begin(), apps.end(), kPinnedAppsPlaceholder) == apps.end())
334 apps.insert(apps.begin(), kPinnedAppsPlaceholder); 337 apps.insert(apps.begin(), kPinnedAppsPlaceholder);
335 338
336 return apps; 339 return apps;
337 } 340 }
338 341
339 } // namespace ash 342 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698