| 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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 | 554 |
| 555 #endif | 555 #endif |
| 556 | 556 |
| 557 // Append the full menu including separators. The final separator only gets | 557 // Append the full menu including separators. The final separator only gets |
| 558 // appended when this is a touch menu - otherwise it would get added twice. | 558 // appended when this is a touch menu - otherwise it would get added twice. |
| 559 CreateCutCopyPasteMenu(is_new_menu); | 559 CreateCutCopyPasteMenu(is_new_menu); |
| 560 | 560 |
| 561 if (!is_new_menu) | 561 if (!is_new_menu) |
| 562 CreateZoomMenu(is_new_menu); | 562 CreateZoomMenu(is_new_menu); |
| 563 | 563 |
| 564 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 565 switches::kEnableDomDistiller)) { |
| 566 AddItemWithStringId(IDC_DISTILL_PAGE, IDS_DISTILL_PAGE); |
| 567 } |
| 568 |
| 564 AddItemWithStringId(IDC_SAVE_PAGE, IDS_SAVE_PAGE); | 569 AddItemWithStringId(IDC_SAVE_PAGE, IDS_SAVE_PAGE); |
| 565 AddItemWithStringId(IDC_FIND, IDS_FIND); | 570 AddItemWithStringId(IDC_FIND, IDS_FIND); |
| 566 AddItemWithStringId(IDC_PRINT, IDS_PRINT); | 571 AddItemWithStringId(IDC_PRINT, IDS_PRINT); |
| 567 | 572 |
| 568 tools_menu_model_.reset(new ToolsMenuModel(this, browser_)); | 573 tools_menu_model_.reset(new ToolsMenuModel(this, browser_)); |
| 569 // In case of touch this is the last item. | 574 // In case of touch this is the last item. |
| 570 if (!is_new_menu) { | 575 if (!is_new_menu) { |
| 571 AddSubMenuWithStringId(IDC_ZOOM_MENU, IDS_TOOLS_MENU, | 576 AddSubMenuWithStringId(IDC_ZOOM_MENU, IDS_TOOLS_MENU, |
| 572 tools_menu_model_.get()); | 577 tools_menu_model_.get()); |
| 573 } | 578 } |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 &enable_increment, &enable_decrement); | 771 &enable_increment, &enable_decrement); |
| 767 } | 772 } |
| 768 zoom_label_ = l10n_util::GetStringFUTF16( | 773 zoom_label_ = l10n_util::GetStringFUTF16( |
| 769 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); | 774 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); |
| 770 } | 775 } |
| 771 | 776 |
| 772 void WrenchMenuModel::OnZoomLevelChanged( | 777 void WrenchMenuModel::OnZoomLevelChanged( |
| 773 const content::HostZoomMap::ZoomLevelChange& change) { | 778 const content::HostZoomMap::ZoomLevelChange& change) { |
| 774 UpdateZoomControls(); | 779 UpdateZoomControls(); |
| 775 } | 780 } |
| OLD | NEW |