| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
| 12 #include "chrome/browser/chromeos/view_ids.h" |
| 12 #include "ui/gfx/canvas.h" | 13 #include "ui/gfx/canvas.h" |
| 13 #include "views/border.h" | 14 #include "views/border.h" |
| 14 | 15 |
| 15 // Number of pixels to separate each icon. | 16 // Number of pixels to separate each icon. |
| 16 #if defined(TOUCH_UI) | 17 #if defined(TOUCH_UI) |
| 17 const int kSeparation = 25; | 18 const int kSeparation = 25; |
| 18 #else | 19 #else |
| 19 const int kSeparation = 0; | 20 const int kSeparation = 0; |
| 20 #endif | 21 #endif |
| 21 | 22 |
| 22 StatusAreaView::StatusAreaView() | 23 StatusAreaView::StatusAreaView() |
| 23 : need_return_focus_(false) { | 24 : need_return_focus_(false) { |
| 25 set_id(VIEW_ID_STATUS_AREA); |
| 24 } | 26 } |
| 25 | 27 |
| 26 StatusAreaView::~StatusAreaView() { | 28 StatusAreaView::~StatusAreaView() { |
| 27 } | 29 } |
| 28 | 30 |
| 29 void StatusAreaView::AddButton(StatusAreaButton* button, bool bordered) { | 31 void StatusAreaView::AddButton(StatusAreaButton* button, bool bordered) { |
| 30 buttons_.push_back(button); | 32 buttons_.push_back(button); |
| 31 if (bordered) | 33 if (bordered) |
| 32 button->set_border(views::Border::CreateEmptyBorder(0, 1, 0, 0)); | 34 button->set_border(views::Border::CreateEmptyBorder(0, 1, 0, 0)); |
| 33 AddChildView(button); | 35 AddChildView(button); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 if (need_return_focus_) { | 137 if (need_return_focus_) { |
| 136 const views::View* first = GetFirstFocusableChild(); | 138 const views::View* first = GetFirstFocusableChild(); |
| 137 const views::View* last = GetLastFocusableChild(); | 139 const views::View* last = GetLastFocusableChild(); |
| 138 const bool first_to_last = (focused_before == first && focused_now == last); | 140 const bool first_to_last = (focused_before == first && focused_now == last); |
| 139 const bool last_to_first = (focused_now == first && focused_before == last); | 141 const bool last_to_first = (focused_now == first && focused_before == last); |
| 140 | 142 |
| 141 if (first_to_last || last_to_first) | 143 if (first_to_last || last_to_first) |
| 142 ReturnFocus(first_to_last); | 144 ReturnFocus(first_to_last); |
| 143 } | 145 } |
| 144 } | 146 } |
| OLD | NEW |