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

Side by Side Diff: chrome/browser/chromeos/arc/arc_support_host.cc

Issue 2765523002: arc: Add explicit error message in case network cannot be setup. (Closed)
Patch Set: update Created 3 years, 9 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/chromeos/arc/arc_support_host.h" 5 #include "chrome/browser/chromeos/arc/arc_support_host.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "ash/common/system/chromeos/devicetype_utils.h" 10 #include "ash/common/system/chromeos/devicetype_utils.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 case ArcSupportHost::Error::SIGN_IN_GMS_NOT_AVAILABLE_ERROR: 133 case ArcSupportHost::Error::SIGN_IN_GMS_NOT_AVAILABLE_ERROR:
134 return os << "SIGN_IN_GMS_NOT_AVAILABLE_ERROR"; 134 return os << "SIGN_IN_GMS_NOT_AVAILABLE_ERROR";
135 case ArcSupportHost::Error::SIGN_IN_CLOUD_PROVISION_FLOW_FAIL_ERROR: 135 case ArcSupportHost::Error::SIGN_IN_CLOUD_PROVISION_FLOW_FAIL_ERROR:
136 return os << "SIGN_IN_CLOUD_PROVISION_FLOW_FAIL_ERROR"; 136 return os << "SIGN_IN_CLOUD_PROVISION_FLOW_FAIL_ERROR";
137 case ArcSupportHost::Error::SIGN_IN_UNKNOWN_ERROR: 137 case ArcSupportHost::Error::SIGN_IN_UNKNOWN_ERROR:
138 return os << "SIGN_IN_UNKNOWN_ERROR"; 138 return os << "SIGN_IN_UNKNOWN_ERROR";
139 case ArcSupportHost::Error::SERVER_COMMUNICATION_ERROR: 139 case ArcSupportHost::Error::SERVER_COMMUNICATION_ERROR:
140 return os << "SERVER_COMMUNICATION_ERROR"; 140 return os << "SERVER_COMMUNICATION_ERROR";
141 case ArcSupportHost::Error::ANDROID_MANAGEMENT_REQUIRED_ERROR: 141 case ArcSupportHost::Error::ANDROID_MANAGEMENT_REQUIRED_ERROR:
142 return os << "ANDROID_MANAGEMENT_REQUIRED_ERROR"; 142 return os << "ANDROID_MANAGEMENT_REQUIRED_ERROR";
143 case ArcSupportHost::Error::NETWORK_UNAVAILABLE_ERROR:
144 return os << "NETWORK_UNAVAILABLE_ERROR";
143 } 145 }
144 146
145 // Some compiler reports an error even if all values of an enum-class are 147 // Some compiler reports an error even if all values of an enum-class are
146 // covered indivisually in a switch statement. 148 // covered indivisually in a switch statement.
147 NOTREACHED(); 149 NOTREACHED();
148 return os; 150 return os;
149 } 151 }
150 152
151 } // namespace 153 } // namespace
152 154
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 break; 284 break;
283 case Error::SIGN_IN_UNKNOWN_ERROR: 285 case Error::SIGN_IN_UNKNOWN_ERROR:
284 message_id = IDS_ARC_SIGN_IN_UNKNOWN_ERROR; 286 message_id = IDS_ARC_SIGN_IN_UNKNOWN_ERROR;
285 break; 287 break;
286 case Error::SERVER_COMMUNICATION_ERROR: 288 case Error::SERVER_COMMUNICATION_ERROR:
287 message_id = IDS_ARC_SERVER_COMMUNICATION_ERROR; 289 message_id = IDS_ARC_SERVER_COMMUNICATION_ERROR;
288 break; 290 break;
289 case Error::ANDROID_MANAGEMENT_REQUIRED_ERROR: 291 case Error::ANDROID_MANAGEMENT_REQUIRED_ERROR:
290 message_id = IDS_ARC_ANDROID_MANAGEMENT_REQUIRED_ERROR; 292 message_id = IDS_ARC_ANDROID_MANAGEMENT_REQUIRED_ERROR;
291 break; 293 break;
294 case Error::NETWORK_UNAVAILABLE_ERROR:
295 message_id = IDS_ARC_NETWORK_UNAVAILABLE_ERROR;
296 break;
292 } 297 }
293 message.SetString(kErrorMessage, l10n_util::GetStringUTF16(message_id)); 298 message.SetString(kErrorMessage, l10n_util::GetStringUTF16(message_id));
294 message.SetBoolean(kShouldShowSendFeedback, should_show_send_feedback); 299 message.SetBoolean(kShouldShowSendFeedback, should_show_send_feedback);
295 message_host_->SendMessage(message); 300 message_host_->SendMessage(message);
296 } 301 }
297 302
298 void ArcSupportHost::SetMetricsPreferenceCheckbox(bool is_enabled, 303 void ArcSupportHost::SetMetricsPreferenceCheckbox(bool is_enabled,
299 bool is_managed) { 304 bool is_managed) {
300 metrics_checkbox_ = PreferenceCheckboxData(is_enabled, is_managed); 305 metrics_checkbox_ = PreferenceCheckboxData(is_enabled, is_managed);
301 SendPreferenceCheckboxUpdate(kActionSetMetricsMode, metrics_checkbox_); 306 SendPreferenceCheckboxUpdate(kActionSetMetricsMode, metrics_checkbox_);
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 for (auto& observer : observer_list_) 554 for (auto& observer : observer_list_)
550 observer.OnRetryClicked(); 555 observer.OnRetryClicked();
551 } else if (event == kEventOnSendFeedbackClicked) { 556 } else if (event == kEventOnSendFeedbackClicked) {
552 for (auto& observer : observer_list_) 557 for (auto& observer : observer_list_)
553 observer.OnSendFeedbackClicked(); 558 observer.OnSendFeedbackClicked();
554 } else { 559 } else {
555 LOG(ERROR) << "Unknown message: " << event; 560 LOG(ERROR) << "Unknown message: " << event;
556 NOTREACHED(); 561 NOTREACHED();
557 } 562 }
558 } 563 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698