blob: 04b7b8c04f32730e1c47e89b8c09d501fe3b59e0 (
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
89
90
91
92
93
|
// 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.
#include "ash/system/settings/tray_settings.h"
#include "ash/shell.h"
#include "ash/system/tray/system_tray_delegate.h"
#include "ash/system/tray/tray_constants.h"
#include "ash/system/tray/tray_views.h"
#include "base/logging.h"
#include "base/utf_string_conversions.h"
#include "grit/ash_strings.h"
#include "grit/ui_resources.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/controls/label.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/view.h"
namespace {
class SettingsView : public views::View {
public:
SettingsView() {
SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal,
ash::kTrayPopupPaddingHorizontal, 0,
ash::kTrayPopupPaddingBetweenItems));
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
views::ImageView* icon =
new ash::internal::FixedSizedImageView(0, ash::kTrayPopupItemHeight);
icon->SetImage(rb.GetImageNamed(IDR_AURA_UBER_TRAY_SETTINGS).ToSkBitmap());
AddChildView(icon);
label_ = new views::Label(rb.GetLocalizedString(
IDS_ASH_STATUS_TRAY_SETTINGS_AND_HELP));
AddChildView(label_);
}
virtual ~SettingsView() {}
// Overridden from views::View.
virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE {
ash::Shell::GetInstance()->tray_delegate()->ShowSettings();
return true;
}
private:
views::Label* label_;
DISALLOW_COPY_AND_ASSIGN(SettingsView);
};
} // namespace
namespace ash {
namespace internal {
TraySettings::TraySettings() {}
TraySettings::~TraySettings() {}
views::View* TraySettings::CreateTrayView(user::LoginStatus status) {
return NULL;
}
views::View* TraySettings::CreateDefaultView(user::LoginStatus status) {
if (status == user::LOGGED_IN_NONE)
return NULL;
return new SettingsView;
}
views::View* TraySettings::CreateDetailedView(user::LoginStatus status) {
NOTIMPLEMENTED();
return NULL;
}
void TraySettings::DestroyTrayView() {
}
void TraySettings::DestroyDefaultView() {
}
void TraySettings::DestroyDetailedView() {
}
} // namespace internal
} // namespace ash
|