| 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" |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 if (browser_defaults::kShowFeedbackMenuItem) | 606 if (browser_defaults::kShowFeedbackMenuItem) |
| 607 AddItemWithStringId(IDC_FEEDBACK, IDS_FEEDBACK); | 607 AddItemWithStringId(IDC_FEEDBACK, IDS_FEEDBACK); |
| 608 | 608 |
| 609 AddGlobalErrorMenuItems(); | 609 AddGlobalErrorMenuItems(); |
| 610 | 610 |
| 611 if (is_new_menu) { | 611 if (is_new_menu) { |
| 612 AddSubMenuWithStringId(IDC_ZOOM_MENU, IDS_MORE_TOOLS_MENU, | 612 AddSubMenuWithStringId(IDC_ZOOM_MENU, IDS_MORE_TOOLS_MENU, |
| 613 tools_menu_model_.get()); | 613 tools_menu_model_.get()); |
| 614 } | 614 } |
| 615 | 615 |
| 616 bool show_exit_menu = browser_defaults::kShowExitMenuItem; | 616 if (browser_defaults::kShowExitMenuItem) { |
| 617 #if defined(OS_WIN) && defined(USE_AURA) | |
| 618 if (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) | |
| 619 show_exit_menu = false; | |
| 620 #endif | |
| 621 if (show_exit_menu) { | |
| 622 AddSeparator(ui::NORMAL_SEPARATOR); | 617 AddSeparator(ui::NORMAL_SEPARATOR); |
| 623 AddItemWithStringId(IDC_EXIT, IDS_EXIT); | 618 AddItemWithStringId(IDC_EXIT, IDS_EXIT); |
| 624 } | 619 } |
| 625 | 620 |
| 626 if (is_new_menu && supports_new_separators) | 621 if (is_new_menu && supports_new_separators) |
| 627 AddSeparator(ui::SPACING_SEPARATOR); | 622 AddSeparator(ui::SPACING_SEPARATOR); |
| 628 } | 623 } |
| 629 | 624 |
| 630 void WrenchMenuModel::AddGlobalErrorMenuItems() { | 625 void WrenchMenuModel::AddGlobalErrorMenuItems() { |
| 631 // TODO(sail): Currently we only build the wrench menu once per browser | 626 // TODO(sail): Currently we only build the wrench menu once per browser |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 browser_->tab_strip_model()->GetActiveWebContents()->GetZoomPercent( | 709 browser_->tab_strip_model()->GetActiveWebContents()->GetZoomPercent( |
| 715 &enable_increment, &enable_decrement); | 710 &enable_increment, &enable_decrement); |
| 716 } | 711 } |
| 717 zoom_label_ = l10n_util::GetStringFUTF16( | 712 zoom_label_ = l10n_util::GetStringFUTF16( |
| 718 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); | 713 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); |
| 719 } | 714 } |
| 720 | 715 |
| 721 void WrenchMenuModel::OnZoomLevelChanged(const std::string& host) { | 716 void WrenchMenuModel::OnZoomLevelChanged(const std::string& host) { |
| 722 UpdateZoomControls(); | 717 UpdateZoomControls(); |
| 723 } | 718 } |
| OLD | NEW |