| 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/resources/grit/ash_resources.h" | |
| 10 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 11 #include "ash/shell_delegate.h" | 10 #include "ash/shell_delegate.h" |
| 12 #include "ash/strings/grit/ash_strings.h" | 11 #include "ash/strings/grit/ash_strings.h" |
| 13 #include "ash/system/chromeos/network/network_connect.h" | 12 #include "ash/system/chromeos/network/network_connect.h" |
| 14 #include "base/bind.h" | 13 #include "base/bind.h" |
| 15 #include "base/logging.h" | 14 #include "base/logging.h" |
| 16 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
| 17 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 18 #include "chrome/browser/chromeos/mobile_config.h" | 17 #include "chrome/browser/chromeos/mobile_config.h" |
| 19 #include "chrome/browser/chromeos/options/network_config_view.h" | 18 #include "chrome/browser/chromeos/options/network_config_view.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 } // namespace | 67 } // namespace |
| 69 | 68 |
| 70 class NetworkMenuModel : public ui::MenuModel { | 69 class NetworkMenuModel : public ui::MenuModel { |
| 71 public: | 70 public: |
| 72 struct MenuItem { | 71 struct MenuItem { |
| 73 MenuItem() | 72 MenuItem() |
| 74 : type(ui::MenuModel::TYPE_SEPARATOR), | 73 : type(ui::MenuModel::TYPE_SEPARATOR), |
| 75 sub_menu_model(NULL), | 74 sub_menu_model(NULL), |
| 76 flags(0) { | 75 flags(0) { |
| 77 } | 76 } |
| 78 MenuItem(ui::MenuModel::ItemType type, base::string16 label, gfx::ImageSkia
icon, | 77 MenuItem(ui::MenuModel::ItemType type, |
| 79 const std::string& service_path, int flags) | 78 base::string16 label, |
| 79 gfx::ImageSkia icon, |
| 80 const std::string& service_path, |
| 81 int flags) |
| 80 : type(type), | 82 : type(type), |
| 81 label(label), | 83 label(label), |
| 82 icon(icon), | 84 icon(icon), |
| 83 service_path(service_path), | 85 service_path(service_path), |
| 84 sub_menu_model(NULL), | 86 sub_menu_model(NULL), |
| 85 flags(flags) { | 87 flags(flags) { |
| 86 } | 88 } |
| 87 MenuItem(ui::MenuModel::ItemType type, base::string16 label, gfx::ImageSkia
icon, | 89 MenuItem(ui::MenuModel::ItemType type, |
| 88 NetworkMenuModel* sub_menu_model, int flags) | 90 base::string16 label, |
| 91 gfx::ImageSkia icon, |
| 92 NetworkMenuModel* sub_menu_model, |
| 93 int flags) |
| 89 : type(type), | 94 : type(type), |
| 90 label(label), | 95 label(label), |
| 91 icon(icon), | 96 icon(icon), |
| 92 sub_menu_model(sub_menu_model), | 97 sub_menu_model(sub_menu_model), |
| 93 flags(flags) { | 98 flags(flags) { |
| 94 } | 99 } |
| 95 | 100 |
| 96 ui::MenuModel::ItemType type; | 101 ui::MenuModel::ItemType type; |
| 97 base::string16 label; | 102 base::string16 label; |
| 98 gfx::ImageSkia icon; | 103 gfx::ImageSkia icon; |
| (...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 return main_menu_model_.get(); | 674 return main_menu_model_.get(); |
| 670 } | 675 } |
| 671 | 676 |
| 672 void NetworkMenu::UpdateMenu() { | 677 void NetworkMenu::UpdateMenu() { |
| 673 refreshing_menu_ = true; | 678 refreshing_menu_ = true; |
| 674 main_menu_model_->InitMenuItems(delegate_->ShouldOpenButtonOptions()); | 679 main_menu_model_->InitMenuItems(delegate_->ShouldOpenButtonOptions()); |
| 675 refreshing_menu_ = false; | 680 refreshing_menu_ = false; |
| 676 } | 681 } |
| 677 | 682 |
| 678 } // namespace chromeos | 683 } // namespace chromeos |
| OLD | NEW |