OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Note: this file is used by Aura on all platforms, even though it is currently | 5 // Note: this file is used by Aura on all platforms, even though it is currently |
6 // in a chromeos specific location. | 6 // in a chromeos specific location. |
7 | 7 |
8 #include "chrome/browser/chromeos/status/clock_menu_button.h" | 8 #include "chrome/browser/chromeos/status/clock_menu_button.h" |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 // Activation gets updated when we change login state, so profile may change. | 153 // Activation gets updated when we change login state, so profile may change. |
154 if (active) | 154 if (active) |
155 UpdateProfile(); | 155 UpdateProfile(); |
156 StatusAreaButton::SetMenuActive(active); | 156 StatusAreaButton::SetMenuActive(active); |
157 } | 157 } |
158 | 158 |
159 int ClockMenuButton::horizontal_padding() { | 159 int ClockMenuButton::horizontal_padding() { |
160 return 3; | 160 return 3; |
161 } | 161 } |
162 | 162 |
163 // ClockMenuButton, views::MenuButtonDelegate implementation: | 163 // ClockMenuButton, views::MenuButtonListener implementation: |
164 | 164 |
165 void ClockMenuButton::RunMenu(views::View* source, const gfx::Point& pt) { | 165 void ClockMenuButton::OnMenuButtonClicked(views::View* source, |
| 166 const gfx::Point& point) { |
166 // View passed in must be a views::MenuButton, i.e. the ClockMenuButton. | 167 // View passed in must be a views::MenuButton, i.e. the ClockMenuButton. |
167 DCHECK_EQ(source, this); | 168 DCHECK_EQ(source, this); |
168 | 169 |
169 scoped_ptr<views::MenuRunner> menu_runner(CreateMenu()); | 170 scoped_ptr<views::MenuRunner> menu_runner(CreateMenu()); |
170 | 171 |
171 gfx::Point screen_location; | 172 gfx::Point screen_location; |
172 views::View::ConvertPointToScreen(source, &screen_location); | 173 views::View::ConvertPointToScreen(source, &screen_location); |
173 gfx::Rect bounds(screen_location, source->size()); | 174 gfx::Rect bounds(screen_location, source->size()); |
174 ignore_result(menu_runner->RunMenuAt( | 175 ignore_result(menu_runner->RunMenuAt( |
175 source->GetWidget()->GetTopLevelWidget(), | 176 source->GetWidget()->GetTopLevelWidget(), |
(...skipping 22 matching lines...) Expand all Loading... |
198 this, StatusAreaButton::Delegate::SHOW_ADVANCED_OPTIONS)) { | 199 this, StatusAreaButton::Delegate::SHOW_ADVANCED_OPTIONS)) { |
199 menu->AppendSeparator(); | 200 menu->AppendSeparator(); |
200 | 201 |
201 const string16 clock_open_options_label = | 202 const string16 clock_open_options_label = |
202 l10n_util::GetStringUTF16(IDS_STATUSBAR_CLOCK_OPEN_OPTIONS_DIALOG); | 203 l10n_util::GetStringUTF16(IDS_STATUSBAR_CLOCK_OPEN_OPTIONS_DIALOG); |
203 menu->AppendMenuItemWithLabel(CLOCK_OPEN_OPTIONS_ITEM, | 204 menu->AppendMenuItemWithLabel(CLOCK_OPEN_OPTIONS_ITEM, |
204 clock_open_options_label); | 205 clock_open_options_label); |
205 } | 206 } |
206 return menu_runner; | 207 return menu_runner; |
207 } | 208 } |
OLD | NEW |