#include "chrome/common/extensions/extension_constants.h"
#include "content/public/browser/notification_service.h"
#include "extensions/browser/extension_scoped_prefs.h"
+#include "extensions/common/constants.h"
#include "extensions/common/extension.h"
#if defined(OS_CHROMEOS)
}
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSION_LAUNCHER_REORDERED,
+ chrome::NOTIFICATION_APP_LAUNCHER_REORDERED,
content::Source<ChromeAppSorting>(this),
content::NotificationService::NoDetails());
}
SyncIfNeeded(moved_extension_id);
content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_EXTENSION_LAUNCHER_REORDERED,
+ chrome::NOTIFICATION_APP_LAUNCHER_REORDERED,
content::Source<ChromeAppSorting>(this),
content::Details<const std::string>(&moved_extension_id));
}
return ntp_ordinal_map_.rbegin()->first;
}
-void ChromeAppSorting::MarkExtensionAsHidden(const std::string& extension_id) {
- ntp_hidden_extensions_.insert(extension_id);
+void ChromeAppSorting::SetExtensionVisible(const std::string& extension_id,
+ bool visible) {
+ if (visible)
+ ntp_hidden_extensions_.erase(extension_id);
+ else
+ ntp_hidden_extensions_.insert(extension_id);
}
syncer::StringOrdinal ChromeAppSorting::GetMinOrMaxAppLaunchOrdinalsOnPage(
// Ensure that the web store app still isn't found in this list, since
// it is added after this loop.
- DCHECK(*ext_it != extension_misc::kWebStoreAppId);
+ DCHECK(*ext_it != extensions::kWebStoreAppId);
DCHECK(*ext_it != extension_misc::kChromeAppId);
}
// Include the Web Store App since it is displayed on the NTP.
syncer::StringOrdinal web_store_app_page =
- GetPageOrdinal(extension_misc::kWebStoreAppId);
+ GetPageOrdinal(extensions::kWebStoreAppId);
if (web_store_app_page.IsValid()) {
- AddOrdinalMapping(extension_misc::kWebStoreAppId,
+ AddOrdinalMapping(extensions::kWebStoreAppId,
web_store_app_page,
- GetAppLaunchOrdinal(extension_misc::kWebStoreAppId));
+ GetAppLaunchOrdinal(extensions::kWebStoreAppId));
}
// Include the Chrome App since it is displayed in the app launcher.
syncer::StringOrdinal chrome_app_page =
std::vector<std::string> app_ids;
chromeos::default_app_order::Get(&app_ids);
#else
- const char* kDefaultAppOrder[] = {
+ const char* const kDefaultAppOrder[] = {
extension_misc::kChromeAppId,
- extension_misc::kWebStoreAppId,
+ extensions::kWebStoreAppId,
};
const std::vector<const char*> app_ids(
kDefaultAppOrder, kDefaultAppOrder + arraysize(kDefaultAppOrder));