| 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 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 AddItemWithStringId(IDC_SHOW_DOWNLOADS, IDS_SHOW_DOWNLOADS); | 713 AddItemWithStringId(IDC_SHOW_DOWNLOADS, IDS_SHOW_DOWNLOADS); |
| 714 if (!browser_->profile()->IsGuestSession()) { | 714 if (!browser_->profile()->IsGuestSession()) { |
| 715 bookmark_sub_menu_model_.reset(new BookmarkSubMenuModel(this, browser_)); | 715 bookmark_sub_menu_model_.reset(new BookmarkSubMenuModel(this, browser_)); |
| 716 AddSubMenuWithStringId(IDC_BOOKMARKS_MENU, IDS_BOOKMARKS_MENU, | 716 AddSubMenuWithStringId(IDC_BOOKMARKS_MENU, IDS_BOOKMARKS_MENU, |
| 717 bookmark_sub_menu_model_.get()); | 717 bookmark_sub_menu_model_.get()); |
| 718 } | 718 } |
| 719 | 719 |
| 720 CreateZoomMenu(); | 720 CreateZoomMenu(); |
| 721 AddItemWithStringId(IDC_PRINT, IDS_PRINT); | 721 AddItemWithStringId(IDC_PRINT, IDS_PRINT); |
| 722 | 722 |
| 723 #if defined(ENABLE_MEDIA_ROUTER) | |
| 724 if (media_router::MediaRouterEnabled(browser()->profile())) | 723 if (media_router::MediaRouterEnabled(browser()->profile())) |
| 725 AddItemWithStringId(IDC_ROUTE_MEDIA, IDS_MEDIA_ROUTER_MENU_ITEM_TITLE); | 724 AddItemWithStringId(IDC_ROUTE_MEDIA, IDS_MEDIA_ROUTER_MENU_ITEM_TITLE); |
| 726 #endif // defined(ENABLE_MEDIA_ROUTER) | |
| 727 | 725 |
| 728 AddItemWithStringId(IDC_FIND, IDS_FIND); | 726 AddItemWithStringId(IDC_FIND, IDS_FIND); |
| 729 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 727 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 730 switches::kEnableDomDistiller)) | 728 switches::kEnableDomDistiller)) |
| 731 AddItemWithStringId(IDC_DISTILL_PAGE, IDS_DISTILL_PAGE); | 729 AddItemWithStringId(IDC_DISTILL_PAGE, IDS_DISTILL_PAGE); |
| 732 tools_menu_model_.reset(new ToolsMenuModel(this, browser_)); | 730 tools_menu_model_.reset(new ToolsMenuModel(this, browser_)); |
| 733 AddSubMenuWithStringId( | 731 AddSubMenuWithStringId( |
| 734 IDC_MORE_TOOLS_MENU, IDS_MORE_TOOLS_MENU, tools_menu_model_.get()); | 732 IDC_MORE_TOOLS_MENU, IDS_MORE_TOOLS_MENU, tools_menu_model_.get()); |
| 735 // Append the full menu including separators. The final separator only gets | 733 // Append the full menu including separators. The final separator only gets |
| 736 // appended when this is a touch menu - otherwise it would get added twice. | 734 // 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... |
| 850 browser_->tab_strip_model()->GetActiveWebContents()) | 848 browser_->tab_strip_model()->GetActiveWebContents()) |
| 851 ->GetZoomPercent(); | 849 ->GetZoomPercent(); |
| 852 } | 850 } |
| 853 zoom_label_ = base::FormatPercent(zoom_percent); | 851 zoom_label_ = base::FormatPercent(zoom_percent); |
| 854 } | 852 } |
| 855 | 853 |
| 856 void AppMenuModel::OnZoomLevelChanged( | 854 void AppMenuModel::OnZoomLevelChanged( |
| 857 const content::HostZoomMap::ZoomLevelChange& change) { | 855 const content::HostZoomMap::ZoomLevelChange& change) { |
| 858 UpdateZoomControls(); | 856 UpdateZoomControls(); |
| 859 } | 857 } |
| OLD | NEW |