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

Side by Side Diff: chrome/browser/protector/protector_utils.cc

Issue 10298012: [protector] Disable the UI by default, flip --no-protector to --protector. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | Annotate | Revision Log
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/protector/protector_utils.h" 5 #include "chrome/browser/protector/protector_utils.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 23 matching lines...) Expand all
34 bool IsSettingValid(const std::string& value, const std::string& signature) { 34 bool IsSettingValid(const std::string& value, const std::string& signature) {
35 crypto::HMAC hmac(crypto::HMAC::SHA256); 35 crypto::HMAC hmac(crypto::HMAC::SHA256);
36 if (!hmac.Init(kProtectorSigningKey)) { 36 if (!hmac.Init(kProtectorSigningKey)) {
37 LOG(WARNING) << "Failed to initialize HMAC algorithm for verification."; 37 LOG(WARNING) << "Failed to initialize HMAC algorithm for verification.";
38 return false; 38 return false;
39 } 39 }
40 return hmac.Verify(value, signature); 40 return hmac.Verify(value, signature);
41 } 41 }
42 42
43 bool IsEnabled() { 43 bool IsEnabled() {
44 return !CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoProtector); 44 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kProtector);
45 } 45 }
46 46
47 } // namespace protector 47 } // namespace protector
OLDNEW
« no previous file with comments | « chrome/browser/protector/protector_service_browsertest.cc ('k') | chrome/browser/ui/browser_init.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698