Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: chrome/browser/ui/views/toolbar/wrench_menu.cc

Issue 393133002: Migrate HostZoomMap to live in StoragePartition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test compilation. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 int decrement_index, 488 int decrement_index,
489 int increment_index, 489 int increment_index,
490 int fullscreen_index) 490 int fullscreen_index)
491 : WrenchMenuView(menu, menu_model), 491 : WrenchMenuView(menu, menu_model),
492 fullscreen_index_(fullscreen_index), 492 fullscreen_index_(fullscreen_index),
493 increment_button_(NULL), 493 increment_button_(NULL),
494 zoom_label_(NULL), 494 zoom_label_(NULL),
495 decrement_button_(NULL), 495 decrement_button_(NULL),
496 fullscreen_button_(NULL), 496 fullscreen_button_(NULL),
497 zoom_label_width_(0) { 497 zoom_label_width_(0) {
498 content_zoom_subscription_ = HostZoomMap::GetForBrowserContext( 498 content_zoom_subscription_ =
499 menu->browser_->profile())->AddZoomLevelChangedCallback( 499 content::HostZoomMap::GetDefaultForBrowserContext(
500 base::Bind(&WrenchMenu::ZoomView::OnZoomLevelChanged, 500 menu->browser_->profile())
501 base::Unretained(this))); 501 ->AddZoomLevelChangedCallback(
502 base::Bind(&WrenchMenu::ZoomView::OnZoomLevelChanged,
503 base::Unretained(this)));
502 504
503 browser_zoom_subscription_ = ZoomEventManager::GetForBrowserContext( 505 browser_zoom_subscription_ = ZoomEventManager::GetForBrowserContext(
504 menu->browser_->profile())->AddZoomLevelChangedCallback( 506 menu->browser_->profile())->AddZoomLevelChangedCallback(
505 base::Bind(&WrenchMenu::ZoomView::OnZoomLevelChanged, 507 base::Bind(&WrenchMenu::ZoomView::OnZoomLevelChanged,
506 base::Unretained(this))); 508 base::Unretained(this)));
507 509
508 decrement_button_ = CreateButtonWithAccName( 510 decrement_button_ = CreateButtonWithAccName(
509 IDS_ZOOM_MINUS2, InMenuButtonBackground::LEFT_BUTTON, 511 IDS_ZOOM_MINUS2, InMenuButtonBackground::LEFT_BUTTON,
510 decrement_index, IDS_ACCNAME_ZOOM_MINUS2); 512 decrement_index, IDS_ACCNAME_ZOOM_MINUS2);
511 513
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
1261 0, 1263 0,
1262 BookmarkMenuDelegate::SHOW_PERMANENT_FOLDERS, 1264 BookmarkMenuDelegate::SHOW_PERMANENT_FOLDERS,
1263 BOOKMARK_LAUNCH_LOCATION_WRENCH_MENU); 1265 BOOKMARK_LAUNCH_LOCATION_WRENCH_MENU);
1264 } 1266 }
1265 1267
1266 int WrenchMenu::ModelIndexFromCommandId(int command_id) const { 1268 int WrenchMenu::ModelIndexFromCommandId(int command_id) const {
1267 CommandIDToEntry::const_iterator ix = command_id_to_entry_.find(command_id); 1269 CommandIDToEntry::const_iterator ix = command_id_to_entry_.find(command_id);
1268 DCHECK(ix != command_id_to_entry_.end()); 1270 DCHECK(ix != command_id_to_entry_.end());
1269 return ix->second.second; 1271 return ix->second.second;
1270 } 1272 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698