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

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_util.cc

Issue 1134603004: Remove the finch gate from the UWS interstitial (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/safe_browsing/safe_browsing_util.h" 5 #include "chrome/browser/safe_browsing/safe_browsing_util.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
mattm 2015/05/13 01:46:11 unused now?
felt 2015/05/13 01:56:01 Done.
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
11 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
12 #include "chrome/browser/safe_browsing/chunk.pb.h" 12 #include "chrome/browser/safe_browsing/chunk.pb.h"
13 #include "components/google/core/browser/google_util.h" 13 #include "components/google/core/browser/google_util.h"
14 #include "crypto/sha2.h" 14 #include "crypto/sha2.h"
15 #include "net/base/escape.h" 15 #include "net/base/escape.h"
16 #include "url/gurl.h" 16 #include "url/gurl.h"
17 #include "url/url_util.h" 17 #include "url/url_util.h"
18 18
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 162
163 namespace { 163 namespace {
164 bool IsKnownList(const std::string& name) { 164 bool IsKnownList(const std::string& name) {
165 for (size_t i = 0; i < arraysize(safe_browsing_util::kAllLists); ++i) { 165 for (size_t i = 0; i < arraysize(safe_browsing_util::kAllLists); ++i) {
166 if (!strcmp(safe_browsing_util::kAllLists[i], name.c_str())) { 166 if (!strcmp(safe_browsing_util::kAllLists[i], name.c_str())) {
167 return true; 167 return true;
168 } 168 }
169 } 169 }
170 return false; 170 return false;
171 } 171 }
172
173 // String constants for the M40 UwS Finch trial.
174 const char kUnwantedTrialName[] = "UwSInterstitialStatus";
175 const char kOff[] = "Off";
176 const char kOnButInvisible[] = "OnButInvisible";
177 const char kOn[] = "On";
178
179 } // namespace 172 } // namespace
180 173
181 namespace safe_browsing_util { 174 namespace safe_browsing_util {
182 175
183 // Listnames that browser can process. 176 // Listnames that browser can process.
184 // TODO(shess): This shouldn't be OS-driven <http://crbug.com/394379> 177 // TODO(shess): This shouldn't be OS-driven <http://crbug.com/394379>
185 #if defined(OS_ANDROID) 178 #if defined(OS_ANDROID)
186 // NOTE(shess): This difference is also reflected in the store name in 179 // NOTE(shess): This difference is also reflected in the store name in
187 // safe_browsing_database.cc. 180 // safe_browsing_database.cc.
188 const char kMalwareList[] = "goog-mobilemalware-shavar"; 181 const char kMalwareList[] = "goog-mobilemalware-shavar";
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 SBFullHash hash_out; 518 SBFullHash hash_out;
526 memcpy(hash_out.full_hash, hash_in.data(), crypto::kSHA256Length); 519 memcpy(hash_out.full_hash, hash_in.data(), crypto::kSHA256Length);
527 return hash_out; 520 return hash_out;
528 } 521 }
529 522
530 std::string SBFullHashToString(const SBFullHash& hash) { 523 std::string SBFullHashToString(const SBFullHash& hash) {
531 DCHECK_EQ(crypto::kSHA256Length, sizeof(hash.full_hash)); 524 DCHECK_EQ(crypto::kSHA256Length, sizeof(hash.full_hash));
532 return std::string(hash.full_hash, sizeof(hash.full_hash)); 525 return std::string(hash.full_hash, sizeof(hash.full_hash));
533 } 526 }
534 527
535 UnwantedStatus GetUnwantedTrialGroup() {
536 std::string status(base::FieldTrialList::FindFullName(kUnwantedTrialName));
537 if (status == kOff)
538 return UWS_OFF;
539 if (status == kOnButInvisible)
540 return UWS_ON_INVISIBLE;
541 if (status == kOn)
542 return UWS_ON;
543 return UWS_ON;
544 }
545
546 } // namespace safe_browsing_util 528 } // namespace safe_browsing_util
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_util.h ('k') | chrome/browser/safe_browsing/ui_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698