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

Side by Side Diff: chrome/browser/web_data_service_factory.cc

Issue 2438433006: chrome: change ProfileErrorType enum into an enum class (Closed)
Patch Set: update comment Created 4 years, 2 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
« no previous file with comments | « chrome/browser/ui/profile_error_dialog.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/web_data_service_factory.h" 5 #include "chrome/browser/web_data_service_factory.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/memory/singleton.h" 9 #include "base/memory/singleton.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 16 matching lines...) Expand all
27 27
28 using content::BrowserThread; 28 using content::BrowserThread;
29 29
30 namespace { 30 namespace {
31 31
32 // Converts a WebDataServiceWrapper::ErrorType to ProfileErrorType. 32 // Converts a WebDataServiceWrapper::ErrorType to ProfileErrorType.
33 ProfileErrorType ProfileErrorFromWebDataServiceWrapperError( 33 ProfileErrorType ProfileErrorFromWebDataServiceWrapperError(
34 WebDataServiceWrapper::ErrorType error_type) { 34 WebDataServiceWrapper::ErrorType error_type) {
35 switch (error_type) { 35 switch (error_type) {
36 case WebDataServiceWrapper::ERROR_LOADING_AUTOFILL: 36 case WebDataServiceWrapper::ERROR_LOADING_AUTOFILL:
37 return PROFILE_ERROR_DB_AUTOFILL_WEB_DATA; 37 return ProfileErrorType::DB_AUTOFILL_WEB_DATA;
38 38
39 case WebDataServiceWrapper::ERROR_LOADING_KEYWORD: 39 case WebDataServiceWrapper::ERROR_LOADING_KEYWORD:
40 return PROFILE_ERROR_DB_KEYWORD_WEB_DATA; 40 return ProfileErrorType::DB_KEYWORD_WEB_DATA;
41 41
42 case WebDataServiceWrapper::ERROR_LOADING_TOKEN: 42 case WebDataServiceWrapper::ERROR_LOADING_TOKEN:
43 return PROFILE_ERROR_DB_TOKEN_WEB_DATA; 43 return ProfileErrorType::DB_TOKEN_WEB_DATA;
44 44
45 case WebDataServiceWrapper::ERROR_LOADING_PASSWORD: 45 case WebDataServiceWrapper::ERROR_LOADING_PASSWORD:
46 return PROFILE_ERROR_DB_WEB_DATA; 46 return ProfileErrorType::DB_WEB_DATA;
47 47
48 default: 48 default:
49 NOTREACHED() 49 NOTREACHED()
50 << "Unknown WebDataServiceWrapper::ErrorType: " << error_type; 50 << "Unknown WebDataServiceWrapper::ErrorType: " << error_type;
51 return PROFILE_ERROR_DB_WEB_DATA; 51 return ProfileErrorType::DB_WEB_DATA;
52 } 52 }
53 } 53 }
54 54
55 // Callback to show error dialog on profile load error. 55 // Callback to show error dialog on profile load error.
56 void ProfileErrorCallback(WebDataServiceWrapper::ErrorType error_type, 56 void ProfileErrorCallback(WebDataServiceWrapper::ErrorType error_type,
57 sql::InitStatus status, 57 sql::InitStatus status,
58 const std::string& diagnostics) { 58 const std::string& diagnostics) {
59 ShowProfileErrorDialog(ProfileErrorFromWebDataServiceWrapperError(error_type), 59 ShowProfileErrorDialog(ProfileErrorFromWebDataServiceWrapperError(error_type),
60 SqlInitStatusToMessageId(status), diagnostics); 60 SqlInitStatusToMessageId(status), diagnostics);
61 } 61 }
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 profile_path, g_browser_process->GetApplicationLocale(), 167 profile_path, g_browser_process->GetApplicationLocale(),
168 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI), 168 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI),
169 BrowserThread::GetTaskRunnerForThread(BrowserThread::DB), 169 BrowserThread::GetTaskRunnerForThread(BrowserThread::DB),
170 sync_start_util::GetFlareForSyncableService(profile_path), 170 sync_start_util::GetFlareForSyncableService(profile_path),
171 &ProfileErrorCallback); 171 &ProfileErrorCallback);
172 } 172 }
173 173
174 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() const { 174 bool WebDataServiceFactory::ServiceIsNULLWhileTesting() const {
175 return true; 175 return true;
176 } 176 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/profile_error_dialog.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698