| OLD | NEW | 
|    1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |    1 // Copyright (c) 2010 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_button.h" |    5 #include "chrome/browser/chromeos/status/network_menu_button.h" | 
|    6  |    6  | 
|    7 #include <limits> |    7 #include <limits> | 
|    8  |    8  | 
|    9 #include "app/l10n_util.h" |    9 #include "app/l10n_util.h" | 
|   10 #include "app/resource_bundle.h" |   10 #include "app/resource_bundle.h" | 
| (...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  476   if (!badge.empty()) |  476   if (!badge.empty()) | 
|  477     canvas.DrawBitmapInt(badge, kBadgeX, kBadgeY); |  477     canvas.DrawBitmapInt(badge, kBadgeX, kBadgeY); | 
|  478   return canvas.ExtractBitmap(); |  478   return canvas.ExtractBitmap(); | 
|  479 } |  479 } | 
|  480  |  480  | 
|  481 //////////////////////////////////////////////////////////////////////////////// |  481 //////////////////////////////////////////////////////////////////////////////// | 
|  482 // NetworkMenuButton, views::ViewMenuDelegate implementation: |  482 // NetworkMenuButton, views::ViewMenuDelegate implementation: | 
|  483  |  483  | 
|  484 void NetworkMenuButton::RunMenu(views::View* source, const gfx::Point& pt) { |  484 void NetworkMenuButton::RunMenu(views::View* source, const gfx::Point& pt) { | 
|  485   refreshing_menu_ = true; |  485   refreshing_menu_ = true; | 
|  486   CrosLibrary::Get()->GetNetworkLibrary()->RequestWifiScan(); |  486   NetworkLibrary* cros = CrosLibrary::Get()->GetNetworkLibrary(); | 
 |  487   cros->RequestWifiScan(); | 
 |  488   cros->UpdateSystemInfo(); | 
|  487   InitMenuItems(); |  489   InitMenuItems(); | 
|  488   network_menu_.Rebuild(); |  490   network_menu_.Rebuild(); | 
|  489   network_menu_.UpdateStates(); |  491   network_menu_.UpdateStates(); | 
|  490   refreshing_menu_ = false; |  492   refreshing_menu_ = false; | 
|  491   network_menu_.RunMenuAt(pt, views::Menu2::ALIGN_TOPRIGHT); |  493   network_menu_.RunMenuAt(pt, views::Menu2::ALIGN_TOPRIGHT); | 
|  492 } |  494 } | 
|  493  |  495  | 
|  494 void NetworkMenuButton::InitMenuItems() { |  496 void NetworkMenuButton::InitMenuItems() { | 
|  495   menu_items_.clear(); |  497   menu_items_.clear(); | 
|  496   // Populate our MenuItems with the current list of wifi networks. |  498   // Populate our MenuItems with the current list of wifi networks. | 
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  599     if (host_->ShouldOpenButtonOptions(this)) { |  601     if (host_->ShouldOpenButtonOptions(this)) { | 
|  600       label = |  602       label = | 
|  601           l10n_util::GetStringUTF16(IDS_STATUSBAR_NETWORK_OPEN_OPTIONS_DIALOG); |  603           l10n_util::GetStringUTF16(IDS_STATUSBAR_NETWORK_OPEN_OPTIONS_DIALOG); | 
|  602       menu_items_.push_back(MenuItem(menus::MenuModel::TYPE_COMMAND, label, |  604       menu_items_.push_back(MenuItem(menus::MenuModel::TYPE_COMMAND, label, | 
|  603           SkBitmap(), std::string(), FLAG_OPTIONS)); |  605           SkBitmap(), std::string(), FLAG_OPTIONS)); | 
|  604     } |  606     } | 
|  605   } |  607   } | 
|  606 } |  608 } | 
|  607  |  609  | 
|  608 }  // namespace chromeos |  610 }  // namespace chromeos | 
| OLD | NEW |