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

Unified Diff: blimp/client/core/resources/blimp_strings.cc

Issue 2447483002: Test win_clang compile only check in core/resources. (Closed)
Patch Set: filter win platform build 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 side-by-side diff with in-line comments
Download patch
Index: blimp/client/core/resources/blimp_strings.cc
diff --git a/blimp/client/core/resources/blimp_strings.cc b/blimp/client/core/resources/blimp_strings.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5d8ae509031fd6815ddef737e7553db3e8fbf629
--- /dev/null
+++ b/blimp/client/core/resources/blimp_strings.cc
@@ -0,0 +1,78 @@
+// 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 "blimp/client/public/resources/blimp_strings.h"
+
+#include "blimp/client/core/resources/grit/blimp_strings.h"
+#include "ui/base/l10n/l10n_util.h"
+
+namespace blimp {
+namespace string {
+
+base::string16 AssignmentResultErrorToString(
+ client::AssignmentRequestResult result) {
+ DCHECK(result != client::ASSIGNMENT_REQUEST_RESULT_OK);
+
+ int string_id = IDS_ASSIGNMENT_SUCCESS;
+ switch (result) {
+ case client::ASSIGNMENT_REQUEST_RESULT_BAD_REQUEST:
+ string_id = IDS_ASSIGNMENT_FAILURE_BAD_REQUEST;
+ break;
+ case client::ASSIGNMENT_REQUEST_RESULT_BAD_RESPONSE:
+ string_id = IDS_ASSIGNMENT_FAILURE_BAD_RESPONSE;
+ break;
+ case client::ASSIGNMENT_REQUEST_RESULT_INVALID_PROTOCOL_VERSION:
+ string_id = IDS_ASSIGNMENT_FAILURE_BAD_VERSION;
+ break;
+ case client::ASSIGNMENT_REQUEST_RESULT_EXPIRED_ACCESS_TOKEN:
+ string_id = IDS_ASSIGNMENT_FAILURE_EXPIRED_TOKEN;
+ break;
+ case client::ASSIGNMENT_REQUEST_RESULT_USER_INVALID:
+ string_id = IDS_ASSIGNMENT_FAILURE_USER_INVALID;
+ break;
+ case client::ASSIGNMENT_REQUEST_RESULT_OUT_OF_VMS:
+ string_id = IDS_ASSIGNMENT_FAILURE_OUT_OF_VMS;
+ break;
+ case client::ASSIGNMENT_REQUEST_RESULT_SERVER_ERROR:
+ string_id = IDS_ASSIGNMENT_FAILURE_SERVER_ERROR;
+ break;
+ case client::ASSIGNMENT_REQUEST_RESULT_SERVER_INTERRUPTED:
+ string_id = IDS_ASSIGNMENT_FAILURE_SERVER_INTERRUPTED;
+ break;
+ case client::ASSIGNMENT_REQUEST_RESULT_NETWORK_FAILURE:
+ string_id = IDS_ASSIGNMENT_FAILURE_NETWORK;
+ break;
+ case client::ASSIGNMENT_REQUEST_RESULT_INVALID_CERT:
+ string_id = IDS_ASSIGNMENT_INVALID_CERT;
+ break;
+ case client::ASSIGNMENT_REQUEST_RESULT_UNKNOWN:
+ string_id = IDS_ASSIGNMENT_FAILURE_UNKNOWN;
+ break;
+ case client::ASSIGNMENT_REQUEST_RESULT_OK:
+ NOTIMPLEMENTED();
+ }
+
+ return l10n_util::GetStringUTF16(string_id);
+}
+
+base::string16 EndConnectionMessageToString(
+ EndConnectionMessage::Reason reason) {
+ int string_id = IDS_BLIMP_ENDCONNECTION_UNKNOWN;
+ switch (reason) {
+ case EndConnectionMessage::AUTHENTICATION_FAILED:
+ string_id = IDS_BLIMP_ENDCONNECTION_AUTH_FAIL;
+ break;
+ case EndConnectionMessage::PROTOCOL_MISMATCH:
+ string_id = IDS_BLIMP_ENDCONNECTION_PROTOCOL_MISMATCH;
+ break;
+ case EndConnectionMessage::UNKNOWN:
+ string_id = IDS_BLIMP_ENDCONNECTION_UNKNOWN;
+ break;
+ }
+
+ return l10n_util::GetStringUTF16(string_id);
+}
+
+} // namespace string
+} // namespace blimp
« no previous file with comments | « blimp/client/core/resources/android/java/res/xml/blimp_preferences.xml ('k') | blimp/client/core/resources/blimp_strings.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698