| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/profile_impl.h" | 5 #include "chrome/browser/profile_impl.h" |
| 6 | 6 |
| 7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/env_var.h" | 9 #include "base/environment.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| 11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
| 12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
| 13 #include "base/scoped_ptr.h" | 13 #include "base/scoped_ptr.h" |
| 14 #include "base/string_number_conversions.h" | 14 #include "base/string_number_conversions.h" |
| 15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
| 16 #include "chrome/browser/appcache/chrome_appcache_service.h" | 16 #include "chrome/browser/appcache/chrome_appcache_service.h" |
| 17 #include "chrome/browser/autocomplete/autocomplete_classifier.h" | 17 #include "chrome/browser/autocomplete/autocomplete_classifier.h" |
| 18 #include "chrome/browser/autofill/personal_data_manager.h" | 18 #include "chrome/browser/autofill/personal_data_manager.h" |
| 19 #include "chrome/browser/background_contents_service.h" | 19 #include "chrome/browser/background_contents_service.h" |
| (...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 // the desktop environment currently running, allowing GNOME Keyring in XFCE. | 856 // the desktop environment currently running, allowing GNOME Keyring in XFCE. |
| 857 // (In all cases we fall back on the default store in case of failure.) | 857 // (In all cases we fall back on the default store in case of failure.) |
| 858 base::DesktopEnvironment desktop_env; | 858 base::DesktopEnvironment desktop_env; |
| 859 std::wstring store_type = CommandLine::ForCurrentProcess()->GetSwitchValue( | 859 std::wstring store_type = CommandLine::ForCurrentProcess()->GetSwitchValue( |
| 860 switches::kPasswordStore); | 860 switches::kPasswordStore); |
| 861 if (store_type == L"kwallet") { | 861 if (store_type == L"kwallet") { |
| 862 desktop_env = base::DESKTOP_ENVIRONMENT_KDE4; | 862 desktop_env = base::DESKTOP_ENVIRONMENT_KDE4; |
| 863 } else if (store_type == L"gnome") { | 863 } else if (store_type == L"gnome") { |
| 864 desktop_env = base::DESKTOP_ENVIRONMENT_GNOME; | 864 desktop_env = base::DESKTOP_ENVIRONMENT_GNOME; |
| 865 } else if (store_type == L"detect") { | 865 } else if (store_type == L"detect") { |
| 866 scoped_ptr<base::EnvVarGetter> env_getter(base::EnvVarGetter::Create()); | 866 scoped_ptr<base::Environment> env(base::Environment::Create()); |
| 867 desktop_env = base::GetDesktopEnvironment(env_getter.get()); | 867 desktop_env = base::GetDesktopEnvironment(env.get()); |
| 868 LOG(INFO) << "Password storage detected desktop environment: " << | 868 LOG(INFO) << "Password storage detected desktop environment: " << |
| 869 base::GetDesktopEnvironmentName(desktop_env); | 869 base::GetDesktopEnvironmentName(desktop_env); |
| 870 } else { | 870 } else { |
| 871 // TODO(mdm): If the flag is not given, or has an unknown value, use the | 871 // TODO(mdm): If the flag is not given, or has an unknown value, use the |
| 872 // default store for now. Once we're confident in the other stores, we can | 872 // default store for now. Once we're confident in the other stores, we can |
| 873 // default to detecting the desktop environment instead. | 873 // default to detecting the desktop environment instead. |
| 874 desktop_env = base::DESKTOP_ENVIRONMENT_OTHER; | 874 desktop_env = base::DESKTOP_ENVIRONMENT_OTHER; |
| 875 } | 875 } |
| 876 | 876 |
| 877 scoped_ptr<PasswordStoreX::NativeBackend> backend; | 877 scoped_ptr<PasswordStoreX::NativeBackend> backend; |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1168 new ProfileSyncFactoryImpl(this, CommandLine::ForCurrentProcess())); | 1168 new ProfileSyncFactoryImpl(this, CommandLine::ForCurrentProcess())); |
| 1169 sync_service_.reset( | 1169 sync_service_.reset( |
| 1170 profile_sync_factory_->CreateProfileSyncService()); | 1170 profile_sync_factory_->CreateProfileSyncService()); |
| 1171 sync_service_->Initialize(); | 1171 sync_service_->Initialize(); |
| 1172 } | 1172 } |
| 1173 | 1173 |
| 1174 void ProfileImpl::InitCloudPrintProxyService() { | 1174 void ProfileImpl::InitCloudPrintProxyService() { |
| 1175 cloud_print_proxy_service_.reset(new CloudPrintProxyService(this)); | 1175 cloud_print_proxy_service_.reset(new CloudPrintProxyService(this)); |
| 1176 cloud_print_proxy_service_->Initialize(); | 1176 cloud_print_proxy_service_->Initialize(); |
| 1177 } | 1177 } |
| OLD | NEW |