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 #include "chrome/browser/ui/views/toolbar_view.h" | 5 #include "chrome/browser/ui/views/toolbar_view.h" |
6 | 6 |
7 #include "base/i18n/number_formatting.h" | 7 #include "base/i18n/number_formatting.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 } | 319 } |
320 | 320 |
321 //////////////////////////////////////////////////////////////////////////////// | 321 //////////////////////////////////////////////////////////////////////////////// |
322 // ToolbarView, Menu::Delegate overrides: | 322 // ToolbarView, Menu::Delegate overrides: |
323 | 323 |
324 bool ToolbarView::GetAcceleratorInfo(int id, ui::Accelerator* accel) { | 324 bool ToolbarView::GetAcceleratorInfo(int id, ui::Accelerator* accel) { |
325 return GetWidget()->GetAccelerator(id, accel); | 325 return GetWidget()->GetAccelerator(id, accel); |
326 } | 326 } |
327 | 327 |
328 //////////////////////////////////////////////////////////////////////////////// | 328 //////////////////////////////////////////////////////////////////////////////// |
329 // ToolbarView, views::MenuButtonDelegate implementation: | 329 // ToolbarView, views::MenuButtonListener implementation: |
330 | 330 |
331 void ToolbarView::RunMenu(views::View* source, const gfx::Point& /* pt */) { | 331 void ToolbarView::OnMenuButtonClicked(views::View* source, |
| 332 const gfx::Point& point) { |
332 DCHECK_EQ(VIEW_ID_APP_MENU, source->id()); | 333 DCHECK_EQ(VIEW_ID_APP_MENU, source->id()); |
333 | 334 |
334 wrench_menu_.reset(new WrenchMenu(browser_)); | 335 wrench_menu_.reset(new WrenchMenu(browser_)); |
335 WrenchMenuModel model(this, browser_); | 336 WrenchMenuModel model(this, browser_); |
336 wrench_menu_->Init(&model); | 337 wrench_menu_->Init(&model); |
337 | 338 |
338 FOR_EACH_OBSERVER(views::MenuListener, menu_listeners_, OnMenuOpened()); | 339 FOR_EACH_OBSERVER(views::MenuListener, menu_listeners_, OnMenuOpened()); |
339 | 340 |
340 wrench_menu_->RunMenu(app_menu_); | 341 wrench_menu_->RunMenu(app_menu_); |
341 } | 342 } |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 accname_app = l10n_util::GetStringFUTF16( | 733 accname_app = l10n_util::GetStringFUTF16( |
733 IDS_ACCNAME_APP_UPGRADE_RECOMMENDED, accname_app); | 734 IDS_ACCNAME_APP_UPGRADE_RECOMMENDED, accname_app); |
734 } | 735 } |
735 app_menu_->SetAccessibleName(accname_app); | 736 app_menu_->SetAccessibleName(accname_app); |
736 | 737 |
737 app_menu_->SetIcon(GetAppMenuIcon(views::CustomButton::BS_NORMAL)); | 738 app_menu_->SetIcon(GetAppMenuIcon(views::CustomButton::BS_NORMAL)); |
738 app_menu_->SetHoverIcon(GetAppMenuIcon(views::CustomButton::BS_HOT)); | 739 app_menu_->SetHoverIcon(GetAppMenuIcon(views::CustomButton::BS_HOT)); |
739 app_menu_->SetPushedIcon(GetAppMenuIcon(views::CustomButton::BS_PUSHED)); | 740 app_menu_->SetPushedIcon(GetAppMenuIcon(views::CustomButton::BS_PUSHED)); |
740 SchedulePaint(); | 741 SchedulePaint(); |
741 } | 742 } |
OLD | NEW |