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

Side by Side Diff: chrome/browser/chromeos/status/network_menu.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
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/chromeos/status/network_menu.h" 5 #include "chrome/browser/chromeos/status/network_menu.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_delegate.h" 10 #include "ash/shell_delegate.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 virtual bool HasIcons() const OVERRIDE; 146 virtual bool HasIcons() const OVERRIDE;
147 virtual int GetItemCount() const OVERRIDE; 147 virtual int GetItemCount() const OVERRIDE;
148 virtual ui::MenuModel::ItemType GetTypeAt(int index) const OVERRIDE; 148 virtual ui::MenuModel::ItemType GetTypeAt(int index) const OVERRIDE;
149 virtual string16 GetLabelAt(int index) const OVERRIDE; 149 virtual string16 GetLabelAt(int index) const OVERRIDE;
150 virtual bool IsItemDynamicAt(int index) const OVERRIDE; 150 virtual bool IsItemDynamicAt(int index) const OVERRIDE;
151 virtual const gfx::Font* GetLabelFontAt(int index) const OVERRIDE; 151 virtual const gfx::Font* GetLabelFontAt(int index) const OVERRIDE;
152 virtual bool GetAcceleratorAt(int index, 152 virtual bool GetAcceleratorAt(int index,
153 ui::Accelerator* accelerator) const OVERRIDE; 153 ui::Accelerator* accelerator) const OVERRIDE;
154 virtual bool IsItemCheckedAt(int index) const OVERRIDE; 154 virtual bool IsItemCheckedAt(int index) const OVERRIDE;
155 virtual int GetGroupIdAt(int index) const OVERRIDE; 155 virtual int GetGroupIdAt(int index) const OVERRIDE;
156 virtual bool GetIconAt(int index, gfx::ImageSkia* icon) OVERRIDE; 156 virtual bool GetIconAt(int index, gfx::Image* icon) OVERRIDE;
157 virtual ui::ButtonMenuItemModel* GetButtonMenuItemAt( 157 virtual ui::ButtonMenuItemModel* GetButtonMenuItemAt(
158 int index) const OVERRIDE; 158 int index) const OVERRIDE;
159 virtual bool IsEnabledAt(int index) const OVERRIDE; 159 virtual bool IsEnabledAt(int index) const OVERRIDE;
160 virtual bool IsVisibleAt(int index) const OVERRIDE; 160 virtual bool IsVisibleAt(int index) const OVERRIDE;
161 virtual ui::MenuModel* GetSubmenuModelAt(int index) const OVERRIDE; 161 virtual ui::MenuModel* GetSubmenuModelAt(int index) const OVERRIDE;
162 virtual void HighlightChangedTo(int index) OVERRIDE; 162 virtual void HighlightChangedTo(int index) OVERRIDE;
163 virtual void ActivatedAt(int index) OVERRIDE; 163 virtual void ActivatedAt(int index) OVERRIDE;
164 virtual void SetMenuModelDelegate(ui::MenuModelDelegate* delegate) OVERRIDE; 164 virtual void SetMenuModelDelegate(ui::MenuModelDelegate* delegate) OVERRIDE;
165 165
166 protected: 166 protected:
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 369
370 bool NetworkMenuModel::IsItemCheckedAt(int index) const { 370 bool NetworkMenuModel::IsItemCheckedAt(int index) const {
371 // All ui::MenuModel::TYPE_CHECK menu items are checked. 371 // All ui::MenuModel::TYPE_CHECK menu items are checked.
372 return true; 372 return true;
373 } 373 }
374 374
375 int NetworkMenuModel::GetGroupIdAt(int index) const { 375 int NetworkMenuModel::GetGroupIdAt(int index) const {
376 return 0; 376 return 0;
377 } 377 }
378 378
379 bool NetworkMenuModel::GetIconAt(int index, gfx::ImageSkia* icon) { 379 bool NetworkMenuModel::GetIconAt(int index, gfx::Image* icon) {
380 if (!menu_items_[index].icon.isNull()) { 380 if (!menu_items_[index].icon.isNull()) {
381 *icon = menu_items_[index].icon; 381 *icon = gfx::Image(menu_items_[index].icon);
382 return true; 382 return true;
383 } 383 }
384 return false; 384 return false;
385 } 385 }
386 386
387 ui::ButtonMenuItemModel* NetworkMenuModel::GetButtonMenuItemAt( 387 ui::ButtonMenuItemModel* NetworkMenuModel::GetButtonMenuItemAt(
388 int index) const { 388 int index) const {
389 return NULL; 389 return NULL;
390 } 390 }
391 391
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
1102 1102
1103 void NetworkMenu::ShowOtherWifi() { 1103 void NetworkMenu::ShowOtherWifi() {
1104 NetworkConfigView::ShowForType(TYPE_WIFI, delegate_->GetNativeWindow()); 1104 NetworkConfigView::ShowForType(TYPE_WIFI, delegate_->GetNativeWindow());
1105 } 1105 }
1106 1106
1107 void NetworkMenu::ShowOtherCellular() { 1107 void NetworkMenu::ShowOtherCellular() {
1108 ChooseMobileNetworkDialog::ShowDialog(delegate_->GetNativeWindow()); 1108 ChooseMobileNetworkDialog::ShowDialog(delegate_->GetNativeWindow());
1109 } 1109 }
1110 1110
1111 } // namespace chromeos 1111 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/background/background_mode_manager.cc ('k') | chrome/browser/tab_contents/render_view_context_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698