Commit 8d67cd89 authored by melandory's avatar melandory Committed by Commit bot

Move definition of PasswordType enum to a separate header.

BUG=638963

Review-Url: https://codereview.chromium.org/2279753003
Cr-Commit-Position: refs/heads/master@{#415425}
parent 2cee8eac
......@@ -45,6 +45,7 @@
#include "components/signin/core/common/profile_management_switches.h"
#include "components/signin/core/common/signin_pref_names.h"
#include "components/strings/grit/components_strings.h"
#include "components/sync/base/passphrase_type.h"
#include "components/sync/driver/sync_prefs.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
......
......@@ -47,6 +47,7 @@
#include "components/sync/api/sync_error.h"
#include "components/sync/base/cryptographer.h"
#include "components/sync/base/experiments.h"
#include "components/sync/base/passphrase_type.h"
#include "components/sync/base/stop_source.h"
#include "components/sync/base/sync_db_util.h"
#include "components/sync/core/configure_reason.h"
......
......@@ -88,6 +88,8 @@ static_library("sync") {
"base/node_ordinal.cc",
"base/node_ordinal.h",
"base/ordinal.h",
"base/passphrase_type.cc",
"base/passphrase_type.h",
"base/progress_marker_map.cc",
"base/progress_marker_map.h",
"base/proto_value_ptr.h",
......
// Copyright 2016 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 "components/sync/base/passphrase_type.h"
namespace syncer {
bool IsExplicitPassphrase(PassphraseType type) {
return type == PassphraseType::CUSTOM_PASSPHRASE ||
type == PassphraseType::FROZEN_IMPLICIT_PASSPHRASE;
}
} // namespace syncer
// Copyright 2016 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.
#ifndef COMPONENTS_SYNC_BASE_PASSPHRASE_TYPE_H_
#define COMPONENTS_SYNC_BASE_PASSPHRASE_TYPE_H_
namespace syncer {
// The different states for the encryption passphrase. These control if and how
// the user should be prompted for a decryption passphrase.
// Do not re-order or delete these entries; they are used in a UMA histogram.
// Please edit SyncPassphraseType in histograms.xml if a value is added.
enum class PassphraseType {
IMPLICIT_PASSPHRASE = 0, // GAIA-based passphrase (deprecated).
KEYSTORE_PASSPHRASE = 1, // Keystore passphrase.
FROZEN_IMPLICIT_PASSPHRASE = 2, // Frozen GAIA passphrase.
CUSTOM_PASSPHRASE = 3, // User-provided passphrase.
PASSPHRASE_TYPE_SIZE, // The size of this enum; keep last.
};
bool IsExplicitPassphrase(PassphraseType type);
} // namespace syncer
#endif // COMPONENTS_SYNC_BASE_PASSPHRASE_TYPE_H_
......@@ -14,6 +14,7 @@
namespace syncer {
class Cryptographer;
enum class PassphraseType;
// Reasons due to which Cryptographer might require a passphrase.
enum PassphraseRequiredReason {
......@@ -27,18 +28,6 @@ enum PassphraseRequiredReason {
// decryption.
};
// The different states for the encryption passphrase. These control if and how
// the user should be prompted for a decryption passphrase.
// Do not re-order or delete these entries; they are used in a UMA histogram.
// Please edit SyncPassphraseType in histograms.xml if a value is added.
enum class PassphraseType {
IMPLICIT_PASSPHRASE = 0, // GAIA-based passphrase (deprecated).
KEYSTORE_PASSPHRASE = 1, // Keystore passphrase.
FROZEN_IMPLICIT_PASSPHRASE = 2, // Frozen GAIA passphrase.
CUSTOM_PASSPHRASE = 3, // User-provided passphrase.
PASSPHRASE_TYPE_SIZE, // The size of this enum; keep last.
};
// Enum used to distinguish which bootstrap encryption token is being updated.
enum BootstrapTokenType {
PASSPHRASE_BOOTSTRAP_TOKEN,
......
......@@ -10,6 +10,7 @@
#include "components/sync/base/cryptographer.h"
#include "components/sync/base/fake_encryptor.h"
#include "components/sync/base/model_type.h"
#include "components/sync/base/passphrase_type.h"
#include "components/sync/base/time.h"
#include "components/sync/base/weak_handle.h"
#include "components/sync/engine/sync_string_conversions.h"
......
......@@ -23,6 +23,7 @@
#include "components/sync/base/cryptographer.h"
#include "components/sync/base/encryptor.h"
#include "components/sync/base/experiments.h"
#include "components/sync/base/passphrase_type.h"
#include "components/sync/base/time.h"
#include "components/sync/core/read_node.h"
#include "components/sync/core/read_transaction.h"
......@@ -127,11 +128,6 @@ sync_pb::NigoriSpecifics::PassphraseType EnumPassphraseTypeToProto(
}
}
bool IsExplicitPassphrase(PassphraseType type) {
return type == PassphraseType::CUSTOM_PASSPHRASE ||
type == PassphraseType::FROZEN_IMPLICIT_PASSPHRASE;
}
// Keystore Bootstrap Token helper methods.
// The bootstrap is a base64 encoded, encrypted, ListValue of keystore key
// strings, with the current keystore key as the last value in the list.
......
......@@ -10,6 +10,7 @@
#include "base/time/time.h"
#include "components/sync/base/model_type.h"
#include "components/sync/base/passphrase_type.h"
#include "components/sync/core/sync_encryption_handler.h"
#include "components/sync/protocol/sync_protocol_error.h"
......
......@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "components/sync/engine/sync_string_conversions.h"
#include "components/sync/base/passphrase_type.h"
#define ENUM_CASE(x) \
case x: \
......
......@@ -10,6 +10,8 @@
namespace syncer {
enum class PassphraseType;
const char* ConnectionStatusToString(ConnectionStatus status);
// Returns the string representation of a PassphraseRequiredReason value.
......
......@@ -4,6 +4,7 @@
#include "components/sync/test/fake_sync_encryption_handler.h"
#include "components/sync/base/passphrase_type.h"
#include "components/sync/protocol/nigori_specifics.pb.h"
#include "components/sync/syncable/nigori_util.h"
......
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