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

Side by Side Diff: chrome/browser/background/background_mode_manager.cc

Issue 10837317: Setting the touch wrench menu as default menu for ChromeOS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: And another merge! Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/bookmarks/bookmark_context_menu_controller.cc » ('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 <algorithm> 5 #include <algorithm>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/base_paths.h" 9 #include "base/base_paths.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 DCHECK(keep_alive_for_test_); 692 DCHECK(keep_alive_for_test_);
693 return; 693 return;
694 } 694 }
695 695
696 // TODO(rlp): Add current profile color or indicator. 696 // TODO(rlp): Add current profile color or indicator.
697 // Create a context menu item for Chrome. 697 // Create a context menu item for Chrome.
698 ui::SimpleMenuModel* menu = new ui::SimpleMenuModel(this); 698 ui::SimpleMenuModel* menu = new ui::SimpleMenuModel(this);
699 // Add About item 699 // Add About item
700 menu->AddItem(IDC_ABOUT, l10n_util::GetStringUTF16(IDS_ABOUT)); 700 menu->AddItem(IDC_ABOUT, l10n_util::GetStringUTF16(IDS_ABOUT));
701 menu->AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER); 701 menu->AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER);
702 menu->AddSeparator(); 702 menu->AddSeparator(ui::NORMAL_SEPARATOR);
703 703
704 if (profile_cache_->GetNumberOfProfiles() > 1) { 704 if (profile_cache_->GetNumberOfProfiles() > 1) {
705 std::vector<BackgroundModeData*> bmd_vector; 705 std::vector<BackgroundModeData*> bmd_vector;
706 for (BackgroundModeInfoMap::iterator it = 706 for (BackgroundModeInfoMap::iterator it =
707 background_mode_data_.begin(); 707 background_mode_data_.begin();
708 it != background_mode_data_.end(); 708 it != background_mode_data_.end();
709 ++it) { 709 ++it) {
710 bmd_vector.push_back(it->second.get()); 710 bmd_vector.push_back(it->second.get());
711 } 711 }
712 std::sort(bmd_vector.begin(), bmd_vector.end(), 712 std::sort(bmd_vector.begin(), bmd_vector.end(),
(...skipping 15 matching lines...) Expand all
728 // We should only be displaying the status tray icon if there is at least 728 // We should only be displaying the status tray icon if there is at least
729 // one profile with a background app. 729 // one profile with a background app.
730 DCHECK_GT(profiles_with_apps, 0); 730 DCHECK_GT(profiles_with_apps, 0);
731 } else { 731 } else {
732 // We should only have one profile in the cache if we are not 732 // We should only have one profile in the cache if we are not
733 // using multi-profiles. If keep_alive_for_test_ is set, then we may not 733 // using multi-profiles. If keep_alive_for_test_ is set, then we may not
734 // have any profiles in the cache. 734 // have any profiles in the cache.
735 DCHECK(profile_cache_->GetNumberOfProfiles() == size_t(1) || 735 DCHECK(profile_cache_->GetNumberOfProfiles() == size_t(1) ||
736 keep_alive_for_test_); 736 keep_alive_for_test_);
737 background_mode_data_.begin()->second->BuildProfileMenu(menu, NULL); 737 background_mode_data_.begin()->second->BuildProfileMenu(menu, NULL);
738 menu->AddSeparator(); 738 menu->AddSeparator(ui::NORMAL_SEPARATOR);
739 } 739 }
740 menu->AddCheckItemWithStringId( 740 menu->AddCheckItemWithStringId(
741 IDC_STATUS_TRAY_KEEP_CHROME_RUNNING_IN_BACKGROUND, 741 IDC_STATUS_TRAY_KEEP_CHROME_RUNNING_IN_BACKGROUND,
742 IDS_STATUS_TRAY_KEEP_CHROME_RUNNING_IN_BACKGROUND); 742 IDS_STATUS_TRAY_KEEP_CHROME_RUNNING_IN_BACKGROUND);
743 menu->AddItemWithStringId(IDC_EXIT, IDS_EXIT); 743 menu->AddItemWithStringId(IDC_EXIT, IDS_EXIT);
744 context_menu_ = menu; 744 context_menu_ = menu;
745 status_icon_->SetContextMenu(menu); 745 status_icon_->SetContextMenu(menu);
746 } 746 }
747 747
748 void BackgroundModeManager::RemoveStatusTrayIcon() { 748 void BackgroundModeManager::RemoveStatusTrayIcon() {
(...skipping 23 matching lines...) Expand all
772 } 772 }
773 } 773 }
774 return profile_it; 774 return profile_it;
775 } 775 }
776 776
777 bool BackgroundModeManager::IsBackgroundModePrefEnabled() const { 777 bool BackgroundModeManager::IsBackgroundModePrefEnabled() const {
778 PrefService* service = g_browser_process->local_state(); 778 PrefService* service = g_browser_process->local_state();
779 DCHECK(service); 779 DCHECK(service);
780 return service->GetBoolean(prefs::kBackgroundModeEnabled); 780 return service->GetBoolean(prefs::kBackgroundModeEnabled);
781 } 781 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/bookmarks/bookmark_context_menu_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698