Index: chrome/browser/profiles/sql_init_error_message_ids.cc |
diff --git a/chrome/browser/profiles/sql_init_error_message_ids.cc b/chrome/browser/profiles/sql_init_error_message_ids.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2a91f43d73010d31251b94030f22e9ab98030e45 |
--- /dev/null |
+++ b/chrome/browser/profiles/sql_init_error_message_ids.cc |
@@ -0,0 +1,18 @@ |
+// 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 "chrome/browser/profiles/sql_init_error_message_ids.h" |
+ |
+#include "chrome/grit/chromium_strings.h" |
+#include "chrome/grit/generated_resources.h" |
+ |
+int SqlInitStatusToMessageId(sql::InitStatus status) { |
+ if (status == sql::INIT_OK_WITH_DATA_LOSS) |
+ return IDS_OPEN_PROFILE_DATA_LOSS; |
+ |
+ if (status == sql::INIT_FAILURE) |
+ return IDS_COULDNT_OPEN_PROFILE_ERROR; |
+ |
+ return IDS_PROFILE_TOO_NEW_ERROR; |
+} |