blob: 42bc6979cd00439134be8482bd2ea18efb65f9b2 (
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
// 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.
#ifndef ASH_FIRST_RUN_FIRST_RUN_HELPER_H_
#define ASH_FIRST_RUN_FIRST_RUN_HELPER_H_
#include "ash/ash_export.h"
#include "base/basictypes.h"
#include "base/observer_list.h"
namespace gfx {
class Rect;
}
namespace views {
class Widget;
}
namespace ash {
// Interface used by first-run tutorial to manipulate and retreive information
// about shell elements.
// All returned coordinates are in screen coordinate system.
class ASH_EXPORT FirstRunHelper {
public:
class Observer {
public:
// Called when first-run UI was cancelled.
virtual void OnCancelled() = 0;
virtual ~Observer() {}
};
public:
FirstRunHelper();
virtual ~FirstRunHelper();
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
// Returns widget to place tutorial UI into it.
virtual views::Widget* GetOverlayWidget() = 0;
// Opens and closes app list.
virtual void OpenAppList() = 0;
virtual void CloseAppList() = 0;
// Returns bounding rectangle of launcher elements.
virtual gfx::Rect GetLauncherBounds() = 0;
// Returns bounds of application list button.
virtual gfx::Rect GetAppListButtonBounds() = 0;
// Returns bounds of application list. You must open application list before
// calling this method.
virtual gfx::Rect GetAppListBounds() = 0;
// Opens and closes system tray bubble.
virtual void OpenTrayBubble() = 0;
virtual void CloseTrayBubble() = 0;
// Returns |true| iff system tray bubble is opened now.
virtual bool IsTrayBubbleOpened() = 0;
// Returns bounds of system tray bubble. You must open bubble before calling
// this method.
virtual gfx::Rect GetTrayBubbleBounds() = 0;
// Returns bounds of help app button from system tray buble. You must open
// bubble before calling this method.
virtual gfx::Rect GetHelpButtonBounds() = 0;
protected:
ObserverList<Observer>& observers() { return observers_; }
private:
ObserverList<Observer> observers_;
DISALLOW_COPY_AND_ASSIGN(FirstRunHelper);
};
} // namespace ash
#endif // ASH_FIRST_RUN_FIRST_RUN_HELPER_H_
|