| 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 "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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 virtual bool HasIcons() const OVERRIDE; | 167 virtual bool HasIcons() const OVERRIDE; |
| 168 virtual int GetItemCount() const OVERRIDE; | 168 virtual int GetItemCount() const OVERRIDE; |
| 169 virtual ui::MenuModel::ItemType GetTypeAt(int index) const OVERRIDE; | 169 virtual ui::MenuModel::ItemType GetTypeAt(int index) const OVERRIDE; |
| 170 virtual string16 GetLabelAt(int index) const OVERRIDE; | 170 virtual string16 GetLabelAt(int index) const OVERRIDE; |
| 171 virtual bool IsItemDynamicAt(int index) const OVERRIDE; | 171 virtual bool IsItemDynamicAt(int index) const OVERRIDE; |
| 172 virtual const gfx::Font* GetLabelFontAt(int index) const OVERRIDE; | 172 virtual const gfx::Font* GetLabelFontAt(int index) const OVERRIDE; |
| 173 virtual bool GetAcceleratorAt(int index, | 173 virtual bool GetAcceleratorAt(int index, |
| 174 ui::Accelerator* accelerator) const OVERRIDE; | 174 ui::Accelerator* accelerator) const OVERRIDE; |
| 175 virtual bool IsItemCheckedAt(int index) const OVERRIDE; | 175 virtual bool IsItemCheckedAt(int index) const OVERRIDE; |
| 176 virtual int GetGroupIdAt(int index) const OVERRIDE; | 176 virtual int GetGroupIdAt(int index) const OVERRIDE; |
| 177 virtual bool GetIconAt(int index, SkBitmap* icon) OVERRIDE; | 177 virtual bool GetIconAt(int index, gfx::ImageSkia* icon) OVERRIDE; |
| 178 virtual ui::ButtonMenuItemModel* GetButtonMenuItemAt( | 178 virtual ui::ButtonMenuItemModel* GetButtonMenuItemAt( |
| 179 int index) const OVERRIDE; | 179 int index) const OVERRIDE; |
| 180 virtual bool IsEnabledAt(int index) const OVERRIDE; | 180 virtual bool IsEnabledAt(int index) const OVERRIDE; |
| 181 virtual bool IsVisibleAt(int index) const OVERRIDE; | 181 virtual bool IsVisibleAt(int index) const OVERRIDE; |
| 182 virtual ui::MenuModel* GetSubmenuModelAt(int index) const OVERRIDE; | 182 virtual ui::MenuModel* GetSubmenuModelAt(int index) const OVERRIDE; |
| 183 virtual void HighlightChangedTo(int index) OVERRIDE; | 183 virtual void HighlightChangedTo(int index) OVERRIDE; |
| 184 virtual void ActivatedAt(int index) OVERRIDE; | 184 virtual void ActivatedAt(int index) OVERRIDE; |
| 185 virtual void SetMenuModelDelegate(ui::MenuModelDelegate* delegate) OVERRIDE; | 185 virtual void SetMenuModelDelegate(ui::MenuModelDelegate* delegate) OVERRIDE; |
| 186 | 186 |
| 187 protected: | 187 protected: |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 | 462 |
| 463 bool NetworkMenuModel::IsItemCheckedAt(int index) const { | 463 bool NetworkMenuModel::IsItemCheckedAt(int index) const { |
| 464 // All ui::MenuModel::TYPE_CHECK menu items are checked. | 464 // All ui::MenuModel::TYPE_CHECK menu items are checked. |
| 465 return true; | 465 return true; |
| 466 } | 466 } |
| 467 | 467 |
| 468 int NetworkMenuModel::GetGroupIdAt(int index) const { | 468 int NetworkMenuModel::GetGroupIdAt(int index) const { |
| 469 return 0; | 469 return 0; |
| 470 } | 470 } |
| 471 | 471 |
| 472 bool NetworkMenuModel::GetIconAt(int index, SkBitmap* icon) { | 472 bool NetworkMenuModel::GetIconAt(int index, gfx::ImageSkia* icon) { |
| 473 if (!menu_items_[index].icon.empty()) { | 473 if (!menu_items_[index].icon.empty()) { |
| 474 *icon = menu_items_[index].icon; | 474 *icon = menu_items_[index].icon; |
| 475 return true; | 475 return true; |
| 476 } | 476 } |
| 477 return false; | 477 return false; |
| 478 } | 478 } |
| 479 | 479 |
| 480 ui::ButtonMenuItemModel* NetworkMenuModel::GetButtonMenuItemAt( | 480 ui::ButtonMenuItemModel* NetworkMenuModel::GetButtonMenuItemAt( |
| 481 int index) const { | 481 int index) const { |
| 482 return NULL; | 482 return NULL; |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1154 return ::ShouldHighlightNetwork(network); | 1154 return ::ShouldHighlightNetwork(network); |
| 1155 } | 1155 } |
| 1156 | 1156 |
| 1157 Browser* NetworkMenu::GetAppropriateBrowser() const { | 1157 Browser* NetworkMenu::GetAppropriateBrowser() const { |
| 1158 DCHECK(chromeos::UserManager::Get()->IsSessionStarted()); | 1158 DCHECK(chromeos::UserManager::Get()->IsSessionStarted()); |
| 1159 return browser::FindOrCreateTabbedBrowser( | 1159 return browser::FindOrCreateTabbedBrowser( |
| 1160 ProfileManager::GetDefaultProfileOrOffTheRecord()); | 1160 ProfileManager::GetDefaultProfileOrOffTheRecord()); |
| 1161 } | 1161 } |
| 1162 | 1162 |
| 1163 } // namespace chromeos | 1163 } // namespace chromeos |
| OLD | NEW |