diff options
30 files changed, 87 insertions, 39 deletions
diff --git a/chrome/browser/DEPS b/chrome/browser/DEPS index c5807bc..46a1623 100644 --- a/chrome/browser/DEPS +++ b/chrome/browser/DEPS @@ -9,6 +9,7 @@ include_rules = [ "+components/autofill/common", "+components/auto_login_parser", "+components/autofill/common", + "+components/webdata", "+components/navigation_interception", "+components/user_prefs", "+components/visitedlink/browser", diff --git a/chrome/browser/password_manager/login_database_win.cc b/chrome/browser/password_manager/login_database_win.cc index 79919d8..8a1d488 100644 --- a/chrome/browser/password_manager/login_database_win.cc +++ b/chrome/browser/password_manager/login_database_win.cc @@ -3,8 +3,8 @@ // found in the LICENSE file. #include "base/string_util.h" -#include "chrome/browser/password_manager/encryptor.h" #include "chrome/browser/password_manager/login_database.h" +#include "components/webdata/encryptor/encryptor.h" std::string LoginDatabase::EncryptedString(const string16& plain_text) const { diff --git a/chrome/browser/signin/signin_manager_unittest.cc b/chrome/browser/signin/signin_manager_unittest.cc index a54fb85..79964d0 100644 --- a/chrome/browser/signin/signin_manager_unittest.cc +++ b/chrome/browser/signin/signin_manager_unittest.cc @@ -11,7 +11,6 @@ #include "base/prefs/testing_pref_service.h" #include "base/stringprintf.h" #include "chrome/browser/browser_process.h" -#include "chrome/browser/password_manager/encryptor.h" #include "chrome/browser/prefs/browser_prefs.h" #include "chrome/browser/signin/token_service.h" #include "chrome/browser/signin/token_service_unittest.h" @@ -21,6 +20,7 @@ #include "chrome/common/url_constants.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" +#include "components/webdata/encryptor/encryptor.h" #include "content/public/browser/child_process_security_policy.h" #include "content/public/test/test_browser_thread.h" #include "google_apis/gaia/gaia_constants.h" diff --git a/chrome/browser/signin/token_service_unittest.cc b/chrome/browser/signin/token_service_unittest.cc index eb6adfe..c44e293 100644 --- a/chrome/browser/signin/token_service_unittest.cc +++ b/chrome/browser/signin/token_service_unittest.cc @@ -11,11 +11,11 @@ #include "base/command_line.h" #include "base/message_loop.h" #include "base/synchronization/waitable_event.h" -#include "chrome/browser/password_manager/encryptor.h" #include "chrome/browser/signin/token_service_factory.h" #include "chrome/browser/webdata/web_data_service.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/chrome_switches.h" +#include "components/webdata/encryptor/encryptor.h" #include "google_apis/gaia/gaia_constants.h" #include "google_apis/gaia/mock_url_fetcher_factory.h" #include "net/url_request/test_url_fetcher_factory.h" diff --git a/chrome/browser/sync/glue/chrome_encryptor.cc b/chrome/browser/sync/glue/chrome_encryptor.cc index ec310ab..024fd35 100644 --- a/chrome/browser/sync/glue/chrome_encryptor.cc +++ b/chrome/browser/sync/glue/chrome_encryptor.cc @@ -4,7 +4,7 @@ #include "chrome/browser/sync/glue/chrome_encryptor.h" -#include "chrome/browser/password_manager/encryptor.h" +#include "components/webdata/encryptor/encryptor.h" namespace browser_sync { diff --git a/chrome/browser/sync/glue/chrome_encryptor_unittest.cc b/chrome/browser/sync/glue/chrome_encryptor_unittest.cc index 0a04c04..0a2c17b 100644 --- a/chrome/browser/sync/glue/chrome_encryptor_unittest.cc +++ b/chrome/browser/sync/glue/chrome_encryptor_unittest.cc @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/password_manager/encryptor.h" #include "chrome/browser/sync/glue/chrome_encryptor.h" +#include "components/webdata/encryptor/encryptor.h" #include "testing/gtest/include/gtest/gtest.h" namespace browser_sync { diff --git a/chrome/browser/sync/test/integration/sync_test.cc b/chrome/browser/sync/test/integration/sync_test.cc index 20eff2d..3897b99 100644 --- a/chrome/browser/sync/test/integration/sync_test.cc +++ b/chrome/browser/sync/test/integration/sync_test.cc @@ -22,7 +22,6 @@ #include "chrome/browser/google/google_url_tracker.h" #include "chrome/browser/history/history_service_factory.h" #include "chrome/browser/lifetime/application_lifetime.h" -#include "chrome/browser/password_manager/encryptor.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/search_engines/template_url_service.h" @@ -38,6 +37,7 @@ #include "chrome/common/chrome_switches.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/ui_test_utils.h" +#include "components/webdata/encryptor/encryptor.h" #include "content/public/browser/web_contents.h" #include "content/public/test/test_browser_thread.h" #include "google_apis/gaia/gaia_urls.h" diff --git a/chrome/browser/webdata/DEPS b/chrome/browser/webdata/DEPS index 1ae5ddc..c680c71 100644 --- a/chrome/browser/webdata/DEPS +++ b/chrome/browser/webdata/DEPS @@ -7,12 +7,12 @@ include_rules = [ "-chrome/common", "+chrome/browser/api/webdata", "+chrome/browser/webdata", + "+components/encryptor", # TODO(caitkp, kaiwang): Bring this list to zero. # Do not add to the list of temporarily-allowed dependencies below, # and please do not introduce more #includes of these files. "!chrome/browser/history/history_database.h", - "!chrome/browser/password_manager/encryptor.h", "!chrome/browser/password_manager/ie7_password.h", "!chrome/browser/search_engines/search_terms_data.h", "!chrome/browser/search_engines/template_url.h", diff --git a/chrome/browser/webdata/autofill_table.cc b/chrome/browser/webdata/autofill_table.cc index b3ccb52..2118632 100644 --- a/chrome/browser/webdata/autofill_table.cc +++ b/chrome/browser/webdata/autofill_table.cc @@ -17,7 +17,6 @@ #include "base/strings/string_number_conversions.h" #include "base/time.h" #include "base/tuple.h" -#include "chrome/browser/password_manager/encryptor.h" #include "chrome/browser/webdata/autofill_change.h" #include "chrome/browser/webdata/autofill_entry.h" #include "chrome/browser/webdata/web_database.h" @@ -27,6 +26,7 @@ #include "components/autofill/browser/credit_card.h" #include "components/autofill/browser/personal_data_manager.h" #include "components/autofill/common/form_field_data.h" +#include "components/webdata/encryptor/encryptor.h" #include "sql/statement.h" #include "ui/base/l10n/l10n_util.h" diff --git a/chrome/browser/webdata/autofill_table_unittest.cc b/chrome/browser/webdata/autofill_table_unittest.cc index 4acd752..5566ede 100644 --- a/chrome/browser/webdata/autofill_table_unittest.cc +++ b/chrome/browser/webdata/autofill_table_unittest.cc @@ -11,7 +11,6 @@ #include "base/strings/string_number_conversions.h" #include "base/time.h" #include "base/utf_string_conversions.h" -#include "chrome/browser/password_manager/encryptor.h" #include "chrome/browser/webdata/autofill_change.h" #include "chrome/browser/webdata/autofill_entry.h" #include "chrome/browser/webdata/autofill_table.h" @@ -20,6 +19,7 @@ #include "components/autofill/browser/autofill_type.h" #include "components/autofill/browser/credit_card.h" #include "components/autofill/common/form_field_data.h" +#include "components/webdata/encryptor/encryptor.h" #include "sql/statement.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/webdata/token_service_table.cc b/chrome/browser/webdata/token_service_table.cc index ee8410f..8ffe82d 100644 --- a/chrome/browser/webdata/token_service_table.cc +++ b/chrome/browser/webdata/token_service_table.cc @@ -8,8 +8,8 @@ #include <string> #include "base/logging.h" -#include "chrome/browser/password_manager/encryptor.h" #include "chrome/browser/webdata/web_database.h" +#include "components/webdata/encryptor/encryptor.h" #include "sql/statement.h" namespace { diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index f03fb05..16db69a 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -27,6 +27,7 @@ 'safe_browsing_report_proto', 'variations_seed_proto', '../build/temp_gyp/googleurl.gyp:googleurl', + '../components/components.gyp:encryptor', '../components/components.gyp:user_prefs', '../components/components.gyp:visitedlink_browser', '../components/components.gyp:visitedlink_common', @@ -1140,12 +1141,6 @@ 'browser/parsers/metadata_parser_jpeg_factory.h', 'browser/parsers/metadata_parser_manager.cc', 'browser/parsers/metadata_parser_manager.h', - 'browser/password_manager/encryptor.h', - 'browser/password_manager/encryptor_mac.mm', - 'browser/password_manager/encryptor_password_mac.h', - 'browser/password_manager/encryptor_password_mac.mm', - 'browser/password_manager/encryptor_posix.cc', - 'browser/password_manager/encryptor_win.cc', 'browser/password_manager/ie7_password.cc', 'browser/password_manager/ie7_password.h', 'browser/password_manager/login_database.cc', @@ -2789,7 +2784,6 @@ 'browser/importer/nss_decryptor_system_nss.h', 'browser/jankometer.cc', 'browser/lifetime/application_lifetime_stub.cc', - 'browser/password_manager/encryptor_posix.cc', 'browser/password_manager/login_database_posix.cc', 'browser/tab_contents/spellchecker_submenu_observer_hunspell.cc', ], diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi index 2cbb30e..e2bbf68 100644 --- a/chrome/chrome_tests_unit.gypi +++ b/chrome/chrome_tests_unit.gypi @@ -922,8 +922,6 @@ 'browser/omnibox/omnibox_field_trial_unittest.cc', 'browser/page_cycler/page_cycler_unittest.cc', 'browser/parsers/metadata_parser_filebase_unittest.cc', - 'browser/password_manager/encryptor_password_mac_unittest.cc', - 'browser/password_manager/encryptor_unittest.cc', 'browser/password_manager/login_database_unittest.cc', 'browser/password_manager/native_backend_gnome_x_unittest.cc', 'browser/password_manager/native_backend_kwallet_x_unittest.cc', diff --git a/components/autofill/browser/autofill_common_test.cc b/components/autofill/browser/autofill_common_test.cc index 447c12d..ff6c135 100644 --- a/components/autofill/browser/autofill_common_test.cc +++ b/components/autofill/browser/autofill_common_test.cc @@ -7,13 +7,13 @@ #include "base/guid.h" #include "base/prefs/pref_service.h" #include "base/utf_string_conversions.h" -#include "chrome/browser/password_manager/encryptor.h" #include "chrome/browser/profiles/profile.h" #include "components/autofill/browser/autofill_profile.h" #include "components/autofill/browser/credit_card.h" #include "components/autofill/common/autofill_pref_names.h" #include "components/autofill/common/form_field_data.h" #include "components/user_prefs/user_prefs.h" +#include "components/webdata/encryptor/encryptor.h" namespace autofill_test { diff --git a/components/autofill/browser/personal_data_manager_unittest.cc b/components/autofill/browser/personal_data_manager_unittest.cc index 8093028..2a21f9a 100644 --- a/components/autofill/browser/personal_data_manager_unittest.cc +++ b/components/autofill/browser/personal_data_manager_unittest.cc @@ -10,7 +10,6 @@ #include "base/message_loop.h" #include "base/synchronization/waitable_event.h" #include "base/utf_string_conversions.h" -#include "chrome/browser/password_manager/encryptor.h" #include "chrome/browser/webdata/web_data_service.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile.h" @@ -21,6 +20,7 @@ #include "components/autofill/browser/personal_data_manager.h" #include "components/autofill/browser/personal_data_manager_observer.h" #include "components/autofill/common/form_data.h" +#include "components/webdata/encryptor/encryptor.h" #include "content/public/browser/notification_details.h" #include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_source.h" diff --git a/components/components.gyp b/components/components.gyp index cc385a0..589c241 100644 --- a/components/components.gyp +++ b/components/components.gyp @@ -3,6 +3,12 @@ # found in the LICENSE file. { + 'variables': { + # This turns on e.g. the filename-based detection of which + # platforms to include source files on (e.g. files ending in + # _mac.h or _mac.cc are only compiled on MacOSX). + 'chromium_code': 1, + }, 'includes': [ 'autofill.gypi', 'auto_login_parser.gypi', @@ -10,6 +16,7 @@ 'navigation_interception.gypi', 'user_prefs.gypi', 'visitedlink.gypi', + 'webdata.gypi', 'web_contents_delegate_android.gypi', ], } diff --git a/components/components_tests.gypi b/components/components_tests.gypi index 0b126e4..158a92b 100644 --- a/components/components_tests.gypi +++ b/components/components_tests.gypi @@ -11,6 +11,8 @@ 'type': '<(gtest_target_type)', 'sources': [ 'auto_login_parser/auto_login_parser_unittest.cc', + 'webdata/encryptor/encryptor_password_mac_unittest.cc', + 'webdata/encryptor/encryptor_unittest.cc', 'navigation_interception/intercept_navigation_resource_throttle_unittest.cc', 'test/run_all_unittests.cc', 'visitedlink/test/visitedlink_unittest.cc', @@ -24,7 +26,10 @@ '../testing/gtest.gyp:gtest', # Dependencies of auto_login_parser - 'components.gyp:auto_login_parser', + 'auto_login_parser', + + # Dependencies of encryptor + 'encryptor', # Dependencies of intercept_navigation_resource_throttle_unittest.cc '../content/content.gyp:test_support_content', @@ -32,8 +37,8 @@ 'navigation_interception', # Dependencies of visitedlink - 'components.gyp:visitedlink_browser', - 'components.gyp:visitedlink_renderer', + 'visitedlink_browser', + 'visitedlink_renderer', '../content/content_resources.gyp:content_resources', ], 'conditions': [ diff --git a/components/webdata.gypi b/components/webdata.gypi new file mode 100644 index 0000000..321438d --- /dev/null +++ b/components/webdata.gypi @@ -0,0 +1,34 @@ +# Copyright (c) 2013 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. + +{ + 'targets': [ + { + 'target_name': 'encryptor', + 'type': 'static_library', + 'include_dirs': [ + '..', + ], + 'dependencies': [ + '../base/base.gyp:base', + '../crypto/crypto.gyp:crypto', + ], + 'sources': [ + 'webdata/encryptor/encryptor.h', + 'webdata/encryptor/encryptor_mac.mm', + 'webdata/encryptor/encryptor_password_mac.h', + 'webdata/encryptor/encryptor_password_mac.mm', + 'webdata/encryptor/encryptor_posix.cc', + 'webdata/encryptor/encryptor_win.cc', + ], + 'conditions': [ + ['OS=="mac"', { + 'sources!': [ + 'webdata/encryptor/encryptor_posix.cc', + ], + }], + ], + }, + ], +} diff --git a/components/webdata/encryptor/DEPS b/components/webdata/encryptor/DEPS new file mode 100644 index 0000000..d175bda --- /dev/null +++ b/components/webdata/encryptor/DEPS @@ -0,0 +1,4 @@ +include_rules = [ + "-content", + "+crypto" +] diff --git a/components/webdata/encryptor/OWNERS b/components/webdata/encryptor/OWNERS new file mode 100644 index 0000000..e071199 --- /dev/null +++ b/components/webdata/encryptor/OWNERS @@ -0,0 +1,2 @@ +dhollowa@chromium.org +thestig@chromium.org diff --git a/components/webdata/encryptor/README b/components/webdata/encryptor/README new file mode 100644 index 0000000..ae18586 --- /dev/null +++ b/components/webdata/encryptor/README @@ -0,0 +1,4 @@ +Encryptor gives access to simple encryption and decryption of strings. + +On systems where available (currently Linux and Mac), this uses system +services to perform the encryption. diff --git a/chrome/browser/password_manager/encryptor.h b/components/webdata/encryptor/encryptor.h index 06eddd1..94ce108 100644 --- a/chrome/browser/password_manager/encryptor.h +++ b/components/webdata/encryptor/encryptor.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_PASSWORD_MANAGER_ENCRYPTOR_H__ -#define CHROME_BROWSER_PASSWORD_MANAGER_ENCRYPTOR_H__ +#ifndef COMPONENTS_WEBDATA_ENCRYPTOR_ENCRYPTOR_H_ +#define COMPONENTS_WEBDATA_ENCRYPTOR_ENCRYPTOR_H_ #include <string> @@ -48,4 +48,4 @@ class Encryptor { DISALLOW_IMPLICIT_CONSTRUCTORS(Encryptor); }; -#endif // CHROME_BROWSER_PASSWORD_MANAGER_ENCRYPTOR_H__ +#endif // COMPONENTS_WEBDATA_ENCRYPTOR_ENCRYPTOR_H_ diff --git a/chrome/browser/password_manager/encryptor_mac.mm b/components/webdata/encryptor/encryptor_mac.mm index c7f1cd4..67c46313 100644 --- a/chrome/browser/password_manager/encryptor_mac.mm +++ b/components/webdata/encryptor/encryptor_mac.mm @@ -2,14 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/password_manager/encryptor.h" +#include "components/webdata/encryptor/encryptor.h" #include <CommonCrypto/CommonCryptor.h> // for kCCBlockSizeAES128 #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/utf_string_conversions.h" -#include "chrome/browser/password_manager/encryptor_password_mac.h" +#include "components/webdata/encryptor/encryptor_password_mac.h" #include "crypto/apple_keychain.h" #include "crypto/encryptor.h" #include "crypto/symmetric_key.h" diff --git a/chrome/browser/password_manager/encryptor_password_mac.h b/components/webdata/encryptor/encryptor_password_mac.h index 475ae20..f03db49 100644 --- a/chrome/browser/password_manager/encryptor_password_mac.h +++ b/components/webdata/encryptor/encryptor_password_mac.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_PASSWORD_MANAGER_ENCRYPTOR_PASSWORD_H__ -#define CHROME_BROWSER_PASSWORD_MANAGER_ENCRYPTOR_PASSWORD_H__ +#ifndef COMPONENTS_WEBDATA_ENCRYPTOR_ENCRYPTOR_PASSWORD_MAC_H_ +#define COMPONENTS_WEBDATA_ENCRYPTOR_ENCRYPTOR_PASSWORD_MAC_H_ #include <string> @@ -32,4 +32,4 @@ class EncryptorPassword { const crypto::AppleKeychain& keychain_; }; -#endif // CHROME_BROWSER_PASSWORD_MANAGER_ENCRYPTOR_PASSWORD_H__ +#endif // COMPONENTS_WEBDATA_ENCRYPTOR_ENCRYPTOR_PASSWORD_MAC_H_ diff --git a/chrome/browser/password_manager/encryptor_password_mac.mm b/components/webdata/encryptor/encryptor_password_mac.mm index d472fad..f8178014 100644 --- a/chrome/browser/password_manager/encryptor_password_mac.mm +++ b/components/webdata/encryptor/encryptor_password_mac.mm @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/password_manager/encryptor_password_mac.h" +#include "components/webdata/encryptor/encryptor_password_mac.h" #import <Security/Security.h> @@ -10,7 +10,6 @@ #include "base/mac/mac_logging.h" #include "base/rand_util.h" #include "crypto/apple_keychain.h" -#include "ui/base/l10n/l10n_util.h" using crypto::AppleKeychain; diff --git a/chrome/browser/password_manager/encryptor_password_mac_unittest.cc b/components/webdata/encryptor/encryptor_password_mac_unittest.cc index f7b211a..9746222 100644 --- a/chrome/browser/password_manager/encryptor_password_mac_unittest.cc +++ b/components/webdata/encryptor/encryptor_password_mac_unittest.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/password_manager/encryptor_password_mac.h" +#include "components/webdata/encryptor/encryptor_password_mac.h" #include "crypto/mock_apple_keychain.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/password_manager/encryptor_posix.cc b/components/webdata/encryptor/encryptor_posix.cc index e43c656..70d536c 100644 --- a/chrome/browser/password_manager/encryptor_posix.cc +++ b/components/webdata/encryptor/encryptor_posix.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/password_manager/encryptor.h" +#include "components/webdata/encryptor/encryptor.h" #include "base/logging.h" #include "base/memory/scoped_ptr.h" diff --git a/chrome/browser/password_manager/encryptor_unittest.cc b/components/webdata/encryptor/encryptor_unittest.cc index 4ae41e6..c9f8026 100644 --- a/chrome/browser/password_manager/encryptor_unittest.cc +++ b/components/webdata/encryptor/encryptor_unittest.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/password_manager/encryptor.h" +#include "components/webdata/encryptor/encryptor.h" #include <string> diff --git a/chrome/browser/password_manager/encryptor_win.cc b/components/webdata/encryptor/encryptor_win.cc index ba50339..ceb6020 100644 --- a/chrome/browser/password_manager/encryptor_win.cc +++ b/components/webdata/encryptor/encryptor_win.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/password_manager/encryptor.h" +#include "components/webdata/encryptor/encryptor.h" #include <windows.h> #include <wincrypt.h> diff --git a/sync/util/data_encryption_win.cc b/sync/util/data_encryption_win.cc index 943f849..5fec33b 100644 --- a/sync/util/data_encryption_win.cc +++ b/sync/util/data_encryption_win.cc @@ -14,7 +14,7 @@ #pragma comment(lib, "crypt32.lib") // TODO(akalin): Merge this with similar code in -// chrome/browser/password_manager/encryptor_win.cc. Preferably, all +// components/webdata/encryptor/encryptor_win.cc. Preferably, all // this stuff would live in crypto/. namespace syncer { |