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

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

Issue 10824402: Convert ui::MenuModel to use gfx::Image instead of ImageSkia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another day, another rebase 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/chromeos/status/network_menu.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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 } else { 114 } else {
115 for (extensions::ExtensionList::const_iterator cursor = 115 for (extensions::ExtensionList::const_iterator cursor =
116 applications_->begin(); 116 applications_->begin();
117 cursor != applications_->end(); 117 cursor != applications_->end();
118 ++cursor, ++position) { 118 ++cursor, ++position) {
119 const gfx::ImageSkia* icon = applications_->GetIcon(*cursor); 119 const gfx::ImageSkia* icon = applications_->GetIcon(*cursor);
120 DCHECK(position == applications_->GetPosition(*cursor)); 120 DCHECK(position == applications_->GetPosition(*cursor));
121 const std::string& name = (*cursor)->name(); 121 const std::string& name = (*cursor)->name();
122 menu->AddItem(position, UTF8ToUTF16(name)); 122 menu->AddItem(position, UTF8ToUTF16(name));
123 if (icon) 123 if (icon)
124 menu->SetIcon(menu->GetItemCount() - 1, *icon); 124 menu->SetIcon(menu->GetItemCount() - 1, gfx::Image(*icon));
125 } 125 }
126 } 126 }
127 if (containing_menu) 127 if (containing_menu)
128 containing_menu->AddSubMenu(command_id_, name_, menu); 128 containing_menu->AddSubMenu(command_id_, name_, menu);
129 } 129 }
130 130
131 void BackgroundModeManager::BackgroundModeData::SetName( 131 void BackgroundModeManager::BackgroundModeData::SetName(
132 const string16& new_profile_name) { 132 const string16& new_profile_name) {
133 name_ = new_profile_name; 133 name_ = new_profile_name;
134 } 134 }
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
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/chromeos/status/network_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698