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

Side by Side Diff: chrome/browser/chromeos/status/network_menu.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
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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 virtual void InitMenuItems(bool should_open_button_options) = 0; 139 virtual void InitMenuItems(bool should_open_button_options) = 0;
140 140
141 // Menu item field accessors. 141 // Menu item field accessors.
142 const MenuItemVector& menu_items() const { return menu_items_; } 142 const MenuItemVector& menu_items() const { return menu_items_; }
143 143
144 // ui::MenuModel implementation 144 // ui::MenuModel implementation
145 // GetCommandIdAt() must be implemented by subclasses. 145 // GetCommandIdAt() must be implemented by subclasses.
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 ui::MenuSeparatorType GetSeparatorTypeAt(int index) const OVERRIDE;
149 virtual string16 GetLabelAt(int index) const OVERRIDE; 150 virtual string16 GetLabelAt(int index) const OVERRIDE;
150 virtual bool IsItemDynamicAt(int index) const OVERRIDE; 151 virtual bool IsItemDynamicAt(int index) const OVERRIDE;
151 virtual const gfx::Font* GetLabelFontAt(int index) const OVERRIDE; 152 virtual const gfx::Font* GetLabelFontAt(int index) const OVERRIDE;
152 virtual bool GetAcceleratorAt(int index, 153 virtual bool GetAcceleratorAt(int index,
153 ui::Accelerator* accelerator) const OVERRIDE; 154 ui::Accelerator* accelerator) const OVERRIDE;
154 virtual bool IsItemCheckedAt(int index) const OVERRIDE; 155 virtual bool IsItemCheckedAt(int index) const OVERRIDE;
155 virtual int GetGroupIdAt(int index) const OVERRIDE; 156 virtual int GetGroupIdAt(int index) const OVERRIDE;
156 virtual bool GetIconAt(int index, gfx::Image* icon) OVERRIDE; 157 virtual bool GetIconAt(int index, gfx::Image* icon) OVERRIDE;
157 virtual ui::ButtonMenuItemModel* GetButtonMenuItemAt( 158 virtual ui::ButtonMenuItemModel* GetButtonMenuItemAt(
158 int index) const OVERRIDE; 159 int index) const OVERRIDE;
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 } 337 }
337 338
338 int NetworkMenuModel::GetItemCount() const { 339 int NetworkMenuModel::GetItemCount() const {
339 return static_cast<int>(menu_items_.size()); 340 return static_cast<int>(menu_items_.size());
340 } 341 }
341 342
342 ui::MenuModel::ItemType NetworkMenuModel::GetTypeAt(int index) const { 343 ui::MenuModel::ItemType NetworkMenuModel::GetTypeAt(int index) const {
343 return menu_items_[index].type; 344 return menu_items_[index].type;
344 } 345 }
345 346
347 ui::MenuSeparatorType NetworkMenuModel::GetSeparatorTypeAt(int index) const {
348 return ui::NORMAL_SEPARATOR;
349 }
350
346 string16 NetworkMenuModel::GetLabelAt(int index) const { 351 string16 NetworkMenuModel::GetLabelAt(int index) const {
347 return menu_items_[index].label; 352 return menu_items_[index].label;
348 } 353 }
349 354
350 bool NetworkMenuModel::IsItemDynamicAt(int index) const { 355 bool NetworkMenuModel::IsItemDynamicAt(int index) const {
351 return false; 356 return false;
352 } 357 }
353 358
354 const gfx::Font* NetworkMenuModel::GetLabelFontAt(int index) const { 359 const gfx::Font* NetworkMenuModel::GetLabelFontAt(int index) const {
355 const gfx::Font* font = NULL; 360 const gfx::Font* font = NULL;
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
1102 1107
1103 void NetworkMenu::ShowOtherWifi() { 1108 void NetworkMenu::ShowOtherWifi() {
1104 NetworkConfigView::ShowForType(TYPE_WIFI, delegate_->GetNativeWindow()); 1109 NetworkConfigView::ShowForType(TYPE_WIFI, delegate_->GetNativeWindow());
1105 } 1110 }
1106 1111
1107 void NetworkMenu::ShowOtherCellular() { 1112 void NetworkMenu::ShowOtherCellular() {
1108 ChooseMobileNetworkDialog::ShowDialog(delegate_->GetNativeWindow()); 1113 ChooseMobileNetworkDialog::ShowDialog(delegate_->GetNativeWindow());
1109 } 1114 }
1110 1115
1111 } // namespace chromeos 1116 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_context_menu_controller.cc ('k') | chrome/browser/download/download_shelf_context_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698