Commit 69117a94 authored by rkc@chromium.org's avatar rkc@chromium.org

Enable Verizon Activation from OOBE/Login screen.

With Verizon's activation now coming in a separate modal dialog, there is no reason for us to restrict this to only once the user has logged in. Allows users to activate Verizon from the login screen or OOBE. The user should still not be able to activate from the lock screen though.

Also make the modal activation dialog the default option.

Review requested,
zelidrag@ - main review
sky@ - OWNER's review for,
  chrome/browser/ui/views/ash
  chrome/browser/ui/webui/chromeos/
sadrul@ - OWNER's review for,
  chrome/browser/chromeos/status

R=zelidrag@chromium.org,sky@chromium.org,sadrul@chromium.org
BUG=134475
TEST=The activation option is available at OOBE and the Login screens but not the lock screen. On selecting the activation option, the 3g activation dialog comes up.

Review URL: https://chromiumcodereview.appspot.com/10790133

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149082 0039d316-1c4b-4281-b951-d872f2087c98
parent 9841da00
......@@ -745,7 +745,6 @@ std::string LoginUtilsImpl::GetOffTheRecordCommandLine(
::switches::kEnableGView,
::switches::kEnableHighDPIPDFPlugin,
::switches::kEnableLogging,
::switches::kEnableMobileSetupDialog,
::switches::kEnablePartialSwap,
::switches::kEnableUIReleaseFrontSurface,
::switches::kEnablePinch,
......
......@@ -51,6 +51,9 @@ class WebUILoginDisplayHost : public BaseLoginDisplayHost,
// Returns instance of the OOBE WebUI.
OobeUI* GetOobeUI() const;
// Returns the current login view.
WebUILoginView* login_view() { return login_view_; }
protected:
// content::NotificationObserver implementation.
virtual void Observe(int type,
......
......@@ -64,8 +64,6 @@ std::string EscapeAmpersands(const std::string& input) {
// Activate a cellular network.
void ActivateCellular(const chromeos::CellularNetwork* cellular) {
DCHECK(cellular);
if (!chromeos::UserManager::Get()->IsSessionStarted())
return;
ash::Shell::GetInstance()->delegate()->OpenMobileSetup(
cellular->service_path());
......@@ -590,11 +588,6 @@ void MainMenuModel::InitMenuItems(bool should_open_button_options) {
chromeos::ActivationState activation_state =
cell_networks[i]->activation_state();
// This is currently only used in the OOBE/login screen, do not show
// activating 3G option.
if (activation_state != ACTIVATION_STATE_ACTIVATED)
continue;
// Ampersand is a valid character in a network name, but menu2 uses it
// to mark "mnemonics" for keyboard shortcuts. http://crosbug.com/14697
std::string network_name = EscapeAmpersands(cell_networks[i]->name());
......@@ -983,6 +976,13 @@ void NetworkMenu::DoConnect(Network* network) {
// Connection failures are responsible for updating the UI, including
// reopening dialogs.
}
} else if (network->type() == TYPE_CELLULAR) {
CellularNetwork* cellular = static_cast<CellularNetwork*>(network);
if (cellular->activation_state() != ACTIVATION_STATE_ACTIVATED) {
ActivateCellular(cellular);
} else {
cros->ConnectToCellularNetwork(cellular);
}
}
}
......
......@@ -573,11 +573,11 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate,
ActivationState state = cell[i]->activation_state();
if (state == ACTIVATION_STATE_NOT_ACTIVATED ||
state == ACTIVATION_STATE_PARTIALLY_ACTIVATED) {
// If a cellular network needs to be activated, then do not show it in
// the login/lock screen.
if (login_status == ash::user::LOGGED_IN_NONE ||
login_status == ash::user::LOGGED_IN_LOCKED)
// If a cellular network needs to be activated,
// then do not show it in the lock screen.
if (login_status == ash::user::LOGGED_IN_LOCKED)
continue;
info.description = l10n_util::GetStringFUTF16(
IDS_STATUSBAR_NETWORK_DEVICE_ACTIVATE,
info.name);
......
......@@ -199,21 +199,7 @@ void ChromeShellDelegate::OpenCrosh() {
void ChromeShellDelegate::OpenMobileSetup(const std::string& service_path) {
#if defined(OS_CHROMEOS)
Browser* browser = GetTargetBrowser();
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableMobileSetupDialog)) {
MobileSetupDialog::Show(service_path);
} else {
std::string url(chrome::kChromeUIMobileSetupURL);
url.append(service_path);
browser->OpenURL(
content::OpenURLParams(GURL(url),
content::Referrer(),
NEW_FOREGROUND_TAB,
content::PAGE_TRANSITION_LINK,
false));
browser->window()->Activate();
}
MobileSetupDialog::Show(service_path);
#endif
}
......
......@@ -7,6 +7,8 @@
#include "base/bind.h"
#include "base/memory/singleton.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/chromeos/login/webui_login_display_host.h"
#include "chrome/browser/chromeos/login/webui_login_view.h"
#include "chrome/browser/chromeos/mobile/mobile_activator.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/profiles/profile_manager.h"
......@@ -93,8 +95,20 @@ MobileSetupDialogDelegate::~MobileSetupDialogDelegate() {
void MobileSetupDialogDelegate::ShowDialog(const std::string& service_path) {
service_path_ = service_path;
gfx::NativeWindow parent = NULL;
// If we're on the login screen.
if (chromeos::WebUILoginDisplayHost::default_host()) {
chromeos::WebUILoginDisplayHost* webui_host =
static_cast<chromeos::WebUILoginDisplayHost*>(
chromeos::WebUILoginDisplayHost::default_host());
chromeos::WebUILoginView* login_view = webui_host->login_view();
if (login_view)
parent = login_view->GetNativeWindow();
}
dialog_window_ = chrome::ShowWebDialog(
NULL,
parent,
ProfileManager::GetDefaultProfileOrOffTheRecord(),
this);
}
......
......@@ -1366,9 +1366,6 @@ const char kEnableGView[] = "enable-gview";
// Enable Kiosk mode for ChromeOS
const char kEnableKioskMode[] = "enable-kiosk-mode";
// Enables mobile setup in a dialog.
const char kEnableMobileSetupDialog[] = "enable-mobile-dialog";
// Enables support for policy-configured networks.
const char kEnableONCPolicy[] = "enable-onc-policy";
......
......@@ -372,7 +372,6 @@ extern const char kEnableDevicePolicy[];
extern const char kEnableDriveV2Api[];
extern const char kEnableGView[];
extern const char kEnableKioskMode[];
extern const char kEnableMobileSetupDialog[];
extern const char kEnableONCPolicy[];
extern const char kEnableStaticIPConfig[];
extern const char kEnableUnsupportedBluetoothDevices[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment