| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/login/screens/base_screen.h" | 5 #include "chrome/browser/chromeos/login/screens/base_screen.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h" | 8 #include "chrome/browser/chromeos/login/screens/base_screen_delegate.h" |
| 9 #include "chrome/browser/chromeos/login/screens/model_view_channel.h" | 9 #include "chrome/browser/chromeos/login/screens/model_view_channel.h" |
| 10 | 10 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 if (!channel_) { | 89 if (!channel_) { |
| 90 LOG(ERROR) << "Model-view channel for " << GetOobeScreenName(screen_id()) | 90 LOG(ERROR) << "Model-view channel for " << GetOobeScreenName(screen_id()) |
| 91 << " is not ready, context changes are not sent to the view."; | 91 << " is not ready, context changes are not sent to the view."; |
| 92 return; | 92 return; |
| 93 } | 93 } |
| 94 base::DictionaryValue diff; | 94 base::DictionaryValue diff; |
| 95 context_.GetChangesAndReset(&diff); | 95 context_.GetChangesAndReset(&diff); |
| 96 channel_->CommitContextChanges(diff); | 96 channel_->CommitContextChanges(diff); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void BaseScreen::Finish(BaseScreenDelegate::ExitCodes exit_code) { | 99 void BaseScreen::Finish(ScreenExitCode exit_code) { |
| 100 base_screen_delegate_->OnExit(*this, exit_code, &context_); | 100 base_screen_delegate_->OnExit(*this, exit_code, &context_); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void BaseScreen::SetContext(::login::ScreenContext* context) { | 103 void BaseScreen::SetContext(::login::ScreenContext* context) { |
| 104 if (context) | 104 if (context) |
| 105 context_.CopyFrom(*context); | 105 context_.CopyFrom(*context); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void BaseScreen::OnUserAction(const std::string& action_id) { | 108 void BaseScreen::OnUserAction(const std::string& action_id) { |
| 109 LOG(WARNING) << "Unhandled user action: action_id=" << action_id; | 109 LOG(WARNING) << "Unhandled user action: action_id=" << action_id; |
| 110 } | 110 } |
| 111 | 111 |
| 112 void BaseScreen::OnContextKeyUpdated( | 112 void BaseScreen::OnContextKeyUpdated( |
| 113 const ::login::ScreenContext::KeyType& key) { | 113 const ::login::ScreenContext::KeyType& key) { |
| 114 LOG(WARNING) << "Unhandled context change: key=" << key; | 114 LOG(WARNING) << "Unhandled context change: key=" << key; |
| 115 } | 115 } |
| 116 | 116 |
| 117 BaseScreen::ContextEditor BaseScreen::GetContextEditor() { | 117 BaseScreen::ContextEditor BaseScreen::GetContextEditor() { |
| 118 return ContextEditor(*this); | 118 return ContextEditor(*this); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void BaseScreen::OnContextChanged(const base::DictionaryValue& diff) { | 121 void BaseScreen::OnContextChanged(const base::DictionaryValue& diff) { |
| 122 std::vector<::login::ScreenContext::KeyType> keys; | 122 std::vector<::login::ScreenContext::KeyType> keys; |
| 123 context_.ApplyChanges(diff, &keys); | 123 context_.ApplyChanges(diff, &keys); |
| 124 for (const auto& key : keys) | 124 for (const auto& key : keys) |
| 125 OnContextKeyUpdated(key); | 125 OnContextKeyUpdated(key); |
| 126 } | 126 } |
| 127 | 127 |
| 128 } // namespace chromeos | 128 } // namespace chromeos |
| OLD | NEW |