OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/wrench_menu_model.h" | 5 #include "chrome/browser/wrench_menu_model.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 | 286 |
287 return true; | 287 return true; |
288 } | 288 } |
289 | 289 |
290 bool WrenchMenuModel::GetAcceleratorForCommandId( | 290 bool WrenchMenuModel::GetAcceleratorForCommandId( |
291 int command_id, | 291 int command_id, |
292 menus::Accelerator* accelerator) { | 292 menus::Accelerator* accelerator) { |
293 return provider_->GetAcceleratorForCommandId(command_id, accelerator); | 293 return provider_->GetAcceleratorForCommandId(command_id, accelerator); |
294 } | 294 } |
295 | 295 |
296 void WrenchMenuModel::TabSelectedAt(TabContents* old_contents, | 296 void WrenchMenuModel::TabSelectedAt(TabContentsWrapper* old_contents, |
297 TabContents* new_contents, | 297 TabContentsWrapper* new_contents, |
298 int index, | 298 int index, |
299 bool user_gesture) { | 299 bool user_gesture) { |
300 // The user has switched between tabs and the new tab may have a different | 300 // The user has switched between tabs and the new tab may have a different |
301 // zoom setting. | 301 // zoom setting. |
302 UpdateZoomControls(); | 302 UpdateZoomControls(); |
303 } | 303 } |
304 | 304 |
305 void WrenchMenuModel::TabReplacedAt(TabContents* old_contents, | 305 void WrenchMenuModel::TabReplacedAt(TabContentsWrapper* old_contents, |
306 TabContents* new_contents, int index) { | 306 TabContentsWrapper* new_contents, |
| 307 int index) { |
307 UpdateZoomControls(); | 308 UpdateZoomControls(); |
308 } | 309 } |
309 | 310 |
310 void WrenchMenuModel::TabStripModelDeleted() { | 311 void WrenchMenuModel::TabStripModelDeleted() { |
311 // During views shutdown, the tabstrip model/browser is deleted first, while | 312 // During views shutdown, the tabstrip model/browser is deleted first, while |
312 // it is the opposite in gtk land. | 313 // it is the opposite in gtk land. |
313 tabstrip_model_->RemoveObserver(this); | 314 tabstrip_model_->RemoveObserver(this); |
314 tabstrip_model_ = NULL; | 315 tabstrip_model_ = NULL; |
315 } | 316 } |
316 | 317 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 &enable_increment, &enable_decrement); | 472 &enable_increment, &enable_decrement); |
472 } | 473 } |
473 zoom_label_ = l10n_util::GetStringFUTF16( | 474 zoom_label_ = l10n_util::GetStringFUTF16( |
474 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); | 475 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); |
475 } | 476 } |
476 | 477 |
477 string16 WrenchMenuModel::GetSyncMenuLabel() const { | 478 string16 WrenchMenuModel::GetSyncMenuLabel() const { |
478 return sync_ui_util::GetSyncMenuLabel( | 479 return sync_ui_util::GetSyncMenuLabel( |
479 browser_->profile()->GetOriginalProfile()->GetProfileSyncService()); | 480 browser_->profile()->GetOriginalProfile()->GetProfileSyncService()); |
480 } | 481 } |
OLD | NEW |