Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / webui / chromeos / login / screen_manager_handler.cc
blob9b3153ab31070482f7506b41426f0dc8086ada40
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/webui/chromeos/login/screen_manager_handler.h"
7 namespace {
9 const char kJsApiButtonPressed[] = "buttonPressed";
10 const char kJsApiContextChanged[] = "contextChanged";
12 } // namespace
14 namespace chromeos {
16 ScreenManagerHandler::ScreenManagerHandler()
17 : delegate_(NULL) {
20 ScreenManagerHandler::~ScreenManagerHandler() {
23 void ScreenManagerHandler::SetDelegate(Delegate* delegate) {
24 delegate_ = delegate;
27 void ScreenManagerHandler::DeclareLocalizedValues(
28 LocalizedValuesBuilder* builder) {
31 void ScreenManagerHandler::Initialize() {
34 void ScreenManagerHandler::RegisterMessages() {
35 AddCallback(kJsApiButtonPressed,
36 &ScreenManagerHandler::HandleButtonPressed);
37 AddCallback(kJsApiContextChanged,
38 &ScreenManagerHandler::HandleContextChanged);
41 void ScreenManagerHandler::HandleButtonPressed(const std::string& screen_name,
42 const std::string& button_id) {
43 if (delegate_)
44 delegate_->OnButtonPressed(screen_name, button_id);
47 void ScreenManagerHandler::HandleContextChanged(
48 const std::string& screen_name,
49 const base::DictionaryValue* diff) {
50 if (delegate_)
51 delegate_->OnContextChanged(screen_name, diff);
54 } // namespace chromeos