summaryrefslogtreecommitdiffstats
path: root/ash/launcher/launcher_types.h
blob: 051d3b355b5398729a97d2cc692c26e2827276b2 (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
86
87
88
// Copyright (c) 2012 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_LAUNCHER_LAUNCHER_TYPES_H_
#define ASH_LAUNCHER_LAUNCHER_TYPES_H_

#include <vector>

#include "ash/ash_export.h"
#include "ui/gfx/image/image_skia.h"

namespace ash {

typedef int LauncherID;

// Height of the Launcher. Hard coded to avoid resizing as items are
// added/removed.
ASH_EXPORT extern const int kLauncherPreferredSize;

// Max alpha of the launcher background.
ASH_EXPORT extern const int kLauncherBackgroundAlpha;

// Type the LauncherItem represents.
enum LauncherItemType {
  // Represents a tabbed browser.
  TYPE_TABBED,

  // Represents a running app panel.
  TYPE_APP_PANEL,

  // Represents a pinned shortcut to an app.
  TYPE_APP_SHORTCUT,

  // Toggles visiblity of the app list.
  TYPE_APP_LIST,

  // The browser shortcut button.
  TYPE_BROWSER_SHORTCUT,

  // Represents a platform app.
  TYPE_PLATFORM_APP,
};

// Represents the status of pinned or running app launcher items.
enum LauncherItemStatus {
  // A closed LauncherItem, i.e. has no live instance.
  STATUS_CLOSED,
  // A LauncherItem that has live instance.
  STATUS_RUNNING,
  // An active LauncherItem that has focus.
  STATUS_ACTIVE,
  // A LauncherItem that needs user's attention.
  STATUS_ATTENTION,
};

struct ASH_EXPORT LauncherItem {
  LauncherItem();
  ~LauncherItem();

  LauncherItemType type;

  // Whether it is drawn as an incognito icon or not. Only used if this is
  // TYPE_TABBED. Note: This cannot be used for identifying incognito windows.
  bool is_incognito;

  // Image to display in the launcher. If this item is TYPE_TABBED the image is
  // a favicon image.
  gfx::ImageSkia image;

  // Assigned by the model when the item is added.
  LauncherID id;

  // Running status.
  LauncherItemStatus status;
};

typedef std::vector<LauncherItem> LauncherItems;

// The direction of the focus cycling.
enum CycleDirection {
  CYCLE_FORWARD,
  CYCLE_BACKWARD
};

}  // namespace ash

#endif  // ASH_LAUNCHER_LAUNCHER_TYPES_H_