blob: 7bc36993692e54bceab4bb5ace4934203fc968c3 (
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
|
// Copyright (c) 2010 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 CHROME_BROWSER_CHROMEOS_WM_OVERVIEW_SNAPSHOT_H_
#define CHROME_BROWSER_CHROMEOS_WM_OVERVIEW_SNAPSHOT_H_
#include "third_party/skia/include/core/SkBitmap.h"
#include "views/view.h"
#include "views/widget/widget_gtk.h"
#include "views/controls/image_view.h"
class Browser;
namespace chromeos {
// A single snapshot displayed by WmOverviewController.
// WmOverviewSnapshot contains a label, favicon and snapshot.
class WmOverviewSnapshot : public views::WidgetGtk {
public:
WmOverviewSnapshot();
void Init(const gfx::Size& size, Browser* browser, int index);
void SetImage(const SkBitmap& image);
void UpdateIndex(Browser* browser, int index);
int index() const { return index_; }
// Returns the size of the snapshot widget.
gfx::Size size() const {
gfx::Rect rect;
GetBounds(&rect, false);
return rect.size();
}
// Has the snapshot been configured? This is true after SetSnapshot
// is invoked.
bool configured_snapshot() const { return configured_snapshot_; }
// This resets the configured_snapshot flag for this snapshot so it will
// get reloaded the next time we check.
void reload_snapshot() { configured_snapshot_ = false; }
private:
// This control is the contents view for this widget.
views::ImageView* snapshot_view_;
// This is the tab index of the snapshot in the associated browser.
int index_;
// This indicates whether or not the snapshot has been configured.
bool configured_snapshot_;
DISALLOW_COPY_AND_ASSIGN(WmOverviewSnapshot);
};
} // namespace chromeos
#endif // CHROME_BROWSER_CHROMEOS_WM_OVERVIEW_SNAPSHOT_H_
|