| 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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 if (!badge.empty()) | 407 if (!badge.empty()) |
| 408 canvas.DrawBitmapInt(badge, kBadgeX, kBadgeY); | 408 canvas.DrawBitmapInt(badge, kBadgeX, kBadgeY); |
| 409 return canvas.ExtractBitmap(); | 409 return canvas.ExtractBitmap(); |
| 410 } | 410 } |
| 411 | 411 |
| 412 //////////////////////////////////////////////////////////////////////////////// | 412 //////////////////////////////////////////////////////////////////////////////// |
| 413 // NetworkMenuButton, views::ViewMenuDelegate implementation: | 413 // NetworkMenuButton, views::ViewMenuDelegate implementation: |
| 414 | 414 |
| 415 void NetworkMenuButton::RunMenu(views::View* source, const gfx::Point& pt) { | 415 void NetworkMenuButton::RunMenu(views::View* source, const gfx::Point& pt) { |
| 416 refreshing_menu_ = true; | 416 refreshing_menu_ = true; |
| 417 CrosLibrary::Get()->GetNetworkLibrary()->RequestWifiScan(); | 417 NetworkLibrary* cros = CrosLibrary::Get()->GetNetworkLibrary(); |
| 418 cros->RequestWifiScan(); |
| 419 cros->UpdateSystemInfo(); |
| 418 InitMenuItems(); | 420 InitMenuItems(); |
| 419 network_menu_.Rebuild(); | 421 network_menu_.Rebuild(); |
| 420 network_menu_.UpdateStates(); | 422 network_menu_.UpdateStates(); |
| 421 refreshing_menu_ = false; | 423 refreshing_menu_ = false; |
| 422 network_menu_.RunMenuAt(pt, views::Menu2::ALIGN_TOPRIGHT); | 424 network_menu_.RunMenuAt(pt, views::Menu2::ALIGN_TOPRIGHT); |
| 423 } | 425 } |
| 424 | 426 |
| 425 void NetworkMenuButton::InitMenuItems() { | 427 void NetworkMenuButton::InitMenuItems() { |
| 426 menu_items_.clear(); | 428 menu_items_.clear(); |
| 427 // Populate our MenuItems with the current list of wifi networks. | 429 // Populate our MenuItems with the current list of wifi networks. |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 if (host_->ShouldOpenButtonOptions(this)) { | 532 if (host_->ShouldOpenButtonOptions(this)) { |
| 531 label = | 533 label = |
| 532 l10n_util::GetStringUTF16(IDS_STATUSBAR_NETWORK_OPEN_OPTIONS_DIALOG); | 534 l10n_util::GetStringUTF16(IDS_STATUSBAR_NETWORK_OPEN_OPTIONS_DIALOG); |
| 533 menu_items_.push_back(MenuItem(menus::MenuModel::TYPE_COMMAND, label, | 535 menu_items_.push_back(MenuItem(menus::MenuModel::TYPE_COMMAND, label, |
| 534 SkBitmap(), std::string(), FLAG_OPTIONS)); | 536 SkBitmap(), std::string(), FLAG_OPTIONS)); |
| 535 } | 537 } |
| 536 } | 538 } |
| 537 } | 539 } |
| 538 | 540 |
| 539 } // namespace chromeos | 541 } // namespace chromeos |
| OLD | NEW |