OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/wrench_menu.h" | 5 #include "chrome/browser/ui/views/toolbar/wrench_menu.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 int decrement_index, | 489 int decrement_index, |
490 int increment_index, | 490 int increment_index, |
491 int fullscreen_index) | 491 int fullscreen_index) |
492 : WrenchMenuView(menu, menu_model), | 492 : WrenchMenuView(menu, menu_model), |
493 fullscreen_index_(fullscreen_index), | 493 fullscreen_index_(fullscreen_index), |
494 increment_button_(NULL), | 494 increment_button_(NULL), |
495 zoom_label_(NULL), | 495 zoom_label_(NULL), |
496 decrement_button_(NULL), | 496 decrement_button_(NULL), |
497 fullscreen_button_(NULL), | 497 fullscreen_button_(NULL), |
498 zoom_label_width_(0) { | 498 zoom_label_width_(0) { |
499 content_zoom_subscription_ = HostZoomMap::GetForBrowserContext( | 499 content_zoom_subscription_ = |
500 menu->browser_->profile())->AddZoomLevelChangedCallback( | 500 content::HostZoomMap::GetDefaultForBrowserContext( |
501 base::Bind(&WrenchMenu::ZoomView::OnZoomLevelChanged, | 501 menu->browser_->profile()) |
502 base::Unretained(this))); | 502 ->AddZoomLevelChangedCallback( |
| 503 base::Bind(&WrenchMenu::ZoomView::OnZoomLevelChanged, |
| 504 base::Unretained(this))); |
503 | 505 |
504 browser_zoom_subscription_ = ZoomEventManager::GetForBrowserContext( | 506 browser_zoom_subscription_ = ZoomEventManager::GetForBrowserContext( |
505 menu->browser_->profile())->AddZoomLevelChangedCallback( | 507 menu->browser_->profile())->AddZoomLevelChangedCallback( |
506 base::Bind(&WrenchMenu::ZoomView::OnZoomLevelChanged, | 508 base::Bind(&WrenchMenu::ZoomView::OnZoomLevelChanged, |
507 base::Unretained(this))); | 509 base::Unretained(this))); |
508 | 510 |
509 decrement_button_ = CreateButtonWithAccName( | 511 decrement_button_ = CreateButtonWithAccName( |
510 IDS_ZOOM_MINUS2, InMenuButtonBackground::LEFT_BUTTON, | 512 IDS_ZOOM_MINUS2, InMenuButtonBackground::LEFT_BUTTON, |
511 decrement_index, IDS_ACCNAME_ZOOM_MINUS2); | 513 decrement_index, IDS_ACCNAME_ZOOM_MINUS2); |
512 | 514 |
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1262 0, | 1264 0, |
1263 BookmarkMenuDelegate::SHOW_PERMANENT_FOLDERS, | 1265 BookmarkMenuDelegate::SHOW_PERMANENT_FOLDERS, |
1264 BOOKMARK_LAUNCH_LOCATION_WRENCH_MENU); | 1266 BOOKMARK_LAUNCH_LOCATION_WRENCH_MENU); |
1265 } | 1267 } |
1266 | 1268 |
1267 int WrenchMenu::ModelIndexFromCommandId(int command_id) const { | 1269 int WrenchMenu::ModelIndexFromCommandId(int command_id) const { |
1268 CommandIDToEntry::const_iterator ix = command_id_to_entry_.find(command_id); | 1270 CommandIDToEntry::const_iterator ix = command_id_to_entry_.find(command_id); |
1269 DCHECK(ix != command_id_to_entry_.end()); | 1271 DCHECK(ix != command_id_to_entry_.end()); |
1270 return ix->second.second; | 1272 return ix->second.second; |
1271 } | 1273 } |
OLD | NEW |