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

Unified Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 2430923010: Add a feature flag for the security verbose (Closed)
Patch Set: Added section to fieldtrial_testing_config.json Created 4 years, 2 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/views/location_bar/location_bar_view.cc
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index 3e237665b3c5a2c7d1d73deb840e0f2384400666..f507e8f405930b0c310214a7f08c48998cf01f25 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -52,6 +52,7 @@
#include "chrome/browser/ui/views/passwords/manage_passwords_icon_views.h"
#include "chrome/browser/ui/views/translate/translate_bubble_view.h"
#include "chrome/browser/ui/views/translate/translate_icon_view.h"
+#include "chrome/common/chrome_features.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/grit/theme_resources.h"
@@ -65,6 +66,7 @@
#include "components/search_engines/template_url_service.h"
#include "components/toolbar/toolbar_model.h"
#include "components/translate/core/browser/language_state.h"
+#include "components/variations/variations_associated_data.h"
#include "components/zoom/zoom_controller.h"
#include "components/zoom/zoom_event_manager.h"
#include "content/public/browser/render_widget_host_view.h"
@@ -153,26 +155,36 @@ LocationBarView::LocationBarView(Browser* browser,
->AddZoomEventManagerObserver(this);
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ std::string security_chip;
Peter Kasting 2016/10/24 21:08:16 Nit: |security_chip_visibility| to match constant
spqchan 2016/10/24 22:44:56 Done.
if (command_line->HasSwitch(switches::kSecurityChip)) {
- std::string security_chip_flag =
- command_line->GetSwitchValueASCII(switches::kSecurityChip);
- should_show_secure_state_ =
- security_chip_flag == switches::kSecurityChipShowAll;
- should_show_nonsecure_state_ =
- security_chip_flag == switches::kSecurityChipShowAll ||
- security_chip_flag == switches::kSecurityChipShowNonSecureOnly;
+ security_chip = command_line->GetSwitchValueASCII(switches::kSecurityChip);
+ } else if (base::FeatureList::IsEnabled(features::kSecurityChip)) {
+ security_chip = variations::GetVariationParamValueByFeature(
+ features::kSecurityChip, kSecurityChipFeatureVisibilityParam);
}
+ if (security_chip == switches::kSecurityChipShowNonSecureOnly) {
+ should_show_nonsecure_state_ = true;
+ } else if (security_chip == switches::kSecurityChipShowAll) {
+ should_show_secure_state_ = true;
+ should_show_nonsecure_state_ = true;
+ }
Peter Kasting 2016/10/24 21:08:17 Nit: Shorter: should_show_secure_state_ = secur
spqchan 2016/10/24 22:44:56 Done.
+
+ std::string security_chip_animation;
if (command_line->HasSwitch(switches::kSecurityChipAnimation)) {
- std::string security_chip_animation_flag =
+ security_chip_animation =
command_line->GetSwitchValueASCII(switches::kSecurityChipAnimation);
- should_animate_secure_state_ =
- security_chip_animation_flag == switches::kSecurityChipAnimationAll;
+ } else if (base::FeatureList::IsEnabled(features::kSecurityChip)) {
+ security_chip_animation = variations::GetVariationParamValueByFeature(
+ features::kSecurityChip, kSecurityChipFeatureAnimationParam);
+ }
- should_animate_nonsecure_state_ =
- security_chip_animation_flag ==
- switches::kSecurityChipAnimationNonSecureOnly ||
- security_chip_animation_flag == switches::kSecurityChipAnimationAll;
+ if (security_chip_animation ==
+ switches::kSecurityChipAnimationNonSecureOnly) {
+ should_animate_nonsecure_state_ = true;
+ } else if (security_chip_animation == switches::kSecurityChipAnimationAll) {
+ should_animate_secure_state_ = true;
+ should_animate_nonsecure_state_ = true;
}
}

Powered by Google App Engine
This is Rietveld 408576698