Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 199 } | 199 } |
| 200 | 200 |
| 201 void ArcSupportHost::ShowTermsOfService() { | 201 void ArcSupportHost::ShowTermsOfService() { |
| 202 ShowPage(UIPage::TERMS); | 202 ShowPage(UIPage::TERMS); |
| 203 } | 203 } |
| 204 | 204 |
| 205 void ArcSupportHost::ShowLso() { | 205 void ArcSupportHost::ShowLso() { |
| 206 ShowPage(UIPage::LSO); | 206 ShowPage(UIPage::LSO); |
| 207 } | 207 } |
| 208 | 208 |
| 209 void ArcSupportHost::ShowArcLoading() { | 209 void ArcSupportHost::ShowArcLoading(bool force_activate) { |
| 210 if (!force_activate && !message_host_) { | |
|
hidehiko
2016/12/20 15:20:45
Please do not depend on message_host_.
It's life t
khmel
2016/12/20 16:27:58
Please see code below, L 219, where absent of mess
| |
| 211 ui_page_ = UIPage::ARC_LOADING; | |
| 212 return; | |
| 213 } | |
| 210 ShowPage(UIPage::ARC_LOADING); | 214 ShowPage(UIPage::ARC_LOADING); |
| 211 } | 215 } |
| 212 | 216 |
| 213 void ArcSupportHost::ShowPage(UIPage ui_page) { | 217 void ArcSupportHost::ShowPage(UIPage ui_page) { |
| 214 ui_page_ = ui_page; | 218 ui_page_ = ui_page; |
| 215 if (!message_host_) { | 219 if (!message_host_) { |
| 216 if (app_start_pending_) { | 220 if (app_start_pending_) { |
| 217 VLOG(2) << "ArcSupportHost::ShowPage(" << ui_page << ") is called " | 221 VLOG(2) << "ArcSupportHost::ShowPage(" << ui_page << ") is called " |
| 218 << "before connection to ARC support Chrome app has finished " | 222 << "before connection to ARC support Chrome app has finished " |
| 219 << "establishing."; | 223 << "establishing."; |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 526 } else if (event == kEventOnAgreed) { | 530 } else if (event == kEventOnAgreed) { |
| 527 bool is_metrics_enabled; | 531 bool is_metrics_enabled; |
| 528 bool is_backup_restore_enabled; | 532 bool is_backup_restore_enabled; |
| 529 bool is_location_service_enabled; | 533 bool is_location_service_enabled; |
| 530 if (message.GetBoolean(kIsMetricsEnabled, &is_metrics_enabled) && | 534 if (message.GetBoolean(kIsMetricsEnabled, &is_metrics_enabled) && |
| 531 message.GetBoolean(kIsBackupRestoreEnabled, | 535 message.GetBoolean(kIsBackupRestoreEnabled, |
| 532 &is_backup_restore_enabled) && | 536 &is_backup_restore_enabled) && |
| 533 message.GetBoolean(kIsLocationServiceEnabled, | 537 message.GetBoolean(kIsLocationServiceEnabled, |
| 534 &is_location_service_enabled)) { | 538 &is_location_service_enabled)) { |
| 535 for (auto& observer : observer_list_) { | 539 for (auto& observer : observer_list_) { |
| 536 observer.OnTermsAgreed(is_metrics_enabled, is_backup_restore_enabled, | 540 observer.OnTermsAccepted(is_metrics_enabled, is_backup_restore_enabled, |
| 537 is_location_service_enabled); | 541 is_location_service_enabled); |
| 538 } | 542 } |
| 539 } else { | 543 } else { |
| 540 NOTREACHED(); | 544 NOTREACHED(); |
| 541 } | 545 } |
| 542 } else if (event == kEventOnRetryClicked) { | 546 } else if (event == kEventOnRetryClicked) { |
| 543 for (auto& observer : observer_list_) | 547 for (auto& observer : observer_list_) |
| 544 observer.OnRetryClicked(); | 548 observer.OnRetryClicked(); |
| 545 } else if (event == kEventOnSendFeedbackClicked) { | 549 } else if (event == kEventOnSendFeedbackClicked) { |
| 546 for (auto& observer : observer_list_) | 550 for (auto& observer : observer_list_) |
| 547 observer.OnSendFeedbackClicked(); | 551 observer.OnSendFeedbackClicked(); |
| 548 } else { | 552 } else { |
| 549 LOG(ERROR) << "Unknown message: " << event; | 553 LOG(ERROR) << "Unknown message: " << event; |
| 550 NOTREACHED(); | 554 NOTREACHED(); |
| 551 } | 555 } |
| 552 } | 556 } |
| OLD | NEW |