| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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" |
| 11 #include "base/metrics/histogram.h" |
| 11 #include "base/prefs/pref_service.h" | 12 #include "base/prefs/pref_service.h" |
| 12 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
| 13 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
| 15 #include "chrome/app/chrome_command_ids.h" | 16 #include "chrome/app/chrome_command_ids.h" |
| 16 #include "chrome/browser/browser_process.h" | 17 #include "chrome/browser/browser_process.h" |
| 17 #include "chrome/browser/defaults.h" | 18 #include "chrome/browser/defaults.h" |
| 18 #include "chrome/browser/extensions/extension_toolbar_model.h" | 19 #include "chrome/browser/extensions/extension_toolbar_model.h" |
| 19 #include "chrome/browser/extensions/extension_util.h" | 20 #include "chrome/browser/extensions/extension_util.h" |
| 20 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 21 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 AddCheckItemWithStringId(IDC_PROFILING_ENABLED, IDS_PROFILING_ENABLED); | 271 AddCheckItemWithStringId(IDC_PROFILING_ENABLED, IDS_PROFILING_ENABLED); |
| 271 #endif | 272 #endif |
| 272 } | 273 } |
| 273 | 274 |
| 274 //////////////////////////////////////////////////////////////////////////////// | 275 //////////////////////////////////////////////////////////////////////////////// |
| 275 // WrenchMenuModel | 276 // WrenchMenuModel |
| 276 | 277 |
| 277 WrenchMenuModel::WrenchMenuModel(ui::AcceleratorProvider* provider, | 278 WrenchMenuModel::WrenchMenuModel(ui::AcceleratorProvider* provider, |
| 278 Browser* browser) | 279 Browser* browser) |
| 279 : ui::SimpleMenuModel(this), | 280 : ui::SimpleMenuModel(this), |
| 281 uma_action_recorded_(false), |
| 280 provider_(provider), | 282 provider_(provider), |
| 281 browser_(browser), | 283 browser_(browser), |
| 282 tab_strip_model_(browser_->tab_strip_model()) { | 284 tab_strip_model_(browser_->tab_strip_model()) { |
| 283 Build(); | 285 Build(); |
| 284 UpdateZoomControls(); | 286 UpdateZoomControls(); |
| 285 | 287 |
| 286 // By asking for the HostZoomMap via the BrowserContext, we get the map | 288 // By asking for the HostZoomMap via the BrowserContext, we get the map |
| 287 // associated with the default storage partition, and not the one related | 289 // associated with the default storage partition, and not the one related |
| 288 // to any specialized storage partitions, e.g. those used by WebViewGuests. | 290 // to any specialized storage partitions, e.g. those used by WebViewGuests. |
| 289 content_zoom_subscription_ = | 291 content_zoom_subscription_ = |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 if (!switches::IsNewAvatarMenu() && command_id == IDC_SHOW_SIGNIN) { | 403 if (!switches::IsNewAvatarMenu() && command_id == IDC_SHOW_SIGNIN) { |
| 402 // If a custom error message is being shown, handle it. | 404 // If a custom error message is being shown, handle it. |
| 403 GlobalError* error = signin_ui_util::GetSignedInServiceError( | 405 GlobalError* error = signin_ui_util::GetSignedInServiceError( |
| 404 browser_->profile()->GetOriginalProfile()); | 406 browser_->profile()->GetOriginalProfile()); |
| 405 if (error) { | 407 if (error) { |
| 406 error->ExecuteMenuItem(browser_); | 408 error->ExecuteMenuItem(browser_); |
| 407 return; | 409 return; |
| 408 } | 410 } |
| 409 } | 411 } |
| 410 | 412 |
| 411 if (command_id == IDC_HELP_PAGE_VIA_MENU) | 413 LogMenuMetrics(command_id); |
| 412 content::RecordAction(UserMetricsAction("ShowHelpTabViaWrenchMenu")); | |
| 413 | |
| 414 if (command_id == IDC_FULLSCREEN) { | |
| 415 // We issue the UMA command here and not in BrowserCommandController or even | |
| 416 // FullscreenController since we want to be able to distinguish this event | |
| 417 // and a menu which is under development. | |
| 418 content::RecordAction(UserMetricsAction("EnterFullScreenWithWrenchMenu")); | |
| 419 } | |
| 420 | |
| 421 chrome::ExecuteCommand(browser_, command_id); | 414 chrome::ExecuteCommand(browser_, command_id); |
| 422 } | 415 } |
| 423 | 416 |
| 417 void WrenchMenuModel::LogMenuMetrics(int command_id) { |
| 418 base::TimeDelta delta = timer_.Elapsed(); |
| 419 |
| 420 switch (command_id) { |
| 421 case IDC_NEW_TAB: |
| 422 if (!uma_action_recorded_) |
| 423 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.NewTab", delta); |
| 424 LogMenuAction(MENU_ACTION_NEW_TAB); |
| 425 break; |
| 426 case IDC_NEW_WINDOW: |
| 427 if (!uma_action_recorded_) |
| 428 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.NewWindow", delta); |
| 429 LogMenuAction(MENU_ACTION_NEW_WINDOW); |
| 430 break; |
| 431 case IDC_NEW_INCOGNITO_WINDOW: |
| 432 if (!uma_action_recorded_) { |
| 433 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.NewIncognitoWindow", |
| 434 delta); |
| 435 } |
| 436 LogMenuAction(MENU_ACTION_NEW_INCOGNITO_WINDOW); |
| 437 break; |
| 438 |
| 439 // Bookmarks sub menu. |
| 440 case IDC_SHOW_BOOKMARK_BAR: |
| 441 if (!uma_action_recorded_) { |
| 442 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.ShowBookmarkBar", |
| 443 delta); |
| 444 } |
| 445 LogMenuAction(MENU_ACTION_SHOW_BOOKMARK_BAR); |
| 446 break; |
| 447 case IDC_SHOW_BOOKMARK_MANAGER: |
| 448 if (!uma_action_recorded_) { |
| 449 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.ShowBookmarkMgr", |
| 450 delta); |
| 451 } |
| 452 LogMenuAction(MENU_ACTION_SHOW_BOOKMARK_MANAGER); |
| 453 break; |
| 454 case IDC_IMPORT_SETTINGS: |
| 455 if (!uma_action_recorded_) { |
| 456 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.ImportSettings", |
| 457 delta); |
| 458 } |
| 459 LogMenuAction(MENU_ACTION_IMPORT_SETTINGS); |
| 460 break; |
| 461 case IDC_BOOKMARK_PAGE: |
| 462 if (!uma_action_recorded_) { |
| 463 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.BookmarkPage", |
| 464 delta); |
| 465 } |
| 466 LogMenuAction(MENU_ACTION_BOOKMARK_PAGE); |
| 467 break; |
| 468 case IDC_BOOKMARK_ALL_TABS: |
| 469 if (!uma_action_recorded_) { |
| 470 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.BookmarkAllTabs", |
| 471 delta); |
| 472 } |
| 473 LogMenuAction(MENU_ACTION_BOOKMARK_ALL_TABS); |
| 474 break; |
| 475 case IDC_PIN_TO_START_SCREEN: |
| 476 if (!uma_action_recorded_) { |
| 477 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.PinToStartScreen", |
| 478 delta); |
| 479 } |
| 480 LogMenuAction(MENU_ACTION_PIN_TO_START_SCREEN); |
| 481 break; |
| 482 |
| 483 // Recent tabs menu. |
| 484 case IDC_RESTORE_TAB: |
| 485 if (!uma_action_recorded_) |
| 486 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.RestoreTab", delta); |
| 487 LogMenuAction(MENU_ACTION_RESTORE_TAB); |
| 488 break; |
| 489 |
| 490 // Windows. |
| 491 case IDC_WIN_DESKTOP_RESTART: |
| 492 if (!uma_action_recorded_) { |
| 493 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.WinDesktopRestart", |
| 494 delta); |
| 495 } |
| 496 LogMenuAction(MENU_ACTION_WIN_DESKTOP_RESTART); |
| 497 break; |
| 498 case IDC_WIN8_METRO_RESTART: |
| 499 if (!uma_action_recorded_) { |
| 500 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.Win8MetroRestart", |
| 501 delta); |
| 502 } |
| 503 LogMenuAction(MENU_ACTION_WIN8_METRO_RESTART); |
| 504 break; |
| 505 |
| 506 case IDC_WIN_CHROMEOS_RESTART: |
| 507 if (!uma_action_recorded_) { |
| 508 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.ChromeOSRestart", |
| 509 delta); |
| 510 } |
| 511 LogMenuAction(MENU_ACTION_WIN_CHROMEOS_RESTART); |
| 512 break; |
| 513 case IDC_DISTILL_PAGE: |
| 514 if (!uma_action_recorded_) { |
| 515 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.DistillPage", |
| 516 delta); |
| 517 } |
| 518 LogMenuAction(MENU_ACTION_DISTILL_PAGE); |
| 519 break; |
| 520 case IDC_SAVE_PAGE: |
| 521 if (!uma_action_recorded_) |
| 522 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.SavePage", delta); |
| 523 LogMenuAction(MENU_ACTION_SAVE_PAGE); |
| 524 break; |
| 525 case IDC_FIND: |
| 526 if (!uma_action_recorded_) |
| 527 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.Find", delta); |
| 528 LogMenuAction(MENU_ACTION_FIND); |
| 529 break; |
| 530 case IDC_PRINT: |
| 531 if (!uma_action_recorded_) |
| 532 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.Print", delta); |
| 533 LogMenuAction(MENU_ACTION_PRINT); |
| 534 break; |
| 535 |
| 536 // Edit menu. |
| 537 case IDC_CUT: |
| 538 if (!uma_action_recorded_) |
| 539 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.Cut", delta); |
| 540 LogMenuAction(MENU_ACTION_CUT); |
| 541 break; |
| 542 case IDC_COPY: |
| 543 if (!uma_action_recorded_) |
| 544 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.Copy", delta); |
| 545 LogMenuAction(MENU_ACTION_COPY); |
| 546 break; |
| 547 case IDC_PASTE: |
| 548 if (!uma_action_recorded_) |
| 549 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.Paste", delta); |
| 550 LogMenuAction(MENU_ACTION_PASTE); |
| 551 break; |
| 552 |
| 553 // Tools menu. |
| 554 case IDC_CREATE_HOSTED_APP: |
| 555 if (!uma_action_recorded_) { |
| 556 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.CreateHostedApp", |
| 557 delta); |
| 558 } |
| 559 LogMenuAction(MENU_ACTION_CREATE_HOSTED_APP); |
| 560 break; |
| 561 case IDC_CREATE_SHORTCUTS: |
| 562 if (!uma_action_recorded_) |
| 563 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.CreateShortcuts", |
| 564 delta); |
| 565 LogMenuAction(MENU_ACTION_CREATE_SHORTCUTS); |
| 566 break; |
| 567 case IDC_MANAGE_EXTENSIONS: |
| 568 if (!uma_action_recorded_) { |
| 569 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.ManageExtensions", |
| 570 delta); |
| 571 } |
| 572 LogMenuAction(MENU_ACTION_MANAGE_EXTENSIONS); |
| 573 break; |
| 574 case IDC_TASK_MANAGER: |
| 575 if (!uma_action_recorded_) { |
| 576 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.TaskManager", |
| 577 delta); |
| 578 } |
| 579 LogMenuAction(MENU_ACTION_TASK_MANAGER); |
| 580 break; |
| 581 case IDC_CLEAR_BROWSING_DATA: |
| 582 if (!uma_action_recorded_) { |
| 583 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.ClearBrowsingData", |
| 584 delta); |
| 585 } |
| 586 LogMenuAction(MENU_ACTION_CLEAR_BROWSING_DATA); |
| 587 break; |
| 588 case IDC_VIEW_SOURCE: |
| 589 if (!uma_action_recorded_) |
| 590 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.ViewSource", delta); |
| 591 LogMenuAction(MENU_ACTION_VIEW_SOURCE); |
| 592 break; |
| 593 case IDC_DEV_TOOLS: |
| 594 if (!uma_action_recorded_) |
| 595 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.DevTools", delta); |
| 596 LogMenuAction(MENU_ACTION_DEV_TOOLS); |
| 597 break; |
| 598 case IDC_DEV_TOOLS_CONSOLE: |
| 599 if (!uma_action_recorded_) { |
| 600 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.DevToolsConsole", |
| 601 delta); |
| 602 } |
| 603 LogMenuAction(MENU_ACTION_DEV_TOOLS_CONSOLE); |
| 604 break; |
| 605 case IDC_DEV_TOOLS_DEVICES: |
| 606 if (!uma_action_recorded_) { |
| 607 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.DevToolsDevices", |
| 608 delta); |
| 609 } |
| 610 LogMenuAction(MENU_ACTION_DEV_TOOLS_DEVICES); |
| 611 break; |
| 612 case IDC_PROFILING_ENABLED: |
| 613 if (!uma_action_recorded_) { |
| 614 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.ProfilingEnabled", |
| 615 delta); |
| 616 } |
| 617 LogMenuAction(MENU_ACTION_PROFILING_ENABLED); |
| 618 break; |
| 619 |
| 620 // Zoom menu |
| 621 case IDC_ZOOM_MINUS: |
| 622 if (!uma_action_recorded_) { |
| 623 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.ZoomMinus", delta); |
| 624 LogMenuAction(MENU_ACTION_ZOOM_MINUS); |
| 625 } |
| 626 break; |
| 627 case IDC_ZOOM_PLUS: |
| 628 if (!uma_action_recorded_) { |
| 629 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.ZoomPlus", delta); |
| 630 LogMenuAction(MENU_ACTION_ZOOM_PLUS); |
| 631 } |
| 632 break; |
| 633 case IDC_FULLSCREEN: |
| 634 content::RecordAction(UserMetricsAction("EnterFullScreenWithWrenchMenu")); |
| 635 |
| 636 if (!uma_action_recorded_) { |
| 637 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.EnterFullScreen", |
| 638 delta); |
| 639 } |
| 640 LogMenuAction(MENU_ACTION_FULLSCREEN); |
| 641 break; |
| 642 |
| 643 case IDC_SHOW_HISTORY: |
| 644 if (!uma_action_recorded_) { |
| 645 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.ShowHistory", |
| 646 delta); |
| 647 } |
| 648 LogMenuAction(MENU_ACTION_SHOW_HISTORY); |
| 649 break; |
| 650 case IDC_SHOW_DOWNLOADS: |
| 651 if (!uma_action_recorded_) { |
| 652 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.ShowDownloads", |
| 653 delta); |
| 654 } |
| 655 LogMenuAction(MENU_ACTION_SHOW_DOWNLOADS); |
| 656 break; |
| 657 case IDC_SHOW_SYNC_SETUP: |
| 658 if (!uma_action_recorded_) { |
| 659 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.ShowSyncSetup", |
| 660 delta); |
| 661 } |
| 662 LogMenuAction(MENU_ACTION_SHOW_SYNC_SETUP); |
| 663 break; |
| 664 case IDC_OPTIONS: |
| 665 if (!uma_action_recorded_) |
| 666 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.Settings", delta); |
| 667 LogMenuAction(MENU_ACTION_OPTIONS); |
| 668 break; |
| 669 case IDC_ABOUT: |
| 670 if (!uma_action_recorded_) |
| 671 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.About", delta); |
| 672 LogMenuAction(MENU_ACTION_ABOUT); |
| 673 break; |
| 674 |
| 675 // Help menu. |
| 676 case IDC_HELP_PAGE_VIA_MENU: |
| 677 content::RecordAction(UserMetricsAction("ShowHelpTabViaWrenchMenu")); |
| 678 |
| 679 if (!uma_action_recorded_) |
| 680 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.HelpPage", delta); |
| 681 LogMenuAction(MENU_ACTION_HELP_PAGE_VIA_MENU); |
| 682 break; |
| 683 #if defined(GOOGLE_CHROME_BUILD) |
| 684 case IDC_FEEDBACK: |
| 685 if (!uma_action_recorded_) |
| 686 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.Feedback", delta); |
| 687 LogMenuAction(MENU_ACTION_FEEDBACK); |
| 688 break; |
| 689 #endif |
| 690 |
| 691 case IDC_TOGGLE_REQUEST_TABLET_SITE: |
| 692 if (!uma_action_recorded_) { |
| 693 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.RequestTabletSite", |
| 694 delta); |
| 695 } |
| 696 LogMenuAction(MENU_ACTION_TOGGLE_REQUEST_TABLET_SITE); |
| 697 break; |
| 698 case IDC_EXIT: |
| 699 if (!uma_action_recorded_) |
| 700 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.Exit", delta); |
| 701 LogMenuAction(MENU_ACTION_EXIT); |
| 702 break; |
| 703 } |
| 704 |
| 705 if (!uma_action_recorded_) { |
| 706 UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction", delta); |
| 707 uma_action_recorded_ = true; |
| 708 } |
| 709 } |
| 710 |
| 711 void WrenchMenuModel::LogMenuAction(int action_id) { |
| 712 UMA_HISTOGRAM_ENUMERATION("WrenchMenu.MenuAction", action_id, |
| 713 LIMIT_MENU_ACTION); |
| 714 } |
| 715 |
| 424 bool WrenchMenuModel::IsCommandIdChecked(int command_id) const { | 716 bool WrenchMenuModel::IsCommandIdChecked(int command_id) const { |
| 425 if (command_id == IDC_SHOW_BOOKMARK_BAR) { | 717 if (command_id == IDC_SHOW_BOOKMARK_BAR) { |
| 426 return browser_->profile()->GetPrefs()->GetBoolean( | 718 return browser_->profile()->GetPrefs()->GetBoolean( |
| 427 bookmarks::prefs::kShowBookmarkBar); | 719 bookmarks::prefs::kShowBookmarkBar); |
| 428 } else if (command_id == IDC_PROFILING_ENABLED) { | 720 } else if (command_id == IDC_PROFILING_ENABLED) { |
| 429 return Profiling::BeingProfiled(); | 721 return Profiling::BeingProfiled(); |
| 430 } else if (command_id == IDC_TOGGLE_REQUEST_TABLET_SITE) { | 722 } else if (command_id == IDC_TOGGLE_REQUEST_TABLET_SITE) { |
| 431 return chrome::IsRequestingTabletSite(browser_); | 723 return chrome::IsRequestingTabletSite(browser_); |
| 432 } | 724 } |
| 433 | 725 |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 if (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) | 955 if (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) |
| 664 show_exit_menu = false; | 956 show_exit_menu = false; |
| 665 #endif | 957 #endif |
| 666 | 958 |
| 667 if (show_exit_menu) { | 959 if (show_exit_menu) { |
| 668 AddSeparator(ui::NORMAL_SEPARATOR); | 960 AddSeparator(ui::NORMAL_SEPARATOR); |
| 669 AddItemWithStringId(IDC_EXIT, IDS_EXIT); | 961 AddItemWithStringId(IDC_EXIT, IDS_EXIT); |
| 670 } | 962 } |
| 671 | 963 |
| 672 RemoveTrailingSeparators(); | 964 RemoveTrailingSeparators(); |
| 965 uma_action_recorded_ = false; |
| 673 } | 966 } |
| 674 | 967 |
| 675 void WrenchMenuModel::AddGlobalErrorMenuItems() { | 968 void WrenchMenuModel::AddGlobalErrorMenuItems() { |
| 676 // TODO(sail): Currently we only build the wrench menu once per browser | 969 // TODO(sail): Currently we only build the wrench menu once per browser |
| 677 // window. This means that if a new error is added after the menu is built | 970 // window. This means that if a new error is added after the menu is built |
| 678 // it won't show in the existing wrench menu. To fix this we need to some | 971 // it won't show in the existing wrench menu. To fix this we need to some |
| 679 // how update the menu if new errors are added. | 972 // how update the menu if new errors are added. |
| 680 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 973 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 681 // GetSignedInServiceErrors() can modify the global error list, so call it | 974 // GetSignedInServiceErrors() can modify the global error list, so call it |
| 682 // before iterating through that list below. | 975 // before iterating through that list below. |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 ->GetZoomPercent(); | 1081 ->GetZoomPercent(); |
| 789 } | 1082 } |
| 790 zoom_label_ = l10n_util::GetStringFUTF16( | 1083 zoom_label_ = l10n_util::GetStringFUTF16( |
| 791 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); | 1084 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); |
| 792 } | 1085 } |
| 793 | 1086 |
| 794 void WrenchMenuModel::OnZoomLevelChanged( | 1087 void WrenchMenuModel::OnZoomLevelChanged( |
| 795 const content::HostZoomMap::ZoomLevelChange& change) { | 1088 const content::HostZoomMap::ZoomLevelChange& change) { |
| 796 UpdateZoomControls(); | 1089 UpdateZoomControls(); |
| 797 } | 1090 } |
| OLD | NEW |