This source file includes following definitions.
- IsBookmarkStarHiddenByExtension
#include "chrome/browser/ui/omnibox/location_bar.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/extensions/manifest_handlers/settings_overrides_handler.h"
#include "chrome/common/extensions/manifest_handlers/ui_overrides_handler.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/common/extension_set.h"
#include "extensions/common/feature_switch.h"
#include "extensions/common/permissions/permissions_data.h"
LocationBar::LocationBar(Profile* profile) : profile_(profile) {
}
LocationBar::~LocationBar() {
}
bool LocationBar::IsBookmarkStarHiddenByExtension() const {
const extensions::ExtensionSet& extension_set =
extensions::ExtensionRegistry::Get(profile_)->enabled_extensions();
for (extensions::ExtensionSet::const_iterator i = extension_set.begin();
i != extension_set.end(); ++i) {
using extensions::UIOverrides;
using extensions::SettingsOverrides;
const UIOverrides* ui_overrides = UIOverrides::Get(i->get());
const SettingsOverrides* settings_overrides =
SettingsOverrides::Get(i->get());
if (((settings_overrides &&
SettingsOverrides::RemovesBookmarkButton(*settings_overrides)) ||
(ui_overrides &&
UIOverrides::RemovesBookmarkButton(*ui_overrides))) &&
(extensions::PermissionsData::HasAPIPermission(
*i,
extensions::APIPermission::kBookmarkManagerPrivate) ||
extensions::FeatureSwitch::enable_override_bookmarks_ui()->
IsEnabled()))
return true;
}
return false;
}