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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
346 | 346 |
347 bool ToolbarView::GetAcceleratorInfo(int id, ui::Accelerator* accel) { | 347 bool ToolbarView::GetAcceleratorInfo(int id, ui::Accelerator* accel) { |
348 return GetWidget()->GetAccelerator(id, accel); | 348 return GetWidget()->GetAccelerator(id, accel); |
349 } | 349 } |
350 | 350 |
351 //////////////////////////////////////////////////////////////////////////////// | 351 //////////////////////////////////////////////////////////////////////////////// |
352 // ToolbarView, views::MenuButtonListener implementation: | 352 // ToolbarView, views::MenuButtonListener implementation: |
353 | 353 |
354 void ToolbarView::OnMenuButtonClicked(views::View* source, | 354 void ToolbarView::OnMenuButtonClicked(views::View* source, |
355 const gfx::Point& point) { | 355 const gfx::Point& point) { |
356 DCHECK_EQ(VIEW_ID_APP_MENU, source->id()); | 356 DCHECK_EQ(source->id(), VIEW_ID_APP_MENU); |
Peter Kasting
2012/04/16 18:16:25
The old code here was correct.
| |
357 | 357 |
358 wrench_menu_.reset(new WrenchMenu(browser_)); | 358 wrench_menu_.reset(new WrenchMenu(browser_)); |
359 WrenchMenuModel model(this, browser_); | 359 WrenchMenuModel model(this, browser_); |
360 wrench_menu_->Init(&model); | 360 wrench_menu_->Init(&model); |
361 | 361 |
362 FOR_EACH_OBSERVER(views::MenuListener, menu_listeners_, OnMenuOpened()); | 362 FOR_EACH_OBSERVER(views::MenuListener, menu_listeners_, OnMenuOpened()); |
363 | 363 |
364 wrench_menu_->RunMenu(app_menu_); | 364 wrench_menu_->RunMenu(app_menu_); |
365 } | 365 } |
366 | 366 |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
775 accname_app = l10n_util::GetStringFUTF16( | 775 accname_app = l10n_util::GetStringFUTF16( |
776 IDS_ACCNAME_APP_UPGRADE_RECOMMENDED, accname_app); | 776 IDS_ACCNAME_APP_UPGRADE_RECOMMENDED, accname_app); |
777 } | 777 } |
778 app_menu_->SetAccessibleName(accname_app); | 778 app_menu_->SetAccessibleName(accname_app); |
779 | 779 |
780 app_menu_->SetIcon(GetAppMenuIcon(views::CustomButton::BS_NORMAL)); | 780 app_menu_->SetIcon(GetAppMenuIcon(views::CustomButton::BS_NORMAL)); |
781 app_menu_->SetHoverIcon(GetAppMenuIcon(views::CustomButton::BS_HOT)); | 781 app_menu_->SetHoverIcon(GetAppMenuIcon(views::CustomButton::BS_HOT)); |
782 app_menu_->SetPushedIcon(GetAppMenuIcon(views::CustomButton::BS_PUSHED)); | 782 app_menu_->SetPushedIcon(GetAppMenuIcon(views::CustomButton::BS_PUSHED)); |
783 SchedulePaint(); | 783 SchedulePaint(); |
784 } | 784 } |
OLD | NEW |