blob: c41bb1089f956108eb2d62ea8550114c07c65775 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#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))) &&
((*i)->permissions_data()->HasAPIPermission(
extensions::APIPermission::kBookmarkManagerPrivate) ||
extensions::FeatureSwitch::enable_override_bookmarks_ui()
->IsEnabled()))
return true;
}
return false;
}
|