OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/views/frame/status_area_view.h" | 5 #include "chrome/browser/views/frame/status_area_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "app/gfx/canvas.h" | 9 #include "app/gfx/canvas.h" |
10 #include "app/gfx/font.h" | 10 #include "app/gfx/font.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 ClockView::ClockView() | 61 ClockView::ClockView() |
62 : font_(ResourceBundle::GetSharedInstance().GetFont( | 62 : font_(ResourceBundle::GetSharedInstance().GetFont( |
63 ResourceBundle::BaseFont)) { | 63 ResourceBundle::BaseFont)) { |
64 SetNextTimer(); | 64 SetNextTimer(); |
65 } | 65 } |
66 | 66 |
67 ClockView::~ClockView() { | 67 ClockView::~ClockView() { |
68 } | 68 } |
69 | 69 |
70 gfx::Size ClockView::GetPreferredSize() { | 70 gfx::Size ClockView::GetPreferredSize() { |
71 return gfx::Size(40, 10); | 71 return gfx::Size(40, 17); |
72 } | 72 } |
73 | 73 |
74 void ClockView::Paint(gfx::Canvas* canvas) { | 74 void ClockView::Paint(gfx::Canvas* canvas) { |
75 base::Time now = base::Time::Now(); | 75 base::Time now = base::Time::Now(); |
76 base::Time::Exploded now_exploded; | 76 base::Time::Exploded now_exploded; |
77 now.LocalExplode(&now_exploded); | 77 now.LocalExplode(&now_exploded); |
78 | 78 |
79 std::wstring time_string = StringPrintf(L"%d:%02d", | 79 std::wstring time_string = StringPrintf(L"%d:%02d", |
80 now_exploded.hour, | 80 now_exploded.hour, |
81 now_exploded.minute); | 81 now_exploded.minute); |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 | 301 |
302 void StatusAreaView::ExecuteCommand(int command_id) { | 302 void StatusAreaView::ExecuteCommand(int command_id) { |
303 browser_->ExecuteCommand(command_id); | 303 browser_->ExecuteCommand(command_id); |
304 } | 304 } |
305 | 305 |
306 void StatusAreaView::RunMenu(views::View* source, const gfx::Point& pt, | 306 void StatusAreaView::RunMenu(views::View* source, const gfx::Point& pt, |
307 gfx::NativeView hwnd) { | 307 gfx::NativeView hwnd) { |
308 CreateAppMenu(); | 308 CreateAppMenu(); |
309 app_menu_menu_->RunMenuAt(pt, views::Menu2::ALIGN_TOPRIGHT); | 309 app_menu_menu_->RunMenuAt(pt, views::Menu2::ALIGN_TOPRIGHT); |
310 } | 310 } |
OLD | NEW |