diff options
author | chocobo@chromium.org <chocobo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-03 19:42:25 +0000 |
---|---|---|
committer | chocobo@chromium.org <chocobo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-03 19:42:25 +0000 |
commit | 97d1717dd55afba5e35b2d8a7ef5ff012d0362d3 (patch) | |
tree | bff935a72f699c9549e7fdf087d994e8b0e74dbe /chrome | |
parent | 019bdb35de42b18558aebfdf97dd661f37d80c1b (diff) | |
download | chromium_src-97d1717dd55afba5e35b2d8a7ef5ff012d0362d3.zip chromium_src-97d1717dd55afba5e35b2d8a7ef5ff012d0362d3.tar.gz chromium_src-97d1717dd55afba5e35b2d8a7ef5ff012d0362d3.tar.bz2 |
Change network connection dialog to not use tabbed panes. Cleanup old views code that we are no longer using.
BUG=chromium-os:9226
TEST=manual. open network connections from menu and options page to make sure everything still works. Also test oobe and login.
Review URL: http://codereview.chromium.org/5581004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68197 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/chromeos/dom_ui/internet_options_handler.cc | 13 | ||||
-rw-r--r-- | chrome/browser/chromeos/network_message_observer.cc | 2 | ||||
-rw-r--r-- | chrome/browser/chromeos/options/cellular_config_view.cc | 227 | ||||
-rw-r--r-- | chrome/browser/chromeos/options/cellular_config_view.h | 68 | ||||
-rw-r--r-- | chrome/browser/chromeos/options/internet_page_view.cc | 16 | ||||
-rw-r--r-- | chrome/browser/chromeos/options/ip_config_view.cc | 92 | ||||
-rw-r--r-- | chrome/browser/chromeos/options/ip_config_view.h | 47 | ||||
-rw-r--r-- | chrome/browser/chromeos/options/network_config_view.cc | 148 | ||||
-rw-r--r-- | chrome/browser/chromeos/options/network_config_view.h | 48 | ||||
-rw-r--r-- | chrome/browser/chromeos/options/wifi_config_view.cc | 37 | ||||
-rw-r--r-- | chrome/browser/chromeos/options/wifi_config_view.h | 8 | ||||
-rw-r--r-- | chrome/browser/chromeos/options/wifi_config_view_browsertest.cc | 62 | ||||
-rw-r--r-- | chrome/browser/chromeos/status/network_menu.cc | 54 | ||||
-rw-r--r-- | chrome/browser/chromeos/status/network_menu.h | 6 | ||||
-rw-r--r-- | chrome/chrome_browser.gypi | 4 | ||||
-rw-r--r-- | chrome/chrome_tests.gypi | 1 |
16 files changed, 49 insertions, 784 deletions
diff --git a/chrome/browser/chromeos/dom_ui/internet_options_handler.cc b/chrome/browser/chromeos/dom_ui/internet_options_handler.cc index d6a5747..9e8077b 100644 --- a/chrome/browser/chromeos/dom_ui/internet_options_handler.cc +++ b/chrome/browser/chromeos/dom_ui/internet_options_handler.cc @@ -774,14 +774,12 @@ void InternetOptionsHandler::HandleWifiButtonClick( cros->ForgetWifiNetwork(service_path); } else if (!use_settings_ui_ && service_path == kOtherNetworksFakePath) { // Other wifi networks. - chromeos::NetworkConfigView* view = - new chromeos::NetworkConfigView(); - CreateModalPopup(view); - view->SetLoginTextfieldFocus(); + CreateModalPopup(new chromeos::NetworkConfigView()); } else if ((network = cros->FindWifiNetworkByPath(service_path))) { if (command == "connect") { // Connect to wifi here. Open password page if appropriate. - if (network->encrypted() && !network->auto_connect()) { + if (network->encrypted() && !network->auto_connect() && + !network->IsCertificateLoaded()) { if (use_settings_ui_) { if (network->encryption() == chromeos::SECURITY_8021X) { PopulateDictionaryDetails(network, cros); @@ -792,10 +790,7 @@ void InternetOptionsHandler::HandleWifiButtonClick( L"options.InternetOptions.showPasswordEntry", dictionary); } } else { - chromeos::NetworkConfigView* view = - new chromeos::NetworkConfigView(network, true); - CreateModalPopup(view); - view->SetLoginTextfieldFocus(); + CreateModalPopup(new chromeos::NetworkConfigView(network)); } } else { cros->ConnectToWifiNetwork( diff --git a/chrome/browser/chromeos/network_message_observer.cc b/chrome/browser/chromeos/network_message_observer.cc index bb10db2..872dc73 100644 --- a/chrome/browser/chromeos/network_message_observer.cc +++ b/chrome/browser/chromeos/network_message_observer.cc @@ -132,7 +132,7 @@ void NetworkMessageObserver::OnNetworkManagerChanged(NetworkLibrary* obj) { if (wifi->error() == ERROR_BAD_PASSPHRASE || wifi->error() == ERROR_BAD_WEPKEY) { // The NetworkConfigView will show the appropriate error message. - view = new NetworkConfigView(wifi, true); + view = new NetworkConfigView(wifi); // There should only be one wifi network that failed to connect. // If for some reason, we have more than one failure, // we only display the first one. So we break here. diff --git a/chrome/browser/chromeos/options/cellular_config_view.cc b/chrome/browser/chromeos/options/cellular_config_view.cc deleted file mode 100644 index be919e9..0000000 --- a/chrome/browser/chromeos/options/cellular_config_view.cc +++ /dev/null @@ -1,227 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/chromeos/options/cellular_config_view.h" - -#include "app/l10n_util.h" -#include "base/i18n/time_formatting.h" -#include "base/time.h" -#include "base/utf_string_conversions.h" -#include "chrome/browser/chromeos/cros/cros_library.h" -#include "chrome/browser/chromeos/options/network_config_view.h" -#include "chrome/common/time_format.h" -#include "grit/generated_resources.h" -#include "views/controls/button/checkbox.h" -#include "views/controls/button/native_button.h" -#include "views/controls/label.h" -#include "views/grid_layout.h" -#include "views/standard_layout.h" - -namespace { - -enum PlanPurchaseType { - UNKNOWN, - NO_PURCHASE, // No purchase happened. - PURCHASED_DATA, // Purchased limited data plan. - PURCHASED_UNLIMITED_DATA // Purchased unlimited data plan. -}; - -struct PlanDetails { - PlanPurchaseType last_purchase_type; - base::Time last_purchase_time; - - int64 purchased_data; - base::TimeDelta purchased_time; - - int64 remaining_data; - base::TimeDelta remaining_time; -}; - -// TODO(xiyuan): Get real data from libcros when it's ready. -// Get plan details at the time being called. -void GetPlanDetails(const chromeos::CellularNetwork* cellular, - PlanDetails* details) { - // Free 5M 30day plan. - details->last_purchase_type = UNKNOWN; - details->last_purchase_time = base::Time::Now(); - details->purchased_data = 5 * 1024 * 1024; - details->purchased_time = base::TimeDelta::FromDays(30); - details->remaining_data = 2 * 1024 * 1024; - details->remaining_time = base::TimeDelta::FromDays(29); -} - -} // namespace - -namespace chromeos { - -CellularConfigView::CellularConfigView(NetworkConfigView* parent, - const CellularNetwork* cellular) - : parent_(parent), - cellular_(new CellularNetwork(*cellular)), - purchase_info_(NULL), - purchase_more_button_(NULL), - remaining_data_info_(NULL), - expiration_info_(NULL), - show_notification_checkbox_(NULL), - autoconnect_checkbox_(NULL), - customer_support_link_(NULL) { - Init(); -} - -CellularConfigView::~CellularConfigView() { -} - -void CellularConfigView::ButtonPressed(views::Button* button, - const views::Event& event) { - if (button == purchase_more_button_) { - // TODO(xiyuan): Purchase more... - } -} - -void CellularConfigView::LinkActivated(views::Link* source, int event_flags) { - if (source == customer_support_link_) { - // TODO(xiyuan): Find out where to go. - } -} - -bool CellularConfigView::Save() { - // Save auto-connect here. - bool auto_connect = autoconnect_checkbox_->checked(); - if (auto_connect != cellular_->auto_connect()) { - cellular_->set_auto_connect(auto_connect); - CrosLibrary::Get()->GetNetworkLibrary()->SaveCellularNetwork( - cellular_.get()); - } - return true; -} - -void CellularConfigView::Init() { - views::GridLayout* layout = CreatePanelGridLayout(this); - SetLayoutManager(layout); - - purchase_info_ = new views::Label(); - purchase_more_button_ = new views::NativeButton(this, l10n_util::GetString( - IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_PURCHASE_MORE)); - views::Label* data_remaining_label = new views::Label(l10n_util::GetString( - IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_DATA_REMAINING)); - remaining_data_info_ = new views::Label(); - views::Label* expires_label = new views::Label(l10n_util::GetString( - IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_EXPIRES)); - expiration_info_ = new views::Label(); - show_notification_checkbox_ = new views::Checkbox(l10n_util::GetString( - IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_SHOW_MOBILE_NOTIFICATION)); - autoconnect_checkbox_ = new views::Checkbox(l10n_util::GetString( - IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_AUTO_CONNECT)); - customer_support_link_ = new views::Link(l10n_util::GetString( - IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_CUSTOMER_SUPPORT)); - - data_remaining_label->SetFont(data_remaining_label->font().DeriveFont(0, - gfx::Font::BOLD)); - expires_label->SetFont(data_remaining_label->font()); - - const int kColumnSetId = 0; - views::ColumnSet* column_set = layout->AddColumnSet(kColumnSetId); - column_set->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 1, - views::GridLayout::USE_PREF, 0, 0); - column_set->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 1, - views::GridLayout::USE_PREF, 0, 0); - column_set->AddColumn(views::GridLayout::TRAILING, views::GridLayout::FILL, 1, - views::GridLayout::USE_PREF, 0, 0); - - layout->StartRow(0, kColumnSetId); - layout->AddView(purchase_info_, 2, 1); - layout->AddView(purchase_more_button_); - layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); - - layout->StartRow(0, kColumnSetId); - layout->AddView(data_remaining_label); - layout->AddView(remaining_data_info_, 2, 1); - layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); - - layout->StartRow(0, kColumnSetId); - layout->AddView(expires_label); - layout->AddView(expiration_info_, 2, 1); - layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); - - layout->StartRow(0, kColumnSetId); - layout->AddView(show_notification_checkbox_, 3, 1); - layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); - - layout->StartRow(0, kColumnSetId); - layout->AddView(autoconnect_checkbox_, 3, 1); - layout->AddPaddingRow(0, kUnrelatedControlVerticalSpacing); - - layout->StartRow(0, kColumnSetId); - layout->AddView(customer_support_link_, 3, 1, - views::GridLayout::LEADING, views::GridLayout::TRAILING); - layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); - - Update(); -} - -void CellularConfigView::Update() { - autoconnect_checkbox_->SetChecked(cellular_->auto_connect()); - - PlanDetails details; - GetPlanDetails(cellular_.get(), &details); - - switch (details.last_purchase_type) { - case NO_PURCHASE: - purchase_info_->SetText(l10n_util::GetStringF( - IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_RECEIVED_FREE_DATA, - UTF16ToWide(FormatBytes(details.purchased_data, - GetByteDisplayUnits(details.purchased_data), - true)), - base::TimeFormatFriendlyDate(details.last_purchase_time))); - remaining_data_info_->SetText( - UTF16ToWide(FormatBytes(details.remaining_data, - GetByteDisplayUnits(details.remaining_data), - true))); - expiration_info_->SetText(UTF16ToWide( - TimeFormat::TimeRemaining(details.remaining_time))); - break; - case PURCHASED_DATA: - purchase_info_->SetText(l10n_util::GetStringF( - IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_PURCHASE_DATA, - UTF16ToWide(FormatBytes(details.purchased_data, - GetByteDisplayUnits(details.purchased_data), - true)), - base::TimeFormatFriendlyDate(details.last_purchase_time))); - remaining_data_info_->SetText( - UTF16ToWide(FormatBytes(details.remaining_data, - GetByteDisplayUnits(details.remaining_data), - true))); - expiration_info_->SetText(UTF16ToWide( - TimeFormat::TimeRemaining(details.remaining_time))); - break; - case PURCHASED_UNLIMITED_DATA: - purchase_info_->SetText(l10n_util::GetStringF( - IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_PURCHASE_UNLIMITED_DATA, - UTF16ToWide(FormatBytes(details.purchased_data, - GetByteDisplayUnits(details.purchased_data), - true)), - base::TimeFormatFriendlyDate(details.last_purchase_time))); - remaining_data_info_->SetText(l10n_util::GetString( - IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_UNLIMITED)); - expiration_info_->SetText(UTF16ToWide( - TimeFormat::TimeRemaining(details.remaining_time))); - break; - case UNKNOWN: { - // TODO(xiyuan): Remove this when underlying data is provided. - const wchar_t kPlanType[] = L"Purchased plan: <Not yet implemented>"; - const wchar_t kNotImplemented[] = L"<Not yet implemented>"; - purchase_info_->SetText(kPlanType); - remaining_data_info_->SetText(kNotImplemented); - expiration_info_->SetText(kNotImplemented); - break; - } - default: - NOTREACHED() << "Unknown mobile plan purchase type."; - break; - } - - Layout(); -} - -} // namespace chromeos diff --git a/chrome/browser/chromeos/options/cellular_config_view.h b/chrome/browser/chromeos/options/cellular_config_view.h deleted file mode 100644 index 36e64ed..0000000 --- a/chrome/browser/chromeos/options/cellular_config_view.h +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_CHROMEOS_OPTIONS_CELLULAR_CONFIG_VIEW_H_ -#define CHROME_BROWSER_CHROMEOS_OPTIONS_CELLULAR_CONFIG_VIEW_H_ -#pragma once - -#include "chrome/browser/chromeos/cros/network_library.h" -#include "views/controls/button/button.h" -#include "views/controls/link.h" -#include "views/view.h" - -namespace views { -class Checkbox; -class Label; -class NativeButton; -} // namespace views - -namespace chromeos { - -class NetworkConfigView; - -// A dialog box for showing a password textfield. -class CellularConfigView : public views::View, - public views::ButtonListener, - public views::LinkController { - public: - CellularConfigView(NetworkConfigView* parent, - const CellularNetwork* cellular); - explicit CellularConfigView(NetworkConfigView* parent); - virtual ~CellularConfigView(); - - // views::ButtonListener implementation. - virtual void ButtonPressed(views::Button* button, const views::Event& event); - - // views::LinkController implementation. - virtual void LinkActivated(views::Link* source, int event_flags); - - // Save network information. - virtual bool Save(); - - private: - - // Initializes UI. - void Init(); - - // Updates UI. - void Update(); - - NetworkConfigView* parent_; - - scoped_ptr<CellularNetwork> cellular_; - - views::Label* purchase_info_; - views::NativeButton* purchase_more_button_; - views::Label* remaining_data_info_; - views::Label* expiration_info_; - views::Checkbox* show_notification_checkbox_; - views::Checkbox* autoconnect_checkbox_; - views::Link* customer_support_link_; - - DISALLOW_COPY_AND_ASSIGN(CellularConfigView); -}; - -} // namespace chromeos - -#endif // CHROME_BROWSER_CHROMEOS_OPTIONS_CELLULAR_CONFIG_VIEW_H_ diff --git a/chrome/browser/chromeos/options/internet_page_view.cc b/chrome/browser/chromeos/options/internet_page_view.cc index 51dc7c1..bf5d77e 100644 --- a/chrome/browser/chromeos/options/internet_page_view.cc +++ b/chrome/browser/chromeos/options/internet_page_view.cc @@ -272,8 +272,8 @@ void WiredSection::InitSection() { } void WiredSection::ButtonClicked(int button, int connection_type, int id) { - CreateModalPopup(new NetworkConfigView( - CrosLibrary::Get()->GetNetworkLibrary()->ethernet_network())); +// CreateModalPopup(new NetworkConfigView( +// CrosLibrary::Get()->GetNetworkLibrary()->ethernet_network())); } //////////////////////////////////////////////////////////////////////////////// @@ -361,7 +361,7 @@ void WirelessSection::ButtonClicked(int button, int connection_type, int id) { CrosLibrary::Get()->GetNetworkLibrary()->DisconnectFromWirelessNetwork( cellular_networks_[id]); } else { - CreateModalPopup(new NetworkConfigView(cellular_networks_[id])); +// CreateModalPopup(new NetworkConfigView(cellular_networks_[id])); } } } else if (connection_type == TYPE_WIFI) { @@ -369,10 +369,10 @@ void WirelessSection::ButtonClicked(int button, int connection_type, int id) { if (button == CONNECT_BUTTON) { // Connect to wifi here. Open password page if appropriate. if (wifi_networks_[id]->encrypted()) { - NetworkConfigView* view = - new NetworkConfigView(wifi_networks_[id], true); - CreateModalPopup(view); - view->SetLoginTextfieldFocus(); +// NetworkConfigView* view = +// new NetworkConfigView(wifi_networks_[id], true); +// CreateModalPopup(view); +// view->SetLoginTextfieldFocus(); } else { CrosLibrary::Get()->GetNetworkLibrary()->ConnectToWifiNetwork( wifi_networks_[id], std::string(), std::string(), std::string()); @@ -381,7 +381,7 @@ void WirelessSection::ButtonClicked(int button, int connection_type, int id) { CrosLibrary::Get()->GetNetworkLibrary()->DisconnectFromWirelessNetwork( wifi_networks_[id]); } else { - CreateModalPopup(new NetworkConfigView(wifi_networks_[id], false)); +// CreateModalPopup(new NetworkConfigView(wifi_networks_[id], false)); } } } else { diff --git a/chrome/browser/chromeos/options/ip_config_view.cc b/chrome/browser/chromeos/options/ip_config_view.cc deleted file mode 100644 index b4cfbb1..0000000 --- a/chrome/browser/chromeos/options/ip_config_view.cc +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/chromeos/options/ip_config_view.h" - -#include "app/l10n_util.h" -#include "base/string_util.h" -#include "base/utf_string_conversions.h" -#include "chrome/browser/chromeos/cros/cros_library.h" -#include "grit/chromium_strings.h" -#include "grit/generated_resources.h" -#include "grit/locale_settings.h" -#include "views/controls/label.h" -#include "views/controls/textfield/textfield.h" -#include "views/grid_layout.h" -#include "views/standard_layout.h" -#include "views/window/window.h" - -namespace chromeos { - -IPConfigView::IPConfigView(const std::string& device_path) - : device_path_(device_path), - ip_configs_(), - address_textfield_(NULL), - netmask_textfield_(NULL), - gateway_textfield_(NULL), - dnsserver_textfield_(NULL) { - Init(); - RefreshData(); -} - -void IPConfigView::RefreshData() { - std::string hardware_address; - NetworkIPConfigVector ipconfigs = - CrosLibrary::Get()->GetNetworkLibrary()->GetIPConfigs(device_path_, - &hardware_address); - for (NetworkIPConfigVector::const_iterator it = ipconfigs.begin(); - it != ipconfigs.end(); ++it) { - const NetworkIPConfig& ipconfig = *it; - address_textfield_->SetText(ASCIIToUTF16(ipconfig.address)); - netmask_textfield_->SetText(ASCIIToUTF16(ipconfig.netmask)); - gateway_textfield_->SetText(ASCIIToUTF16(ipconfig.gateway)); - dnsserver_textfield_->SetText(ASCIIToUTF16(ipconfig.name_servers)); - } -} - -void IPConfigView::Init() { - views::GridLayout* layout = CreatePanelGridLayout(this); - SetLayoutManager(layout); - - int column_view_set_id = 0; - views::ColumnSet* column_set = layout->AddColumnSet(column_view_set_id); - column_set->AddColumn(views::GridLayout::LEADING, views::GridLayout::FILL, 1, - views::GridLayout::USE_PREF, 0, 0); - column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, - views::GridLayout::USE_PREF, 0, 200); - - layout->StartRow(0, column_view_set_id); - layout->AddView(new views::Label(l10n_util::GetString( - IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_ADDRESS))); - address_textfield_ = new views::Textfield(views::Textfield::STYLE_DEFAULT); - address_textfield_->SetEnabled(false); - layout->AddView(address_textfield_); - layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); - - layout->StartRow(0, column_view_set_id); - layout->AddView(new views::Label(l10n_util::GetString( - IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_SUBNETMASK))); - netmask_textfield_ = new views::Textfield(views::Textfield::STYLE_DEFAULT); - netmask_textfield_->SetEnabled(false); - layout->AddView(netmask_textfield_); - layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); - - layout->StartRow(0, column_view_set_id); - layout->AddView(new views::Label(l10n_util::GetString( - IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_GATEWAY))); - gateway_textfield_ = new views::Textfield(views::Textfield::STYLE_DEFAULT); - gateway_textfield_->SetEnabled(false); - layout->AddView(gateway_textfield_); - layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); - - layout->StartRow(0, column_view_set_id); - layout->AddView(new views::Label(l10n_util::GetString( - IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_DNSSERVER))); - dnsserver_textfield_ = new views::Textfield(views::Textfield::STYLE_DEFAULT); - dnsserver_textfield_->SetEnabled(false); - layout->AddView(dnsserver_textfield_); - layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); -} - -} // namespace chromeos diff --git a/chrome/browser/chromeos/options/ip_config_view.h b/chrome/browser/chromeos/options/ip_config_view.h deleted file mode 100644 index c09fcc3..0000000 --- a/chrome/browser/chromeos/options/ip_config_view.h +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_CHROMEOS_OPTIONS_IP_CONFIG_VIEW_H_ -#define CHROME_BROWSER_CHROMEOS_OPTIONS_IP_CONFIG_VIEW_H_ -#pragma once - -#include <string> - -#include "chrome/browser/chromeos/cros/network_library.h" -#include "views/view.h" - -namespace views { -class Textfield; -} - -namespace chromeos { - -// A dialog box for showing a password textfield. -class IPConfigView : public views::View { - public: - explicit IPConfigView(const std::string& device_path); - virtual ~IPConfigView() {} - - private: - // Refreshes IP Config data. - void RefreshData(); - // Initializes UI. - void Init(); - - // The device path of the network. - std::string device_path_; - - NetworkIPConfigVector ip_configs_; - - views::Textfield* address_textfield_; - views::Textfield* netmask_textfield_; - views::Textfield* gateway_textfield_; - views::Textfield* dnsserver_textfield_; - - DISALLOW_COPY_AND_ASSIGN(IPConfigView); -}; - -} // namespace chromeos - -#endif // CHROME_BROWSER_CHROMEOS_OPTIONS_IP_CONFIG_VIEW_H_ diff --git a/chrome/browser/chromeos/options/network_config_view.cc b/chrome/browser/chromeos/options/network_config_view.cc index fa9fe74..c35be1a 100644 --- a/chrome/browser/chromeos/options/network_config_view.cc +++ b/chrome/browser/chromeos/options/network_config_view.cc @@ -4,11 +4,11 @@ #include "chrome/browser/chromeos/options/network_config_view.h" +#include <algorithm> + #include "app/l10n_util.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" -#include "chrome/browser/chromeos/options/cellular_config_view.h" -#include "chrome/browser/chromeos/options/ip_config_view.h" #include "chrome/browser/chromeos/options/wifi_config_view.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -22,69 +22,35 @@ using views::WidgetGtk; namespace chromeos { -NetworkConfigView::NetworkConfigView(const EthernetNetwork* ethernet) - : browser_mode_(true), - flags_(FLAG_ETHERNET | FLAG_SHOW_IPCONFIG), - ethernet_(new EthernetNetwork(*ethernet)), - cellularconfig_view_(NULL), - wificonfig_view_(NULL), - ipconfig_view_(NULL), - delegate_(NULL) { -} - -NetworkConfigView::NetworkConfigView(const WifiNetwork* wifi, bool login_only) - : browser_mode_(true), - flags_(FLAG_WIFI), - wifi_(new WifiNetwork(*wifi)), - cellularconfig_view_(NULL), - wificonfig_view_(NULL), - ipconfig_view_(NULL), - delegate_(NULL) { - if (login_only) - flags_ |= FLAG_LOGIN_ONLY; - else - flags_ |= FLAG_SHOW_IPCONFIG; -} - -NetworkConfigView::NetworkConfigView(const CellularNetwork* cellular) +NetworkConfigView::NetworkConfigView(const WifiNetwork* wifi) : browser_mode_(true), - flags_(FLAG_CELLULAR | FLAG_SHOW_IPCONFIG), - cellular_(new CellularNetwork(*cellular)), - cellularconfig_view_(NULL), - wificonfig_view_(NULL), - ipconfig_view_(NULL), + title_(ASCIIToWide(wifi->name())), + wificonfig_view_(new WifiConfigView(this, wifi)), delegate_(NULL) { } NetworkConfigView::NetworkConfigView() : browser_mode_(true), - flags_(FLAG_WIFI | FLAG_LOGIN_ONLY | FLAG_OTHER_NETWORK), - cellularconfig_view_(NULL), - wificonfig_view_(NULL), - ipconfig_view_(NULL), + title_(l10n_util::GetString(IDS_OPTIONS_SETTINGS_OTHER_NETWORKS)), + wificonfig_view_(new WifiConfigView(this)), delegate_(NULL) { } -NetworkConfigView::~NetworkConfigView() { -} - gfx::NativeWindow NetworkConfigView::GetNativeWindow() const { return GTK_WINDOW(static_cast<WidgetGtk*>(GetWidget())->GetNativeView()); } std::wstring NetworkConfigView::GetDialogButtonLabel( MessageBoxFlags::DialogButton button) const { - if (button == MessageBoxFlags::DIALOGBUTTON_OK) { - if (flags_ & FLAG_LOGIN_ONLY) - return l10n_util::GetString(IDS_OPTIONS_SETTINGS_CONNECT); - } + if (button == MessageBoxFlags::DIALOGBUTTON_OK) + return l10n_util::GetString(IDS_OPTIONS_SETTINGS_CONNECT); return std::wstring(); } bool NetworkConfigView::IsDialogButtonEnabled( MessageBoxFlags::DialogButton button) const { - // For login dialogs, disable ok button if nothing entered in text fields. - if (flags_ & FLAG_LOGIN_ONLY && button == MessageBoxFlags::DIALOGBUTTON_OK) + // Disable connect button if cannot login. + if (button == MessageBoxFlags::DIALOGBUTTON_OK) return wificonfig_view_->can_login(); return true; } @@ -92,48 +58,23 @@ bool NetworkConfigView::IsDialogButtonEnabled( bool NetworkConfigView::Cancel() { if (delegate_) delegate_->OnDialogCancelled(); - if (flags_ & FLAG_WIFI) - wificonfig_view_->Cancel(); + wificonfig_view_->Cancel(); return true; } bool NetworkConfigView::Accept() { - bool result = true; - if (flags_ & FLAG_CELLULAR) { - result = cellularconfig_view_->Save(); - } - if (flags_ & FLAG_WIFI) { - if (flags_ & FLAG_LOGIN_ONLY) - result = wificonfig_view_->Login(); - else - result = wificonfig_view_->Save(); - } + bool result = wificonfig_view_->Login(); if (result && delegate_) delegate_->OnDialogAccepted(); return result; } std::wstring NetworkConfigView::GetWindowTitle() const { - if (flags_ & FLAG_OTHER_NETWORK) - return l10n_util::GetString(IDS_OPTIONS_SETTINGS_OTHER_NETWORKS); - if (flags_ & FLAG_WIFI) - return ASCIIToWide(wifi_->name()); - if (flags_ & FLAG_CELLULAR) - return ASCIIToWide(cellular_->name()); - return l10n_util::GetString(IDS_STATUSBAR_NETWORK_DEVICE_ETHERNET); -} - -void NetworkConfigView::TabSelectedAt(int index) { -} - -void NetworkConfigView::SetLoginTextfieldFocus() { - if (wificonfig_view_) - wificonfig_view_->FocusFirstField(); + return title_; } void NetworkConfigView::Layout() { - static const int kDialogBottomPadding = 7; - tabs_->SetBounds(0, 0, width(), height() - kDialogBottomPadding); + wificonfig_view_->SetBounds(0, 0, width(), height()); } gfx::Size NetworkConfigView::GetPreferredSize() { @@ -141,28 +82,7 @@ gfx::Size NetworkConfigView::GetPreferredSize() { gfx::Size result(views::Window::GetLocalizedContentsSize( IDS_IMPORT_DIALOG_WIDTH_CHARS, IDS_IMPORT_DIALOG_HEIGHT_LINES)); - result.set_height(0); // IMPORT_DIALOG height is too large - // Expand the default size to fit results if necessary - if (cellularconfig_view_) { - gfx::Size s = cellularconfig_view_->GetPreferredSize(); - s.set_height(s.height() + kPanelVertMargin * 2); - s.set_width(s.width() + kPanelHorizMargin * 2); - result = gfx::Size(std::max(result.width(), s.width()), - std::max(result.height(), s.height())); - } else if (wificonfig_view_) { - gfx::Size s = wificonfig_view_->GetPreferredSize(); - s.set_height(s.height() + kPanelVertMargin * 2); - s.set_width(s.width() + kPanelHorizMargin * 2); - result = gfx::Size(std::max(result.width(), s.width()), - std::max(result.height(), s.height())); - } - if (ipconfig_view_) { - gfx::Size s = ipconfig_view_->GetPreferredSize(); - s.set_height(s.height() + kPanelVertMargin * 2); - s.set_width(s.width() + kPanelHorizMargin * 2); - result = gfx::Size(std::max(result.width(), s.width()), - std::max(result.height(), s.height())); - } + result.set_height(wificonfig_view_->GetPreferredSize().height()); return result; } @@ -171,41 +91,7 @@ void NetworkConfigView::ViewHierarchyChanged( // Can't init before we're inserted into a Container, because we require // a HWND to parent native child controls to. if (is_add && child == this) - Init(); -} - -void NetworkConfigView::Init() { - tabs_ = new views::TabbedPane(); - tabs_->SetListener(this); - AddChildView(tabs_); - - if (flags_ & FLAG_CELLULAR) { - cellularconfig_view_ = new CellularConfigView(this, cellular_.get()); - tabs_->AddTab( - l10n_util::GetString(IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_USAGE), - cellularconfig_view_); - } - if (flags_ & FLAG_WIFI) { - if (flags_ & FLAG_OTHER_NETWORK) - wificonfig_view_ = new WifiConfigView(this); - else - wificonfig_view_ = new WifiConfigView(this, wifi_.get()); - tabs_->AddTab( - l10n_util::GetString(IDS_OPTIONS_SETTINGS_SECTION_TITLE_NETWORK_CONFIG), - wificonfig_view_); - } - - if (flags_ & FLAG_SHOW_IPCONFIG) { - if (flags_ & FLAG_WIFI) - ipconfig_view_ = new IPConfigView(wifi_->device_path()); - else if (flags_ & FLAG_CELLULAR) - ipconfig_view_ = new IPConfigView(cellular_->device_path()); - else - ipconfig_view_ = new IPConfigView(ethernet_->device_path()); - tabs_->AddTab( - l10n_util::GetString(IDS_OPTIONS_SETTINGS_SECTION_TITLE_IP_CONFIG), - ipconfig_view_); - } + AddChildView(wificonfig_view_); } } // namespace chromeos diff --git a/chrome/browser/chromeos/options/network_config_view.h b/chrome/browser/chromeos/options/network_config_view.h index b6f13be..aec302a 100644 --- a/chrome/browser/chromeos/options/network_config_view.h +++ b/chrome/browser/chromeos/options/network_config_view.h @@ -6,8 +6,6 @@ #define CHROME_BROWSER_CHROMEOS_OPTIONS_NETWORK_CONFIG_VIEW_H_ #pragma once -#include <string> - #include "chrome/browser/chromeos/cros/network_library.h" #include "views/controls/tabbed_pane/tabbed_pane.h" #include "views/window/dialog_delegate.h" @@ -20,14 +18,11 @@ class Window; namespace chromeos { -class IPConfigView; -class CellularConfigView; class WifiConfigView; // A dialog box for showing a password textfield. class NetworkConfigView : public views::View, - public views::DialogDelegate, - views::TabbedPane::Listener { + public views::DialogDelegate { public: class Delegate { public: @@ -41,15 +36,11 @@ class NetworkConfigView : public views::View, virtual ~Delegate() {} }; - // Configure dialog for ethernet. - explicit NetworkConfigView(const EthernetNetwork* ethernet); - // Configure dialog for wifi. If |login_only|, then only show login tab. - explicit NetworkConfigView(const WifiNetwork* wifi, bool login_only); - // Configure dialog for cellular. - explicit NetworkConfigView(const CellularNetwork* cellular); + // Login dialog for wifi. + explicit NetworkConfigView(const WifiNetwork* wifi); // Login dialog for hidden networks. explicit NetworkConfigView(); - virtual ~NetworkConfigView(); + virtual ~NetworkConfigView() {} // Returns corresponding native window. gfx::NativeWindow GetNativeWindow() const; @@ -69,12 +60,6 @@ class NetworkConfigView : public views::View, // views::View overrides. virtual std::wstring GetWindowTitle() const; - // views::TabbedPane::Listener overrides. - virtual void TabSelectedAt(int index); - - // Sets the focus on the login tab's first textfield. - void SetLoginTextfieldFocus(); - // Getter/setter for browser mode. void set_browser_mode(bool value) { browser_mode_ = value; @@ -96,33 +81,14 @@ class NetworkConfigView : public views::View, views::View* child); private: - enum NetworkConfigFlags { - FLAG_ETHERNET = 1 << 0, - FLAG_WIFI = 1 << 1, - FLAG_CELLULAR = 1 << 2, - FLAG_SHOW_IPCONFIG = 1 << 3, - FLAG_LOGIN_ONLY = 1 << 4, - FLAG_OTHER_NETWORK = 1 << 5, - }; - - // Initializes UI. - void Init(); - // True when opening in browser, otherwise in OOBE/login mode. bool browser_mode_; - views::TabbedPane* tabs_; - - // NetworkConfigFlags to specify which UIs to show. - int flags_; - - scoped_ptr<EthernetNetwork> ethernet_; - scoped_ptr<WifiNetwork> wifi_; - scoped_ptr<CellularNetwork> cellular_; + std::wstring title_; - CellularConfigView* cellularconfig_view_; + // WifiConfig is the only child of this class. + // It will get deleted when NetworkConfigView gets cleaned up. WifiConfigView* wificonfig_view_; - IPConfigView* ipconfig_view_; Delegate* delegate_; diff --git a/chrome/browser/chromeos/options/wifi_config_view.cc b/chrome/browser/chromeos/options/wifi_config_view.cc index e920109..deff096 100644 --- a/chrome/browser/chromeos/options/wifi_config_view.cc +++ b/chrome/browser/chromeos/options/wifi_config_view.cc @@ -69,7 +69,6 @@ WifiConfigView::WifiConfigView(NetworkConfigView* parent, security_combobox_(NULL), passphrase_textfield_(NULL), passphrase_visible_button_(NULL), - autoconnect_checkbox_(NULL), error_label_(NULL) { Init(); } @@ -85,7 +84,6 @@ WifiConfigView::WifiConfigView(NetworkConfigView* parent) security_combobox_(NULL), passphrase_textfield_(NULL), passphrase_visible_button_(NULL), - autoconnect_checkbox_(NULL), error_label_(NULL) { Init(); } @@ -234,8 +232,7 @@ bool WifiConfigView::Login() { sec = SECURITY_RSN; connected = cros->ConnectToWifiNetwork( sec, GetSSID(), GetPassphrase(), - identity_string, certificate_path_, - autoconnect_checkbox_ ? autoconnect_checkbox_->checked() : true); + identity_string, certificate_path_, true); } else { Save(); connected = cros->ConnectToWifiNetwork( @@ -254,18 +251,10 @@ bool WifiConfigView::Login() { } bool WifiConfigView::Save() { - // Save password and auto-connect here. + // Save password here. if (!other_network_) { bool changed = false; - if (autoconnect_checkbox_) { - bool auto_connect = autoconnect_checkbox_->checked(); - if (auto_connect != wifi_->auto_connect()) { - wifi_->set_auto_connect(auto_connect); - changed = true; - } - } - if (passphrase_textfield_) { std::string passphrase = UTF16ToUTF8(passphrase_textfield_->text()); if (passphrase != wifi_->passphrase()) { @@ -305,15 +294,6 @@ const std::string WifiConfigView::GetPassphrase() const { return result; } -void WifiConfigView::FocusFirstField() { - if (ssid_textfield_) - ssid_textfield_->RequestFocus(); - else if (identity_textfield_) - identity_textfield_->RequestFocus(); - else if (passphrase_textfield_) - passphrase_textfield_->RequestFocus(); -} - void WifiConfigView::Init() { views::GridLayout* layout = CreatePanelGridLayout(this); SetLayoutManager(layout); @@ -451,19 +431,6 @@ void WifiConfigView::Init() { layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); // Set or hide the error text. UpdateErrorLabel(false); - - // Autoconnect checkbox - // Only show if this network is already remembered (a favorite). - if (wifi_.get() && wifi_->favorite()) { - autoconnect_checkbox_ = new views::Checkbox(l10n_util::GetString( - IDS_OPTIONS_SETTINGS_INTERNET_OPTIONS_AUTO_CONNECT)); - // For other network, default to autoconnect. - bool autoconnect = other_network_ || wifi_->auto_connect(); - autoconnect_checkbox_->SetChecked(autoconnect); - layout->StartRow(0, column_view_set_id); - layout->AddView(autoconnect_checkbox_, 3, 1); - layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); - } } } // namespace chromeos diff --git a/chrome/browser/chromeos/options/wifi_config_view.h b/chrome/browser/chromeos/options/wifi_config_view.h index 120fd27..10b8c22 100644 --- a/chrome/browser/chromeos/options/wifi_config_view.h +++ b/chrome/browser/chromeos/options/wifi_config_view.h @@ -71,14 +71,7 @@ class WifiConfigView : public views::View, // Returns true if the textfields are non-empty and we can login. bool can_login() const { return can_login_; } - // Focus the first field in the UI. - void FocusFirstField(); - private: - FRIEND_TEST_ALL_PREFIXES(WifiConfigViewTest, NoChangeSaveTest); - FRIEND_TEST_ALL_PREFIXES(WifiConfigViewTest, ChangeAutoConnectSaveTest); - FRIEND_TEST_ALL_PREFIXES(WifiConfigViewTest, ChangePasswordSaveTest); - class SecurityComboboxModel : public ComboboxModel { public: SecurityComboboxModel() {} @@ -119,7 +112,6 @@ class WifiConfigView : public views::View, views::Combobox* security_combobox_; views::Textfield* passphrase_textfield_; views::ImageButton* passphrase_visible_button_; - views::Checkbox* autoconnect_checkbox_; views::Label* error_label_; DISALLOW_COPY_AND_ASSIGN(WifiConfigView); diff --git a/chrome/browser/chromeos/options/wifi_config_view_browsertest.cc b/chrome/browser/chromeos/options/wifi_config_view_browsertest.cc deleted file mode 100644 index 02d5066..0000000 --- a/chrome/browser/chromeos/options/wifi_config_view_browsertest.cc +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/chromeos/options/wifi_config_view.h" - -#include "base/string_util.h" -#include "base/utf_string_conversions.h" -#include "chrome/browser/chromeos/cros/cros_in_process_browser_test.h" -#include "chrome/browser/chromeos/cros/mock_network_library.h" - -namespace chromeos { -using ::testing::AnyNumber; -using ::testing::InvokeWithoutArgs; -using ::testing::Return; -using ::testing::ReturnRef; -using ::testing::_; - -class WifiConfigViewTest : public CrosInProcessBrowserTest { - protected: - MockNetworkLibrary *mock_network_library_; - - WifiConfigViewTest() : CrosInProcessBrowserTest() {} - - virtual void SetUpInProcessBrowserTestFixture() { - cros_mock_->InitStatusAreaMocks(); - cros_mock_->SetStatusAreaMocksExpectations(); - mock_network_library_ = cros_mock_->mock_network_library(); - } -}; - -// Test that if nothing is changed, we don't call SaveWifiNetwork. -IN_PROC_BROWSER_TEST_F(WifiConfigViewTest, NoChangeSaveTest) { - EXPECT_CALL(*mock_network_library_, SaveWifiNetwork(_)).Times(0); - scoped_ptr<WifiNetwork> network(new WifiNetwork()); - WifiConfigView* view = new WifiConfigView(NULL, network.get()); - view->Save(); -} - -// Test that if autoconnect was changed, we call SaveWifiNetwork. -IN_PROC_BROWSER_TEST_F(WifiConfigViewTest, ChangeAutoConnectSaveTest) { - EXPECT_CALL(*mock_network_library_, SaveWifiNetwork(_)).Times(1); - scoped_ptr<WifiNetwork> remembered_network(new WifiNetwork()); - remembered_network->favorite_ = true; - WifiConfigView* view = new WifiConfigView(NULL, remembered_network.get()); - ASSERT_TRUE(view->autoconnect_checkbox_ != NULL); - view->autoconnect_checkbox_->SetChecked( - !view->autoconnect_checkbox_->checked()); - view->Save(); -} - -// Test that if password was changed, we call SaveWifiNetwork. -IN_PROC_BROWSER_TEST_F(WifiConfigViewTest, ChangePasswordSaveTest) { - EXPECT_CALL(*mock_network_library_, SaveWifiNetwork(_)).Times(1); - scoped_ptr<WifiNetwork> wifi(new WifiNetwork()); - wifi->set_encryption(SECURITY_WEP); - WifiConfigView* view = new WifiConfigView(NULL, wifi.get()); - view->passphrase_textfield_->SetText(ASCIIToUTF16("test")); - view->Save(); -} - -} // namespace chromeos diff --git a/chrome/browser/chromeos/status/network_menu.cc b/chrome/browser/chromeos/status/network_menu.cc index 5a388e1..c9b1015 100644 --- a/chrome/browser/chromeos/status/network_menu.cc +++ b/chrome/browser/chromeos/status/network_menu.cc @@ -213,9 +213,9 @@ bool NetworkMenu::ConnectToNetworkAt(int index, // Connect or reconnect. if (auto_connect >= 0) wifi->set_auto_connect(auto_connect ? true : false); - if (wifi->connecting() || wifi->connected()) { + if (wifi->connecting_or_connected()) { // Show the config settings for the active network. - ShowWifi(wifi, false); + ShowTabbedNetworkSettings(wifi); return true; } bool connected = false; @@ -225,7 +225,7 @@ bool NetworkMenu::ConnectToNetworkAt(int index, wifi, std::string(), std::string(), wifi->cert_path()); } else if (wifi->encryption() == SECURITY_8021X) { // Always show the wifi settings/dialog to load/select a certificate. - ShowWifi(wifi, true); + ShowNetworkConfigView(new NetworkConfigView(wifi)); return true; } else { // If a passphrase is provided use it, otherwise use the saved one. @@ -244,7 +244,7 @@ bool NetworkMenu::ConnectToNetworkAt(int index, if (!connected) { if (!MenuUI::IsEnabled()) { // Show the wifi dialog on a failed attempt for non DOM UI menus. - ShowWifi(wifi, true); + ShowNetworkConfigView(new NetworkConfigView(wifi)); return true; } else { // If the connection attempt failed immediately (e.g. short password) @@ -265,10 +265,10 @@ bool NetworkMenu::ConnectToNetworkAt(int index, cellular->needs_new_plan()) { ActivateCellular(cellular); return true; - } else if (cellular->connecting() || cellular->connected()) { + } else if (cellular->connecting_or_connected()) { // Cellular network is connecting or connected, // so we show the config settings for the cellular network. - ShowCellular(cellular, false); + ShowTabbedNetworkSettings(cellular); return true; } // Clicked on a disconnected cellular network, so connect to it. @@ -351,7 +351,7 @@ void NetworkMenu::ActivatedAt(int index) { cros->EnableOfflineMode(!cros->offline_mode()); } else if (flags & FLAG_ETHERNET) { if (cros->ethernet_connected()) { - ShowEthernet(cros->ethernet_network()); + ShowTabbedNetworkSettings(cros->ethernet_network()); } } else if (flags & FLAG_WIFI) { ConnectToNetworkAt(index, std::string(), std::string(), -1); @@ -750,36 +750,12 @@ void NetworkMenu::ShowTabbedNetworkSettings(const Network* network) const { // and the embedded menu UI (and fully deprecated NetworkConfigView). // Meanwhile, if MenuUI::IsEnabled() is true, always show the settings UI, // otherwise show NetworkConfigView only to get passwords when not connected. -void NetworkMenu::ShowNetworkConfigView(NetworkConfigView* view, - bool focus_login) const { +void NetworkMenu::ShowNetworkConfigView(NetworkConfigView* view) const { view->set_browser_mode(IsBrowserMode()); views::Window* window = browser::CreateViewsWindow( GetNativeWindow(), gfx::Rect(), view); window->SetIsAlwaysOnTop(true); window->Show(); - if (focus_login) - view->SetLoginTextfieldFocus(); -} - -void NetworkMenu::ShowWifi(const WifiNetwork* wifi, bool focus_login) const { - DCHECK(wifi); - if (use_settings_ui_ && - (MenuUI::IsEnabled() || wifi->connected() || wifi->connecting())) { - ShowTabbedNetworkSettings(wifi); - } else { - ShowNetworkConfigView(new NetworkConfigView(wifi, true), focus_login); - } -} - -void NetworkMenu::ShowCellular(const CellularNetwork* cellular, - bool focus_login) const { - DCHECK(cellular); - // We should always use settings UI for cellular network because native UI - // is not complete and only settings UI version has full implementation. - if (use_settings_ui_) - ShowTabbedNetworkSettings(cellular); - else - ShowNetworkConfigView(new NetworkConfigView(cellular), focus_login); } void NetworkMenu::ActivateCellular(const CellularNetwork* cellular) const { @@ -790,17 +766,6 @@ void NetworkMenu::ActivateCellular(const CellularNetwork* cellular) const { browser->OpenMobilePlanTabAndActivate(); } -void NetworkMenu::ShowEthernet(const EthernetNetwork* ethernet) const { - DCHECK(ethernet); - if (use_settings_ui_ && - (MenuUI::IsEnabled() || ethernet->connected() || - ethernet->connecting())) { - ShowTabbedNetworkSettings(ethernet); - } else { - ShowNetworkConfigView(new NetworkConfigView(ethernet), false); - } -} - void NetworkMenu::ShowOther() const { if (use_settings_ui_ && MenuUI::IsEnabled()) { Browser* browser = BrowserList::GetLastActive(); @@ -811,8 +776,7 @@ void NetworkMenu::ShowOther() const { browser->ShowOptionsTab(page); } } else { - const bool kFocusLogin = true; - ShowNetworkConfigView(new NetworkConfigView(), kFocusLogin); + ShowNetworkConfigView(new NetworkConfigView()); } } diff --git a/chrome/browser/chromeos/status/network_menu.h b/chrome/browser/chromeos/status/network_menu.h index 2abe14f..ea399fe 100644 --- a/chrome/browser/chromeos/status/network_menu.h +++ b/chrome/browser/chromeos/status/network_menu.h @@ -193,13 +193,9 @@ class NetworkMenu : public views::ViewMenuDelegate, // Show a NetworkConfigView modal dialog instance. // TODO(stevenjb): deprecate this once all of the UI is embedded in the menu. - void ShowNetworkConfigView(NetworkConfigView* view, bool focus_login) const; + void ShowNetworkConfigView(NetworkConfigView* view) const; - // Wrappers for the ShowNetworkConfigView / ShowTabbedNetworkSettings. - void ShowWifi(const WifiNetwork* wifi, bool focus_login) const; - void ShowCellular(const CellularNetwork* cellular, bool focus_login) const; void ActivateCellular(const CellularNetwork* cellular) const; - void ShowEthernet(const EthernetNetwork* ethernet) const; void ShowOther() const; // Set to true if we are currently refreshing the menu. diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 06cc45a..cc6775f 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -661,16 +661,12 @@ 'browser/chromeos/network_state_notifier.h', 'browser/chromeos/network_message_observer.cc', 'browser/chromeos/network_message_observer.h', - 'browser/chromeos/options/cellular_config_view.cc', - 'browser/chromeos/options/cellular_config_view.h', 'browser/chromeos/offline/offline_load_page.cc', 'browser/chromeos/offline/offline_load_page.h', 'browser/chromeos/offline/offline_load_service.cc', 'browser/chromeos/offline/offline_load_service.h', 'browser/chromeos/options/internet_page_view.cc', 'browser/chromeos/options/internet_page_view.h', - 'browser/chromeos/options/ip_config_view.cc', - 'browser/chromeos/options/ip_config_view.h', 'browser/chromeos/options/language_config_model.cc', 'browser/chromeos/options/language_config_model.h', 'browser/chromeos/options/language_config_util.h', diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index 162bf3c..815006f 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -1972,7 +1972,6 @@ 'browser/chromeos/login/wizard_in_process_browser_test.h', 'browser/chromeos/network_state_notifier_browsertest.cc', 'browser/chromeos/notifications/notification_browsertest.cc', - 'browser/chromeos/options/wifi_config_view_browsertest.cc', 'browser/chromeos/panels/panel_browsertest.cc', 'browser/chromeos/status/clock_menu_button_browsertest.cc', 'browser/chromeos/status/input_method_menu_button_browsertest.cc', |