Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(715)

Side by Side Diff: chrome/browser/ui/toolbar/app_menu_model.cc

Issue 2768633003: Dynamic updating recent menu for tabs from other devices. (Closed)
Patch Set: Fixes compilation and test on Mac. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 699 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 IsCommandIdVisible(IDC_UPGRADE_DIALOG)) 710 IsCommandIdVisible(IDC_UPGRADE_DIALOG))
711 AddSeparator(ui::NORMAL_SEPARATOR); 711 AddSeparator(ui::NORMAL_SEPARATOR);
712 712
713 AddItemWithStringId(IDC_NEW_TAB, IDS_NEW_TAB); 713 AddItemWithStringId(IDC_NEW_TAB, IDS_NEW_TAB);
714 AddItemWithStringId(IDC_NEW_WINDOW, IDS_NEW_WINDOW); 714 AddItemWithStringId(IDC_NEW_WINDOW, IDS_NEW_WINDOW);
715 if (ShouldShowNewIncognitoWindowMenuItem()) 715 if (ShouldShowNewIncognitoWindowMenuItem())
716 AddItemWithStringId(IDC_NEW_INCOGNITO_WINDOW, IDS_NEW_INCOGNITO_WINDOW); 716 AddItemWithStringId(IDC_NEW_INCOGNITO_WINDOW, IDS_NEW_INCOGNITO_WINDOW);
717 AddSeparator(ui::NORMAL_SEPARATOR); 717 AddSeparator(ui::NORMAL_SEPARATOR);
718 718
719 if (!browser_->profile()->IsOffTheRecord()) { 719 if (!browser_->profile()->IsOffTheRecord()) {
720 recent_tabs_sub_menu_model_.reset(new RecentTabsSubMenuModel(provider_, 720 recent_tabs_sub_menu_model_ =
721 browser_, 721 base::MakeUnique<RecentTabsSubMenuModel>(provider_, browser_);
722 NULL));
723 AddSubMenuWithStringId(IDC_RECENT_TABS_MENU, IDS_HISTORY_MENU, 722 AddSubMenuWithStringId(IDC_RECENT_TABS_MENU, IDS_HISTORY_MENU,
724 recent_tabs_sub_menu_model_.get()); 723 recent_tabs_sub_menu_model_.get());
725 } 724 }
726 AddItemWithStringId(IDC_SHOW_DOWNLOADS, IDS_SHOW_DOWNLOADS); 725 AddItemWithStringId(IDC_SHOW_DOWNLOADS, IDS_SHOW_DOWNLOADS);
727 if (!browser_->profile()->IsGuestSession()) { 726 if (!browser_->profile()->IsGuestSession()) {
728 bookmark_sub_menu_model_.reset(new BookmarkSubMenuModel(this, browser_)); 727 bookmark_sub_menu_model_.reset(new BookmarkSubMenuModel(this, browser_));
729 AddSubMenuWithStringId(IDC_BOOKMARKS_MENU, IDS_BOOKMARKS_MENU, 728 AddSubMenuWithStringId(IDC_BOOKMARKS_MENU, IDS_BOOKMARKS_MENU,
730 bookmark_sub_menu_model_.get()); 729 bookmark_sub_menu_model_.get());
731 } 730 }
732 731
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 browser_->tab_strip_model()->GetActiveWebContents()) 862 browser_->tab_strip_model()->GetActiveWebContents())
864 ->GetZoomPercent(); 863 ->GetZoomPercent();
865 } 864 }
866 zoom_label_ = base::FormatPercent(zoom_percent); 865 zoom_label_ = base::FormatPercent(zoom_percent);
867 } 866 }
868 867
869 void AppMenuModel::OnZoomLevelChanged( 868 void AppMenuModel::OnZoomLevelChanged(
870 const content::HostZoomMap::ZoomLevelChange& change) { 869 const content::HostZoomMap::ZoomLevelChange& change) {
871 UpdateZoomControls(); 870 UpdateZoomControls();
872 } 871 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698