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 <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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 // When there are no background applications, we want to display | 116 // When there are no background applications, we want to display |
117 // just a label stating that none are running. | 117 // just a label stating that none are running. |
118 if (applications_->size() < 1) { | 118 if (applications_->size() < 1) { |
119 menu->AddItemWithStringId(IDC_MinimumLabelValue, | 119 menu->AddItemWithStringId(IDC_MinimumLabelValue, |
120 IDS_BACKGROUND_APP_NOT_INSTALLED); | 120 IDS_BACKGROUND_APP_NOT_INSTALLED); |
121 } else { | 121 } else { |
122 for (extensions::ExtensionList::const_iterator cursor = | 122 for (extensions::ExtensionList::const_iterator cursor = |
123 applications_->begin(); | 123 applications_->begin(); |
124 cursor != applications_->end(); | 124 cursor != applications_->end(); |
125 ++cursor, ++position) { | 125 ++cursor, ++position) { |
126 const gfx::ImageSkia* icon = applications_->GetIcon(*cursor); | 126 const gfx::ImageSkia* icon = applications_->GetIcon(cursor->get()); |
127 DCHECK(position == applications_->GetPosition(*cursor)); | 127 DCHECK(position == applications_->GetPosition(cursor->get())); |
128 const std::string& name = (*cursor)->name(); | 128 const std::string& name = (*cursor)->name(); |
129 menu->AddItem(position, UTF8ToUTF16(name)); | 129 menu->AddItem(position, UTF8ToUTF16(name)); |
130 if (icon) | 130 if (icon) |
131 menu->SetIcon(menu->GetItemCount() - 1, gfx::Image(*icon)); | 131 menu->SetIcon(menu->GetItemCount() - 1, gfx::Image(*icon)); |
132 } | 132 } |
133 } | 133 } |
134 if (containing_menu) | 134 if (containing_menu) |
135 containing_menu->AddSubMenu(command_id_, name_, menu); | 135 containing_menu->AddSubMenu(command_id_, name_, menu); |
136 } | 136 } |
137 | 137 |
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 } | 765 } |
766 } | 766 } |
767 return profile_it; | 767 return profile_it; |
768 } | 768 } |
769 | 769 |
770 bool BackgroundModeManager::IsBackgroundModePrefEnabled() const { | 770 bool BackgroundModeManager::IsBackgroundModePrefEnabled() const { |
771 PrefService* service = g_browser_process->local_state(); | 771 PrefService* service = g_browser_process->local_state(); |
772 DCHECK(service); | 772 DCHECK(service); |
773 return service->GetBoolean(prefs::kBackgroundModeEnabled); | 773 return service->GetBoolean(prefs::kBackgroundModeEnabled); |
774 } | 774 } |
OLD | NEW |