Add new certificateProvider extension API.
[chromium-blink-merge.git] / chrome / browser / ui / webui / chromeos / first_run / first_run_actor.cc
blob77893ffb73108b537c593a5274b863f7e17b893f
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
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/webui/chromeos/first_run/first_run_actor.h"
7 #include <limits>
9 #include "base/values.h"
11 namespace {
12 const int kNoneValue = std::numeric_limits<int>::min();
15 namespace chromeos {
17 FirstRunActor::StepPosition::StepPosition()
18 : top_(kNoneValue),
19 right_(kNoneValue),
20 bottom_(kNoneValue),
21 left_(kNoneValue) {
24 FirstRunActor::StepPosition& FirstRunActor::StepPosition::SetTop(int top) {
25 top_ = top;
26 return *this;
29 FirstRunActor::StepPosition& FirstRunActor::StepPosition::SetRight(int right) {
30 right_ = right;
31 return *this;
34 FirstRunActor::StepPosition&
35 FirstRunActor::StepPosition::SetBottom(int bottom) {
36 bottom_ = bottom;
37 return *this;
40 FirstRunActor::StepPosition& FirstRunActor::StepPosition::SetLeft(int left) {
41 left_ = left;
42 return *this;
45 scoped_ptr<base::DictionaryValue> FirstRunActor::StepPosition::AsValue() const {
46 base::DictionaryValue* result = new base::DictionaryValue();
47 if (top_ != kNoneValue)
48 result->SetInteger("top", top_);
49 if (right_ != kNoneValue)
50 result->SetInteger("right", right_);
51 if (bottom_ != kNoneValue)
52 result->SetInteger("bottom", bottom_);
53 if (left_ != kNoneValue)
54 result->SetInteger("left", left_);
55 return make_scoped_ptr(result);
58 FirstRunActor::FirstRunActor()
59 : delegate_(NULL) {
62 FirstRunActor::~FirstRunActor() {
63 if (delegate())
64 delegate()->OnActorDestroyed();
65 delegate_ = NULL;
68 } // namespace chromeos