Commit 1b0d9074 authored by Oscar Johansson's avatar Oscar Johansson Committed by Commit Bot

Rename g_shown in bubble delegates for Jumbo build

The function g_shown is defined in every bubble delegate.
When building using Jumbo those functions conflict with
each other. This commit fixes this by renaming the functions
to something more file specific.

Bug: 850484
Change-Id: I9df3a8e90ed77e95649cdb734cc4d7364b5fc310
Reviewed-on: https://chromium-review.googlesource.com/1096945Reviewed-by: default avatarKen Rockot <rockot@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#567166}
parent b24ba3c7
...@@ -24,7 +24,7 @@ namespace extensions { ...@@ -24,7 +24,7 @@ namespace extensions {
namespace { namespace {
base::LazyInstance<std::set<Profile*>>::Leaky g_shown = base::LazyInstance<std::set<Profile*>>::Leaky g_dev_mode_shown =
LAZY_INSTANCE_INITIALIZER; LAZY_INSTANCE_INITIALIZER;
} // namespace } // namespace
...@@ -97,19 +97,19 @@ bool DevModeBubbleDelegate::ShouldAcknowledgeOnDeactivate() const { ...@@ -97,19 +97,19 @@ bool DevModeBubbleDelegate::ShouldAcknowledgeOnDeactivate() const {
bool DevModeBubbleDelegate::ShouldShow( bool DevModeBubbleDelegate::ShouldShow(
const ExtensionIdList& extensions) const { const ExtensionIdList& extensions) const {
DCHECK_LE(1u, extensions.size()); DCHECK_LE(1u, extensions.size());
return !g_shown.Get().count(profile_->GetOriginalProfile()); return !g_dev_mode_shown.Get().count(profile_->GetOriginalProfile());
} }
void DevModeBubbleDelegate::OnShown(const ExtensionIdList& extensions) { void DevModeBubbleDelegate::OnShown(const ExtensionIdList& extensions) {
DCHECK_LE(1u, extensions.size()); DCHECK_LE(1u, extensions.size());
DCHECK(!g_shown.Get().count(profile_)); DCHECK(!g_dev_mode_shown.Get().count(profile_));
g_shown.Get().insert(profile_->GetOriginalProfile()); g_dev_mode_shown.Get().insert(profile_->GetOriginalProfile());
} }
void DevModeBubbleDelegate::OnAction() {} void DevModeBubbleDelegate::OnAction() {}
void DevModeBubbleDelegate::ClearProfileSetForTesting() { void DevModeBubbleDelegate::ClearProfileSetForTesting() {
g_shown.Get().clear(); g_dev_mode_shown.Get().clear();
} }
bool DevModeBubbleDelegate::ShouldShowExtensionList() const { bool DevModeBubbleDelegate::ShouldShowExtensionList() const {
......
...@@ -41,8 +41,8 @@ bool g_acknowledge_existing_extensions = ...@@ -41,8 +41,8 @@ bool g_acknowledge_existing_extensions =
false; false;
#endif #endif
base::LazyInstance<std::set<std::pair<Profile*, std::string>>>::Leaky g_shown = base::LazyInstance<std::set<std::pair<Profile*, std::string>>>::Leaky
LAZY_INSTANCE_INITIALIZER; g_ntp_overridden_shown = LAZY_INSTANCE_INITIALIZER;
} // namespace } // namespace
...@@ -178,13 +178,15 @@ bool NtpOverriddenBubbleDelegate::ShouldLimitToEnabledExtensions() const { ...@@ -178,13 +178,15 @@ bool NtpOverriddenBubbleDelegate::ShouldLimitToEnabledExtensions() const {
bool NtpOverriddenBubbleDelegate::ShouldShow( bool NtpOverriddenBubbleDelegate::ShouldShow(
const ExtensionIdList& extensions) const { const ExtensionIdList& extensions) const {
DCHECK_EQ(1u, extensions.size()); DCHECK_EQ(1u, extensions.size());
return !g_shown.Get().count(std::make_pair(profile_, extensions[0])); return !g_ntp_overridden_shown.Get().count(
std::make_pair(profile_, extensions[0]));
} }
void NtpOverriddenBubbleDelegate::OnShown(const ExtensionIdList& extensions) { void NtpOverriddenBubbleDelegate::OnShown(const ExtensionIdList& extensions) {
DCHECK_EQ(1u, extensions.size()); DCHECK_EQ(1u, extensions.size());
DCHECK(!g_shown.Get().count(std::make_pair(profile_, extensions[0]))); DCHECK(!g_ntp_overridden_shown.Get().count(
g_shown.Get().insert(std::make_pair(profile_, extensions[0])); std::make_pair(profile_, extensions[0])));
g_ntp_overridden_shown.Get().insert(std::make_pair(profile_, extensions[0]));
} }
void NtpOverriddenBubbleDelegate::OnAction() { void NtpOverriddenBubbleDelegate::OnAction() {
...@@ -192,11 +194,11 @@ void NtpOverriddenBubbleDelegate::OnAction() { ...@@ -192,11 +194,11 @@ void NtpOverriddenBubbleDelegate::OnAction() {
// extension. Thus if that extension or another takes effect, it is worth // extension. Thus if that extension or another takes effect, it is worth
// mentioning to the user (ShouldShow() would return true) because it is // mentioning to the user (ShouldShow() would return true) because it is
// contrary to the user's choice. // contrary to the user's choice.
g_shown.Get().clear(); g_ntp_overridden_shown.Get().clear();
} }
void NtpOverriddenBubbleDelegate::ClearProfileSetForTesting() { void NtpOverriddenBubbleDelegate::ClearProfileSetForTesting() {
g_shown.Get().clear(); g_ntp_overridden_shown.Get().clear();
} }
void NtpOverriddenBubbleDelegate::LogExtensionCount(size_t count) { void NtpOverriddenBubbleDelegate::LogExtensionCount(size_t count) {
......
...@@ -29,7 +29,7 @@ const int kDaysSinceInstallMin = 7; ...@@ -29,7 +29,7 @@ const int kDaysSinceInstallMin = 7;
// Whether the user has been notified about extension overriding the proxy. // Whether the user has been notified about extension overriding the proxy.
const char kProxyBubbleAcknowledged[] = "ack_proxy_bubble"; const char kProxyBubbleAcknowledged[] = "ack_proxy_bubble";
base::LazyInstance<std::set<Profile*>>::Leaky g_shown = base::LazyInstance<std::set<Profile*>>::Leaky g_proxy_overridden_shown =
LAZY_INSTANCE_INITIALIZER; LAZY_INSTANCE_INITIALIZER;
} // namespace } // namespace
...@@ -129,13 +129,13 @@ bool ProxyOverriddenBubbleDelegate::ShouldAcknowledgeOnDeactivate() const { ...@@ -129,13 +129,13 @@ bool ProxyOverriddenBubbleDelegate::ShouldAcknowledgeOnDeactivate() const {
bool ProxyOverriddenBubbleDelegate::ShouldShow( bool ProxyOverriddenBubbleDelegate::ShouldShow(
const ExtensionIdList& extensions) const { const ExtensionIdList& extensions) const {
DCHECK_EQ(1u, extensions.size()); DCHECK_EQ(1u, extensions.size());
return !g_shown.Get().count(profile_); return !g_proxy_overridden_shown.Get().count(profile_);
} }
void ProxyOverriddenBubbleDelegate::OnShown(const ExtensionIdList& extensions) { void ProxyOverriddenBubbleDelegate::OnShown(const ExtensionIdList& extensions) {
DCHECK_EQ(1u, extensions.size()); DCHECK_EQ(1u, extensions.size());
DCHECK(!g_shown.Get().count(profile_)); DCHECK(!g_proxy_overridden_shown.Get().count(profile_));
g_shown.Get().insert(profile_); g_proxy_overridden_shown.Get().insert(profile_);
} }
void ProxyOverriddenBubbleDelegate::OnAction() { void ProxyOverriddenBubbleDelegate::OnAction() {
...@@ -143,11 +143,11 @@ void ProxyOverriddenBubbleDelegate::OnAction() { ...@@ -143,11 +143,11 @@ void ProxyOverriddenBubbleDelegate::OnAction() {
// extension. Thus if that extension or another takes effect, it is worth // extension. Thus if that extension or another takes effect, it is worth
// mentioning to the user (ShouldShow() would return true) because it is // mentioning to the user (ShouldShow() would return true) because it is
// contrary to the user's choice. // contrary to the user's choice.
g_shown.Get().clear(); g_proxy_overridden_shown.Get().clear();
} }
void ProxyOverriddenBubbleDelegate::ClearProfileSetForTesting() { void ProxyOverriddenBubbleDelegate::ClearProfileSetForTesting() {
g_shown.Get().clear(); g_proxy_overridden_shown.Get().clear();
} }
bool ProxyOverriddenBubbleDelegate::ShouldShowExtensionList() const { bool ProxyOverriddenBubbleDelegate::ShouldShowExtensionList() const {
......
...@@ -30,7 +30,8 @@ namespace { ...@@ -30,7 +30,8 @@ namespace {
const char kSettingsBubbleAcknowledged[] = "ack_settings_bubble"; const char kSettingsBubbleAcknowledged[] = "ack_settings_bubble";
using ProfileSetMap = std::map<std::string, std::set<Profile*>>; using ProfileSetMap = std::map<std::string, std::set<Profile*>>;
base::LazyInstance<ProfileSetMap>::Leaky g_shown = LAZY_INSTANCE_INITIALIZER; base::LazyInstance<ProfileSetMap>::Leaky g_settings_api_shown =
LAZY_INSTANCE_INITIALIZER;
} // namespace } // namespace
...@@ -210,13 +211,13 @@ bool SettingsApiBubbleDelegate::ShouldAcknowledgeOnDeactivate() const { ...@@ -210,13 +211,13 @@ bool SettingsApiBubbleDelegate::ShouldAcknowledgeOnDeactivate() const {
bool SettingsApiBubbleDelegate::ShouldShow( bool SettingsApiBubbleDelegate::ShouldShow(
const ExtensionIdList& extensions) const { const ExtensionIdList& extensions) const {
DCHECK_EQ(1u, extensions.size()); DCHECK_EQ(1u, extensions.size());
return !g_shown.Get()[GetKey()].count(profile_); return !g_settings_api_shown.Get()[GetKey()].count(profile_);
} }
void SettingsApiBubbleDelegate::OnShown(const ExtensionIdList& extensions) { void SettingsApiBubbleDelegate::OnShown(const ExtensionIdList& extensions) {
DCHECK_EQ(1u, extensions.size()); DCHECK_EQ(1u, extensions.size());
DCHECK(!g_shown.Get()[GetKey()].count(profile_)); DCHECK(!g_settings_api_shown.Get()[GetKey()].count(profile_));
g_shown.Get()[GetKey()].insert(profile_); g_settings_api_shown.Get()[GetKey()].insert(profile_);
} }
void SettingsApiBubbleDelegate::OnAction() { void SettingsApiBubbleDelegate::OnAction() {
...@@ -224,11 +225,11 @@ void SettingsApiBubbleDelegate::OnAction() { ...@@ -224,11 +225,11 @@ void SettingsApiBubbleDelegate::OnAction() {
// extension. Thus if that extension or another takes effect, it is worth // extension. Thus if that extension or another takes effect, it is worth
// mentioning to the user (ShouldShow() would return true) because it is // mentioning to the user (ShouldShow() would return true) because it is
// contrary to the user's choice. // contrary to the user's choice.
g_shown.Get()[GetKey()].clear(); g_settings_api_shown.Get()[GetKey()].clear();
} }
void SettingsApiBubbleDelegate::ClearProfileSetForTesting() { void SettingsApiBubbleDelegate::ClearProfileSetForTesting() {
g_shown.Get()[GetKey()].clear(); g_settings_api_shown.Get()[GetKey()].clear();
} }
bool SettingsApiBubbleDelegate::ShouldShowExtensionList() const { bool SettingsApiBubbleDelegate::ShouldShowExtensionList() const {
......
...@@ -31,7 +31,7 @@ namespace extensions { ...@@ -31,7 +31,7 @@ namespace extensions {
namespace { namespace {
base::LazyInstance<std::set<Profile*>>::Leaky g_shown = base::LazyInstance<std::set<Profile*>>::Leaky g_suspicious_extension_shown =
LAZY_INSTANCE_INITIALIZER; LAZY_INSTANCE_INITIALIZER;
} // namespace } // namespace
...@@ -118,14 +118,14 @@ bool SuspiciousExtensionBubbleDelegate::ShouldAcknowledgeOnDeactivate() const { ...@@ -118,14 +118,14 @@ bool SuspiciousExtensionBubbleDelegate::ShouldAcknowledgeOnDeactivate() const {
bool SuspiciousExtensionBubbleDelegate::ShouldShow( bool SuspiciousExtensionBubbleDelegate::ShouldShow(
const ExtensionIdList& extensions) const { const ExtensionIdList& extensions) const {
DCHECK_LE(1u, extensions.size()); DCHECK_LE(1u, extensions.size());
return !g_shown.Get().count(profile_); return !g_suspicious_extension_shown.Get().count(profile_);
} }
void SuspiciousExtensionBubbleDelegate::OnShown( void SuspiciousExtensionBubbleDelegate::OnShown(
const ExtensionIdList& extensions) { const ExtensionIdList& extensions) {
DCHECK_LE(1u, extensions.size()); DCHECK_LE(1u, extensions.size());
DCHECK(!g_shown.Get().count(profile_)); DCHECK(!g_suspicious_extension_shown.Get().count(profile_));
g_shown.Get().insert(profile_); g_suspicious_extension_shown.Get().insert(profile_);
} }
void SuspiciousExtensionBubbleDelegate::OnAction() { void SuspiciousExtensionBubbleDelegate::OnAction() {
...@@ -133,11 +133,11 @@ void SuspiciousExtensionBubbleDelegate::OnAction() { ...@@ -133,11 +133,11 @@ void SuspiciousExtensionBubbleDelegate::OnAction() {
// extension. Thus if that extension or another takes effect, it is worth // extension. Thus if that extension or another takes effect, it is worth
// mentioning to the user (ShouldShow() would return true) because it is // mentioning to the user (ShouldShow() would return true) because it is
// contrary to the user's choice. // contrary to the user's choice.
g_shown.Get().clear(); g_suspicious_extension_shown.Get().clear();
} }
void SuspiciousExtensionBubbleDelegate::ClearProfileSetForTesting() { void SuspiciousExtensionBubbleDelegate::ClearProfileSetForTesting() {
g_shown.Get().clear(); g_suspicious_extension_shown.Get().clear();
} }
bool SuspiciousExtensionBubbleDelegate::ShouldShowExtensionList() const { bool SuspiciousExtensionBubbleDelegate::ShouldShowExtensionList() const {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment