| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/first_run/first_run_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/first_run/first_run_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/ptr_util.h" |
| 8 #include "base/values.h" | 9 #include "base/values.h" |
| 9 #include "content/public/browser/web_ui.h" | 10 #include "content/public/browser/web_ui.h" |
| 10 | 11 |
| 11 namespace chromeos { | 12 namespace chromeos { |
| 12 | 13 |
| 13 FirstRunHandler::FirstRunHandler() | 14 FirstRunHandler::FirstRunHandler() |
| 14 : is_initialized_(false), | 15 : is_initialized_(false), |
| 15 is_finalizing_(false) { | 16 is_finalizing_(false) { |
| 16 } | 17 } |
| 17 | 18 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 43 void FirstRunHandler::ShowStepPositioned(const std::string& name, | 44 void FirstRunHandler::ShowStepPositioned(const std::string& name, |
| 44 const StepPosition& position) { | 45 const StepPosition& position) { |
| 45 web_ui()->CallJavascriptFunctionUnsafe( | 46 web_ui()->CallJavascriptFunctionUnsafe( |
| 46 "cr.FirstRun.showStep", base::Value(name), *position.AsValue()); | 47 "cr.FirstRun.showStep", base::Value(name), *position.AsValue()); |
| 47 } | 48 } |
| 48 | 49 |
| 49 void FirstRunHandler::ShowStepPointingTo(const std::string& name, | 50 void FirstRunHandler::ShowStepPointingTo(const std::string& name, |
| 50 int x, | 51 int x, |
| 51 int y, | 52 int y, |
| 52 int offset) { | 53 int offset) { |
| 53 std::unique_ptr<base::Value> null = base::Value::CreateNullValue(); | 54 auto null = base::MakeUnique<base::Value>(); |
| 54 base::ListValue point_with_offset; | 55 base::ListValue point_with_offset; |
| 55 point_with_offset.AppendInteger(x); | 56 point_with_offset.AppendInteger(x); |
| 56 point_with_offset.AppendInteger(y); | 57 point_with_offset.AppendInteger(y); |
| 57 point_with_offset.AppendInteger(offset); | 58 point_with_offset.AppendInteger(offset); |
| 58 web_ui()->CallJavascriptFunctionUnsafe( | 59 web_ui()->CallJavascriptFunctionUnsafe( |
| 59 "cr.FirstRun.showStep", base::Value(name), *null, point_with_offset); | 60 "cr.FirstRun.showStep", base::Value(name), *null, point_with_offset); |
| 60 } | 61 } |
| 61 | 62 |
| 62 void FirstRunHandler::HideCurrentStep() { | 63 void FirstRunHandler::HideCurrentStep() { |
| 63 web_ui()->CallJavascriptFunctionUnsafe("cr.FirstRun.hideCurrentStep"); | 64 web_ui()->CallJavascriptFunctionUnsafe("cr.FirstRun.hideCurrentStep"); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 delegate()->OnStepHidden(step_name); | 125 delegate()->OnStepHidden(step_name); |
| 125 } | 126 } |
| 126 | 127 |
| 127 void FirstRunHandler::HandleFinalized(const base::ListValue* args) { | 128 void FirstRunHandler::HandleFinalized(const base::ListValue* args) { |
| 128 is_finalizing_ = false; | 129 is_finalizing_ = false; |
| 129 if (delegate()) | 130 if (delegate()) |
| 130 delegate()->OnActorFinalized(); | 131 delegate()->OnActorFinalized(); |
| 131 } | 132 } |
| 132 | 133 |
| 133 } // namespace chromeos | 134 } // namespace chromeos |
| OLD | NEW |