OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "athena/system/status_icon_container_view.h" | 5 #include "athena/system/status_icon_container_view.h" |
6 | 6 |
7 #include "athena/resources/athena_resources.h" | 7 #include "athena/resources/athena_resources.h" |
8 #include "athena/system/network_selector.h" | 8 #include "athena/system/network_selector.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 } | 201 } |
202 | 202 |
203 private: | 203 private: |
204 SystemUI::ColorScheme color_scheme_; | 204 SystemUI::ColorScheme color_scheme_; |
205 views::ImageView* icon_; | 205 views::ImageView* icon_; |
206 | 206 |
207 DISALLOW_COPY_AND_ASSIGN(UpdateStatus); | 207 DISALLOW_COPY_AND_ASSIGN(UpdateStatus); |
208 }; | 208 }; |
209 | 209 |
210 StatusIconContainerView::StatusIconContainerView( | 210 StatusIconContainerView::StatusIconContainerView( |
211 SystemUI::ColorScheme color_scheme, | 211 SystemUI::ColorScheme color_scheme) { |
212 aura::Window* system_modal_container) | |
213 : system_modal_container_(system_modal_container) { | |
214 const int kHorizontalSpacing = 10; | 212 const int kHorizontalSpacing = 10; |
215 const int kVerticalSpacing = 3; | 213 const int kVerticalSpacing = 3; |
216 const int kBetweenChildSpacing = 10; | 214 const int kBetweenChildSpacing = 10; |
217 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, | 215 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, |
218 kHorizontalSpacing, | 216 kHorizontalSpacing, |
219 kVerticalSpacing, | 217 kVerticalSpacing, |
220 kBetweenChildSpacing)); | 218 kBetweenChildSpacing)); |
221 | 219 |
222 std::string version_text = | 220 std::string version_text = |
223 base::StringPrintf("%s (Build %s)", PRODUCT_VERSION, LAST_CHANGE); | 221 base::StringPrintf("%s (Build %s)", PRODUCT_VERSION, LAST_CHANGE); |
(...skipping 10 matching lines...) Expand all Loading... |
234 | 232 |
235 views::ImageView* update_view = new views::ImageView(); | 233 views::ImageView* update_view = new views::ImageView(); |
236 AddChildView(update_view); | 234 AddChildView(update_view); |
237 update_status_.reset(new UpdateStatus(color_scheme, update_view)); | 235 update_status_.reset(new UpdateStatus(color_scheme, update_view)); |
238 } | 236 } |
239 | 237 |
240 StatusIconContainerView::~StatusIconContainerView() { | 238 StatusIconContainerView::~StatusIconContainerView() { |
241 } | 239 } |
242 | 240 |
243 bool StatusIconContainerView::OnMousePressed(const ui::MouseEvent& event) { | 241 bool StatusIconContainerView::OnMousePressed(const ui::MouseEvent& event) { |
244 CreateNetworkSelector(system_modal_container_); | 242 CreateNetworkSelector(); |
245 return true; | 243 return true; |
246 } | 244 } |
247 | 245 |
248 void StatusIconContainerView::OnGestureEvent(ui::GestureEvent* event) { | 246 void StatusIconContainerView::OnGestureEvent(ui::GestureEvent* event) { |
249 if (event->type() == ui::ET_GESTURE_TAP) { | 247 if (event->type() == ui::ET_GESTURE_TAP) { |
250 CreateNetworkSelector(system_modal_container_); | 248 CreateNetworkSelector(); |
251 event->SetHandled(); | 249 event->SetHandled(); |
252 } | 250 } |
253 } | 251 } |
254 | 252 |
255 void StatusIconContainerView::ChildPreferredSizeChanged(views::View* child) { | 253 void StatusIconContainerView::ChildPreferredSizeChanged(views::View* child) { |
256 PreferredSizeChanged(); | 254 PreferredSizeChanged(); |
257 } | 255 } |
258 | 256 |
259 } // namespace athena | 257 } // namespace athena |
OLD | NEW |