OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/toolbar/wrench_menu_model.h" | 5 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 : ALLOW_THIS_IN_INITIALIZER_LIST(ui::SimpleMenuModel(this)), | 223 : ALLOW_THIS_IN_INITIALIZER_LIST(ui::SimpleMenuModel(this)), |
224 provider_(provider), | 224 provider_(provider), |
225 browser_(browser), | 225 browser_(browser), |
226 tabstrip_model_(browser_->tabstrip_model()) { | 226 tabstrip_model_(browser_->tabstrip_model()) { |
227 Build(); | 227 Build(); |
228 UpdateZoomControls(); | 228 UpdateZoomControls(); |
229 | 229 |
230 tabstrip_model_->AddObserver(this); | 230 tabstrip_model_->AddObserver(this); |
231 | 231 |
232 registrar_.Add(this, NotificationType::ZOOM_LEVEL_CHANGED, | 232 registrar_.Add(this, NotificationType::ZOOM_LEVEL_CHANGED, |
233 Source<Profile>(browser_->profile())); | 233 Source<HostZoomMap>(browser_->profile()->GetHostZoomMap())); |
234 registrar_.Add(this, NotificationType::NAV_ENTRY_COMMITTED, | 234 registrar_.Add(this, NotificationType::NAV_ENTRY_COMMITTED, |
235 NotificationService::AllSources()); | 235 NotificationService::AllSources()); |
236 } | 236 } |
237 | 237 |
238 WrenchMenuModel::~WrenchMenuModel() { | 238 WrenchMenuModel::~WrenchMenuModel() { |
239 if (tabstrip_model_) | 239 if (tabstrip_model_) |
240 tabstrip_model_->RemoveObserver(this); | 240 tabstrip_model_->RemoveObserver(this); |
241 } | 241 } |
242 | 242 |
243 bool WrenchMenuModel::DoesCommandIdDismissMenu(int command_id) const { | 243 bool WrenchMenuModel::DoesCommandIdDismissMenu(int command_id) const { |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 &enable_increment, &enable_decrement); | 558 &enable_increment, &enable_decrement); |
559 } | 559 } |
560 zoom_label_ = l10n_util::GetStringFUTF16( | 560 zoom_label_ = l10n_util::GetStringFUTF16( |
561 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); | 561 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); |
562 } | 562 } |
563 | 563 |
564 string16 WrenchMenuModel::GetSyncMenuLabel() const { | 564 string16 WrenchMenuModel::GetSyncMenuLabel() const { |
565 return sync_ui_util::GetSyncMenuLabel( | 565 return sync_ui_util::GetSyncMenuLabel( |
566 browser_->profile()->GetOriginalProfile()->GetProfileSyncService()); | 566 browser_->profile()->GetOriginalProfile()->GetProfileSyncService()); |
567 } | 567 } |
OLD | NEW |