OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ui/webui/chromeos/login/host_pairing_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/host_pairing_screen_handler.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "chrome/browser/chromeos/login/oobe_screen.h" | 9 #include "chrome/browser/chromeos/login/oobe_screen.h" |
10 #include "chrome/grit/generated_resources.h" | 10 #include "chrome/grit/generated_resources.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 const char kCallbackContextReady[] = "contextReady"; | 25 const char kCallbackContextReady[] = "contextReady"; |
26 | 26 |
27 } // namespace | 27 } // namespace |
28 | 28 |
29 HostPairingScreenHandler::HostPairingScreenHandler() { | 29 HostPairingScreenHandler::HostPairingScreenHandler() { |
30 set_call_js_prefix(kJsScreenPath); | 30 set_call_js_prefix(kJsScreenPath); |
31 } | 31 } |
32 | 32 |
33 HostPairingScreenHandler::~HostPairingScreenHandler() { | 33 HostPairingScreenHandler::~HostPairingScreenHandler() { |
34 if (delegate_) | 34 if (delegate_) |
35 delegate_->OnActorDestroyed(this); | 35 delegate_->OnViewDestroyed(this); |
36 } | 36 } |
37 | 37 |
38 void HostPairingScreenHandler::HandleContextReady() { | 38 void HostPairingScreenHandler::HandleContextReady() { |
39 js_context_ready_ = true; | 39 js_context_ready_ = true; |
40 OnContextChanged(context_cache_.storage()); | 40 OnContextChanged(context_cache_.storage()); |
41 } | 41 } |
42 | 42 |
43 void HostPairingScreenHandler::Initialize() { | 43 void HostPairingScreenHandler::Initialize() { |
44 if (!page_is_ready() || !delegate_) | 44 if (!page_is_ready() || !delegate_) |
45 return; | 45 return; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 void HostPairingScreenHandler::OnContextChanged( | 110 void HostPairingScreenHandler::OnContextChanged( |
111 const base::DictionaryValue& diff) { | 111 const base::DictionaryValue& diff) { |
112 if (!js_context_ready_) { | 112 if (!js_context_ready_) { |
113 context_cache_.ApplyChanges(diff, NULL); | 113 context_cache_.ApplyChanges(diff, NULL); |
114 return; | 114 return; |
115 } | 115 } |
116 CallJS(kMethodContextChanged, diff); | 116 CallJS(kMethodContextChanged, diff); |
117 } | 117 } |
118 | 118 |
119 } // namespace chromeos | 119 } // namespace chromeos |
OLD | NEW |