OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/status/status_area_view.h" | 5 #include "chrome/browser/chromeos/status/status_area_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "chrome/browser/chromeos/status/clock_menu_button.h" | 9 #include "chrome/browser/chromeos/status/clock_menu_button.h" |
10 #include "chrome/browser/chromeos/status/feedback_menu_button.h" | |
11 #include "chrome/browser/chromeos/status/language_menu_button.h" | 10 #include "chrome/browser/chromeos/status/language_menu_button.h" |
12 #include "chrome/browser/chromeos/status/network_menu_button.h" | 11 #include "chrome/browser/chromeos/status/network_menu_button.h" |
13 #include "chrome/browser/chromeos/status/power_menu_button.h" | 12 #include "chrome/browser/chromeos/status/power_menu_button.h" |
14 #include "chrome/browser/chromeos/status/status_area_host.h" | 13 #include "chrome/browser/chromeos/status/status_area_host.h" |
15 #include "gfx/canvas.h" | 14 #include "gfx/canvas.h" |
16 | 15 |
17 namespace chromeos { | 16 namespace chromeos { |
18 | 17 |
19 // Number of pixels to separate each icon. | 18 // Number of pixels to separate each icon. |
20 const int kSeparation = 6; | 19 const int kSeparation = 6; |
21 | 20 |
22 // BrowserWindowGtk tiles its image with this offset | 21 // BrowserWindowGtk tiles its image with this offset |
23 const int kCustomFrameBackgroundVerticalOffset = 15; | 22 const int kCustomFrameBackgroundVerticalOffset = 15; |
24 | 23 |
25 // Default to opening new tabs on the left. | 24 // Default to opening new tabs on the left. |
26 StatusAreaView::OpenTabsMode StatusAreaView::open_tabs_mode_ = | 25 StatusAreaView::OpenTabsMode StatusAreaView::open_tabs_mode_ = |
27 StatusAreaView::OPEN_TABS_ON_LEFT; | 26 StatusAreaView::OPEN_TABS_ON_LEFT; |
28 | 27 |
29 StatusAreaView::StatusAreaView(StatusAreaHost* host) | 28 StatusAreaView::StatusAreaView(StatusAreaHost* host) |
30 : host_(host), | 29 : host_(host), |
31 clock_view_(NULL), | 30 clock_view_(NULL), |
32 feedback_view_(NULL), | |
33 language_view_(NULL), | 31 language_view_(NULL), |
34 network_view_(NULL), | 32 network_view_(NULL), |
35 power_view_(NULL) { | 33 power_view_(NULL) { |
36 } | 34 } |
37 | 35 |
38 void StatusAreaView::Init() { | 36 void StatusAreaView::Init() { |
39 // Language. | 37 // Language. |
40 language_view_ = new LanguageMenuButton(host_); | 38 language_view_ = new LanguageMenuButton(host_); |
41 AddChildView(language_view_); | 39 AddChildView(language_view_); |
42 | 40 |
43 // Feedback. | |
44 feedback_view_ = new FeedbackMenuButton(host_); | |
45 AddChildView(feedback_view_); | |
46 | |
47 // Network. | 41 // Network. |
48 network_view_ = new NetworkMenuButton(host_); | 42 network_view_ = new NetworkMenuButton(host_); |
49 AddChildView(network_view_); | 43 AddChildView(network_view_); |
50 | 44 |
51 // Power. | 45 // Power. |
52 power_view_ = new PowerMenuButton(); | 46 power_view_ = new PowerMenuButton(); |
53 AddChildView(power_view_); | 47 AddChildView(power_view_); |
54 | 48 |
55 // Clock. | 49 // Clock. |
56 clock_view_ = new ClockMenuButton(host_); | 50 clock_view_ = new ClockMenuButton(host_); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 StatusAreaView::OpenTabsMode StatusAreaView::GetOpenTabsMode() { | 105 StatusAreaView::OpenTabsMode StatusAreaView::GetOpenTabsMode() { |
112 return open_tabs_mode_; | 106 return open_tabs_mode_; |
113 } | 107 } |
114 | 108 |
115 // static | 109 // static |
116 void StatusAreaView::SetOpenTabsMode(OpenTabsMode mode) { | 110 void StatusAreaView::SetOpenTabsMode(OpenTabsMode mode) { |
117 open_tabs_mode_ = mode; | 111 open_tabs_mode_ = mode; |
118 } | 112 } |
119 | 113 |
120 } // namespace chromeos | 114 } // namespace chromeos |
OLD | NEW |