| 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/app_menu_model.h" | 5 #include "chrome/browser/ui/toolbar/app_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 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 AddItemWithStringId(IDC_SHOW_DOWNLOADS, IDS_SHOW_DOWNLOADS); | 726 AddItemWithStringId(IDC_SHOW_DOWNLOADS, IDS_SHOW_DOWNLOADS); |
| 727 if (!browser_->profile()->IsGuestSession()) { | 727 if (!browser_->profile()->IsGuestSession()) { |
| 728 bookmark_sub_menu_model_.reset(new BookmarkSubMenuModel(this, browser_)); | 728 bookmark_sub_menu_model_.reset(new BookmarkSubMenuModel(this, browser_)); |
| 729 AddSubMenuWithStringId(IDC_BOOKMARKS_MENU, IDS_BOOKMARKS_MENU, | 729 AddSubMenuWithStringId(IDC_BOOKMARKS_MENU, IDS_BOOKMARKS_MENU, |
| 730 bookmark_sub_menu_model_.get()); | 730 bookmark_sub_menu_model_.get()); |
| 731 } | 731 } |
| 732 | 732 |
| 733 CreateZoomMenu(); | 733 CreateZoomMenu(); |
| 734 AddItemWithStringId(IDC_PRINT, IDS_PRINT); | 734 AddItemWithStringId(IDC_PRINT, IDS_PRINT); |
| 735 | 735 |
| 736 #if defined(ENABLE_MEDIA_ROUTER) | |
| 737 if (media_router::MediaRouterEnabled(browser()->profile())) | 736 if (media_router::MediaRouterEnabled(browser()->profile())) |
| 738 AddItemWithStringId(IDC_ROUTE_MEDIA, IDS_MEDIA_ROUTER_MENU_ITEM_TITLE); | 737 AddItemWithStringId(IDC_ROUTE_MEDIA, IDS_MEDIA_ROUTER_MENU_ITEM_TITLE); |
| 739 #endif // defined(ENABLE_MEDIA_ROUTER) | |
| 740 | 738 |
| 741 AddItemWithStringId(IDC_FIND, IDS_FIND); | 739 AddItemWithStringId(IDC_FIND, IDS_FIND); |
| 742 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 740 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 743 switches::kEnableDomDistiller)) | 741 switches::kEnableDomDistiller)) |
| 744 AddItemWithStringId(IDC_DISTILL_PAGE, IDS_DISTILL_PAGE); | 742 AddItemWithStringId(IDC_DISTILL_PAGE, IDS_DISTILL_PAGE); |
| 745 tools_menu_model_.reset(new ToolsMenuModel(this, browser_)); | 743 tools_menu_model_.reset(new ToolsMenuModel(this, browser_)); |
| 746 AddSubMenuWithStringId( | 744 AddSubMenuWithStringId( |
| 747 IDC_MORE_TOOLS_MENU, IDS_MORE_TOOLS_MENU, tools_menu_model_.get()); | 745 IDC_MORE_TOOLS_MENU, IDS_MORE_TOOLS_MENU, tools_menu_model_.get()); |
| 748 // Append the full menu including separators. The final separator only gets | 746 // Append the full menu including separators. The final separator only gets |
| 749 // appended when this is a touch menu - otherwise it would get added twice. | 747 // appended when this is a touch menu - otherwise it would get added twice. |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 863 browser_->tab_strip_model()->GetActiveWebContents()) | 861 browser_->tab_strip_model()->GetActiveWebContents()) |
| 864 ->GetZoomPercent(); | 862 ->GetZoomPercent(); |
| 865 } | 863 } |
| 866 zoom_label_ = base::FormatPercent(zoom_percent); | 864 zoom_label_ = base::FormatPercent(zoom_percent); |
| 867 } | 865 } |
| 868 | 866 |
| 869 void AppMenuModel::OnZoomLevelChanged( | 867 void AppMenuModel::OnZoomLevelChanged( |
| 870 const content::HostZoomMap::ZoomLevelChange& change) { | 868 const content::HostZoomMap::ZoomLevelChange& change) { |
| 871 UpdateZoomControls(); | 869 UpdateZoomControls(); |
| 872 } | 870 } |
| OLD | NEW |