| 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_ = content::HostZoomMap::GetForBrowserContext( |
| 500 menu->browser_->profile())->AddZoomLevelChangedCallback( | 500 menu->browser_->profile())->AddZoomLevelChangedCallback( |
| 501 base::Bind(&WrenchMenu::ZoomView::OnZoomLevelChanged, | 501 base::Bind(&WrenchMenu::ZoomView::OnZoomLevelChanged, |
| 502 base::Unretained(this))); | 502 base::Unretained(this))); |
| 503 | 503 |
| 504 browser_zoom_subscription_ = ZoomEventManager::GetForBrowserContext( | 504 browser_zoom_subscription_ = ZoomEventManager::GetForBrowserContext( |
| 505 menu->browser_->profile())->AddZoomLevelChangedCallback( | 505 menu->browser_->profile())->AddZoomLevelChangedCallback( |
| 506 base::Bind(&WrenchMenu::ZoomView::OnZoomLevelChanged, | 506 base::Bind(&WrenchMenu::ZoomView::OnZoomLevelChanged, |
| 507 base::Unretained(this))); | 507 base::Unretained(this))); |
| 508 | 508 |
| 509 decrement_button_ = CreateButtonWithAccName( | 509 decrement_button_ = CreateButtonWithAccName( |
| (...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1262 0, | 1262 0, |
| 1263 BookmarkMenuDelegate::SHOW_PERMANENT_FOLDERS, | 1263 BookmarkMenuDelegate::SHOW_PERMANENT_FOLDERS, |
| 1264 BOOKMARK_LAUNCH_LOCATION_WRENCH_MENU); | 1264 BOOKMARK_LAUNCH_LOCATION_WRENCH_MENU); |
| 1265 } | 1265 } |
| 1266 | 1266 |
| 1267 int WrenchMenu::ModelIndexFromCommandId(int command_id) const { | 1267 int WrenchMenu::ModelIndexFromCommandId(int command_id) const { |
| 1268 CommandIDToEntry::const_iterator ix = command_id_to_entry_.find(command_id); | 1268 CommandIDToEntry::const_iterator ix = command_id_to_entry_.find(command_id); |
| 1269 DCHECK(ix != command_id_to_entry_.end()); | 1269 DCHECK(ix != command_id_to_entry_.end()); |
| 1270 return ix->second.second; | 1270 return ix->second.second; |
| 1271 } | 1271 } |
| OLD | NEW |