OLD | NEW |
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/app_list/extension_app_model_builder.h" | 5 #include "chrome/browser/ui/app_list/extension_app_model_builder.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 BuildModel(); | 72 BuildModel(); |
73 } | 73 } |
74 | 74 |
75 void ExtensionAppModelBuilder::InitializePrefChangeRegistrars() { | 75 void ExtensionAppModelBuilder::InitializePrefChangeRegistrars() { |
76 profile_pref_change_registrar_.Init(profile_->GetPrefs()); | 76 profile_pref_change_registrar_.Init(profile_->GetPrefs()); |
77 profile_pref_change_registrar_.Add( | 77 profile_pref_change_registrar_.Add( |
78 prefs::kHideWebStoreIcon, | 78 prefs::kHideWebStoreIcon, |
79 base::Bind(&ExtensionAppModelBuilder::OnProfilePreferenceChanged, | 79 base::Bind(&ExtensionAppModelBuilder::OnProfilePreferenceChanged, |
80 base::Unretained(this))); | 80 base::Unretained(this))); |
81 | 81 |
82 if (!extensions::util::IsStreamlinedHostedAppsEnabled()) | 82 if (!extensions::util::IsNewBookmarkAppsEnabled()) |
83 return; | 83 return; |
84 | 84 |
85 // TODO(calamity): analyze the performance impact of doing this every | 85 // TODO(calamity): analyze the performance impact of doing this every |
86 // extension pref change. | 86 // extension pref change. |
87 extensions::ExtensionsBrowserClient* client = | 87 extensions::ExtensionsBrowserClient* client = |
88 extensions::ExtensionsBrowserClient::Get(); | 88 extensions::ExtensionsBrowserClient::Get(); |
89 extension_pref_change_registrar_.Init( | 89 extension_pref_change_registrar_.Init( |
90 client->GetPrefServiceForContext(profile_)); | 90 client->GetPrefServiceForContext(profile_)); |
91 extension_pref_change_registrar_.Add( | 91 extension_pref_change_registrar_.Add( |
92 extensions::pref_names::kExtensions, | 92 extensions::pref_names::kExtensions, |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 app_list::AppListItem* item = item_list->item_at(idx + 1); | 325 app_list::AppListItem* item = item_list->item_at(idx + 1); |
326 if (item->GetItemType() == ExtensionAppItem::kItemType) { | 326 if (item->GetItemType() == ExtensionAppItem::kItemType) { |
327 next = static_cast<ExtensionAppItem*>(item); | 327 next = static_cast<ExtensionAppItem*>(item); |
328 break; | 328 break; |
329 } | 329 } |
330 } | 330 } |
331 // item->Move will call set_position, overriding the item's position. | 331 // item->Move will call set_position, overriding the item's position. |
332 if (prev || next) | 332 if (prev || next) |
333 static_cast<ExtensionAppItem*>(item)->Move(prev, next); | 333 static_cast<ExtensionAppItem*>(item)->Move(prev, next); |
334 } | 334 } |
OLD | NEW |