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

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

Issue 11298004: alternate ntp: add "Recent Tabs" submenu to wrench menu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased to resolve conflicts Created 8 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/toolbar/wrench_menu_model.h ('k') | chrome/browser/ui/views/toolbar_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 15 matching lines...) Expand all
26 #include "chrome/browser/sync/sync_ui_util.h" 26 #include "chrome/browser/sync/sync_ui_util.h"
27 #include "chrome/browser/task_manager/task_manager.h" 27 #include "chrome/browser/task_manager/task_manager.h"
28 #include "chrome/browser/ui/browser.h" 28 #include "chrome/browser/ui/browser.h"
29 #include "chrome/browser/ui/browser_commands.h" 29 #include "chrome/browser/ui/browser_commands.h"
30 #include "chrome/browser/ui/browser_finder.h" 30 #include "chrome/browser/ui/browser_finder.h"
31 #include "chrome/browser/ui/browser_tabstrip.h" 31 #include "chrome/browser/ui/browser_tabstrip.h"
32 #include "chrome/browser/ui/browser_window.h" 32 #include "chrome/browser/ui/browser_window.h"
33 #include "chrome/browser/ui/global_error/global_error.h" 33 #include "chrome/browser/ui/global_error/global_error.h"
34 #include "chrome/browser/ui/global_error/global_error_service.h" 34 #include "chrome/browser/ui/global_error/global_error_service.h"
35 #include "chrome/browser/ui/global_error/global_error_service_factory.h" 35 #include "chrome/browser/ui/global_error/global_error_service_factory.h"
36 #include "chrome/browser/ui/search/search.h"
36 #include "chrome/browser/ui/tab_contents/tab_contents.h" 37 #include "chrome/browser/ui/tab_contents/tab_contents.h"
37 #include "chrome/browser/ui/tabs/tab_strip_model.h" 38 #include "chrome/browser/ui/tabs/tab_strip_model.h"
39 #include "chrome/browser/ui/toolbar/bookmark_sub_menu_model.h"
38 #include "chrome/browser/ui/toolbar/encoding_menu_controller.h" 40 #include "chrome/browser/ui/toolbar/encoding_menu_controller.h"
41 #include "chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.h"
39 #include "chrome/browser/upgrade_detector.h" 42 #include "chrome/browser/upgrade_detector.h"
40 #include "chrome/common/chrome_paths.h" 43 #include "chrome/common/chrome_paths.h"
41 #include "chrome/common/chrome_switches.h" 44 #include "chrome/common/chrome_switches.h"
42 #include "chrome/common/pref_names.h" 45 #include "chrome/common/pref_names.h"
43 #include "chrome/common/profiling.h" 46 #include "chrome/common/profiling.h"
44 #include "content/public/browser/host_zoom_map.h" 47 #include "content/public/browser/host_zoom_map.h"
45 #include "content/public/browser/navigation_entry.h" 48 #include "content/public/browser/navigation_entry.h"
46 #include "content/public/browser/notification_service.h" 49 #include "content/public/browser/notification_service.h"
47 #include "content/public/browser/notification_source.h" 50 #include "content/public/browser/notification_source.h"
48 #include "content/public/browser/notification_types.h" 51 #include "content/public/browser/notification_types.h"
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 AddItemWithStringId(IDC_TOGGLE_ASH_DESKTOP, 506 AddItemWithStringId(IDC_TOGGLE_ASH_DESKTOP,
504 ash::Shell::HasInstance() ? IDS_CLOSE_ASH_DESKTOP : 507 ash::Shell::HasInstance() ? IDS_CLOSE_ASH_DESKTOP :
505 IDS_OPEN_ASH_DESKTOP); 508 IDS_OPEN_ASH_DESKTOP);
506 } 509 }
507 #endif 510 #endif
508 511
509 bookmark_sub_menu_model_.reset(new BookmarkSubMenuModel(this, browser_)); 512 bookmark_sub_menu_model_.reset(new BookmarkSubMenuModel(this, browser_));
510 AddSubMenuWithStringId(IDC_BOOKMARKS_MENU, IDS_BOOKMARKS_MENU, 513 AddSubMenuWithStringId(IDC_BOOKMARKS_MENU, IDS_BOOKMARKS_MENU,
511 bookmark_sub_menu_model_.get()); 514 bookmark_sub_menu_model_.get());
512 515
516 if (chrome::search::IsInstantExtendedAPIEnabled(browser_->profile())) {
517 recent_tabs_sub_menu_model_.reset(new RecentTabsSubMenuModel(provider_,
518 browser_,
519 NULL));
520 AddSubMenuWithStringId(IDC_RECENT_TABS_MENU, IDS_RECENT_TABS_MENU,
521 recent_tabs_sub_menu_model_.get());
522 }
523
513 #if defined(OS_WIN) 524 #if defined(OS_WIN)
514 if (base::win::IsMetroProcess()) { 525 if (base::win::IsMetroProcess()) {
515 // Metro mode, add the 'Relaunch Chrome in desktop mode'. 526 // Metro mode, add the 'Relaunch Chrome in desktop mode'.
516 AddSeparator(ui::SPACING_SEPARATOR); 527 AddSeparator(ui::SPACING_SEPARATOR);
517 AddItemWithStringId(IDC_WIN8_DESKTOP_RESTART, IDS_WIN8_DESKTOP_RESTART); 528 AddItemWithStringId(IDC_WIN8_DESKTOP_RESTART, IDS_WIN8_DESKTOP_RESTART);
518 } else if (base::win::GetVersion() >= base::win::VERSION_WIN8) { 529 } else if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
519 // In Windows 8 desktop, add the 'Relaunch Chrome in Windows 8 mode'. 530 // In Windows 8 desktop, add the 'Relaunch Chrome in Windows 8 mode'.
520 AddSeparator(ui::SPACING_SEPARATOR); 531 AddSeparator(ui::SPACING_SEPARATOR);
521 AddItemWithStringId(IDC_WIN8_METRO_RESTART, IDS_WIN8_METRO_RESTART); 532 AddItemWithStringId(IDC_WIN8_METRO_RESTART, IDS_WIN8_METRO_RESTART);
522 } 533 }
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 zoom_label_ = l10n_util::GetStringFUTF16( 722 zoom_label_ = l10n_util::GetStringFUTF16(
712 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); 723 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent));
713 } 724 }
714 725
715 string16 WrenchMenuModel::GetSyncMenuLabel() const { 726 string16 WrenchMenuModel::GetSyncMenuLabel() const {
716 Profile* profile = browser_->profile()->GetOriginalProfile(); 727 Profile* profile = browser_->profile()->GetOriginalProfile();
717 return sync_ui_util::GetSyncMenuLabel( 728 return sync_ui_util::GetSyncMenuLabel(
718 ProfileSyncServiceFactory::GetForProfile(profile), 729 ProfileSyncServiceFactory::GetForProfile(profile),
719 *SigninManagerFactory::GetForProfile(profile)); 730 *SigninManagerFactory::GetForProfile(profile));
720 } 731 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/toolbar/wrench_menu_model.h ('k') | chrome/browser/ui/views/toolbar_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698