summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/first_run/steps/help_step.cc
blob: 2c28f4966ea3d063ee35ac0a797d5fdffce959fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/chromeos/first_run/steps/help_step.h"

#include "ash/first_run/first_run_helper.h"
#include "chrome/browser/chromeos/first_run/step_names.h"
#include "chrome/browser/ui/webui/chromeos/first_run/first_run_actor.h"
#include "ui/gfx/rect.h"

namespace {

const int kCircleRadius = 19;

}  // namespace

namespace chromeos {
namespace first_run {

HelpStep::HelpStep(ash::FirstRunHelper* shell_helper, FirstRunActor* actor)
    : Step(kHelpStep, shell_helper, actor) {
}

void HelpStep::Show() {
  if (!shell_helper()->IsTrayBubbleOpened())
    shell_helper()->OpenTrayBubble();
  gfx::Rect button_bounds = shell_helper()->GetHelpButtonBounds();
  gfx::Point center = button_bounds.CenterPoint();
  actor()->AddRoundHole(center.x(), center.y(), kCircleRadius);
  actor()->ShowStepPointingTo(name(), center.x(), center.y(), kCircleRadius);
}

void HelpStep::OnBeforeHide() {
  shell_helper()->CloseTrayBubble();
}

}  // namespace first_run
}  // namespace chromeos