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_actor.h" | 5 #include "chrome/browser/ui/webui/chromeos/first_run/first_run_actor.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 return *this; | 38 return *this; |
39 } | 39 } |
40 | 40 |
41 FirstRunActor::StepPosition& FirstRunActor::StepPosition::SetLeft(int left) { | 41 FirstRunActor::StepPosition& FirstRunActor::StepPosition::SetLeft(int left) { |
42 left_ = left; | 42 left_ = left; |
43 return *this; | 43 return *this; |
44 } | 44 } |
45 | 45 |
46 std::unique_ptr<base::DictionaryValue> FirstRunActor::StepPosition::AsValue() | 46 std::unique_ptr<base::DictionaryValue> FirstRunActor::StepPosition::AsValue() |
47 const { | 47 const { |
48 base::DictionaryValue* result = new base::DictionaryValue(); | 48 auto result = base::MakeUnique<base::DictionaryValue>(); |
49 if (top_ != kNoneValue) | 49 if (top_ != kNoneValue) |
50 result->SetInteger("top", top_); | 50 result->SetInteger("top", top_); |
51 if (right_ != kNoneValue) | 51 if (right_ != kNoneValue) |
52 result->SetInteger("right", right_); | 52 result->SetInteger("right", right_); |
53 if (bottom_ != kNoneValue) | 53 if (bottom_ != kNoneValue) |
54 result->SetInteger("bottom", bottom_); | 54 result->SetInteger("bottom", bottom_); |
55 if (left_ != kNoneValue) | 55 if (left_ != kNoneValue) |
56 result->SetInteger("left", left_); | 56 result->SetInteger("left", left_); |
57 return base::WrapUnique(result); | 57 return result; |
58 } | 58 } |
59 | 59 |
60 FirstRunActor::FirstRunActor() | 60 FirstRunActor::FirstRunActor() |
61 : delegate_(NULL) { | 61 : delegate_(NULL) { |
62 } | 62 } |
63 | 63 |
64 FirstRunActor::~FirstRunActor() { | 64 FirstRunActor::~FirstRunActor() { |
65 if (delegate()) | 65 if (delegate()) |
66 delegate()->OnActorDestroyed(); | 66 delegate()->OnActorDestroyed(); |
67 delegate_ = NULL; | 67 delegate_ = NULL; |
68 } | 68 } |
69 | 69 |
70 } // namespace chromeos | 70 } // namespace chromeos |
71 | 71 |
OLD | NEW |