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

Unified Diff: chrome/browser/ui/app_list/apps_model_builder.cc

Issue 12038067: Filter Web Store app from ChromeOS launcher according to policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/app_list/apps_model_builder.cc
diff --git a/chrome/browser/ui/app_list/apps_model_builder.cc b/chrome/browser/ui/app_list/apps_model_builder.cc
index cfc0d166515a8813410ac4a54e74080c312c8851..3db0ebb92e23c4f7cdfd19430038adc89036ec19 100644
--- a/chrome/browser/ui/app_list/apps_model_builder.cc
+++ b/chrome/browser/ui/app_list/apps_model_builder.cc
@@ -15,6 +15,7 @@
#include "chrome/browser/ui/app_list/extension_app_item.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
+#include "chrome/common/pref_names.h"
#include "content/public/browser/notification_service.h"
using extensions::Extension;
@@ -77,7 +78,11 @@ void AppsModelBuilder::Build() {
void AppsModelBuilder::AddApps(const ExtensionSet* extensions, Apps* apps) {
for (ExtensionSet::const_iterator app = extensions->begin();
app != extensions->end(); ++app) {
- if ((*app)->ShouldDisplayInAppLauncher())
+ // If it's the web store, check the policy.
+ bool blocked_by_policy =
+ (*app)->id() == extension_misc::kWebStoreAppId &&
tfarina 2013/01/24 14:15:58 indent two more spaces.
dconnelly 2013/01/24 14:30:51 Done.
+ profile_->GetPrefs()->GetBoolean(prefs::kHideWebStoreIcon);
+ if ((*app)->ShouldDisplayInAppLauncher() && !blocked_by_policy)
apps->push_back(new ExtensionAppItem(profile_, *app, controller_));
}
}

Powered by Google App Engine
This is Rietveld 408576698