| Index: chrome/browser/chromeos/login/ui/webui_login_view.cc
|
| diff --git a/chrome/browser/chromeos/login/ui/webui_login_view.cc b/chrome/browser/chromeos/login/ui/webui_login_view.cc
|
| index 42febae6d6b1cb088d26abe058069b3217ad0aee..6ad79fd4cff525572f08f738015b6852dc08ea43 100644
|
| --- a/chrome/browser/chromeos/login/ui/webui_login_view.cc
|
| +++ b/chrome/browser/chromeos/login/ui/webui_login_view.cc
|
| @@ -163,7 +163,8 @@ WebUILoginView::~WebUILoginView() {
|
| observer_list_,
|
| OnHostDestroying());
|
|
|
| - if (ash::Shell::GetInstance()->HasPrimaryStatusArea()) {
|
| + if (ash::Shell::HasInstance() &&
|
| + ash::Shell::GetInstance()->HasPrimaryStatusArea()) {
|
| ash::Shell::GetInstance()->GetPrimarySystemTray()->
|
| SetNextFocusableView(NULL);
|
| }
|
| @@ -303,7 +304,8 @@ void WebUILoginView::OnPostponedShow() {
|
| }
|
|
|
| void WebUILoginView::SetStatusAreaVisible(bool visible) {
|
| - if (ash::Shell::GetInstance()->HasPrimaryStatusArea()) {
|
| + if (ash::Shell::HasInstance() &&
|
| + ash::Shell::GetInstance()->HasPrimaryStatusArea()) {
|
| ash::SystemTray* tray = ash::Shell::GetInstance()->GetPrimarySystemTray();
|
| if (visible) {
|
| // Tray may have been initialized being hidden.
|
| @@ -317,7 +319,8 @@ void WebUILoginView::SetStatusAreaVisible(bool visible) {
|
|
|
| void WebUILoginView::SetUIEnabled(bool enabled) {
|
| forward_keyboard_event_ = enabled;
|
| - ash::Shell::GetInstance()->GetPrimarySystemTray()->SetEnabled(enabled);
|
| + if (ash::Shell::HasInstance())
|
| + ash::Shell::GetInstance()->GetPrimarySystemTray()->SetEnabled(enabled);
|
| }
|
|
|
| void WebUILoginView::AddFrameObserver(FrameObserver* frame_observer) {
|
| @@ -416,11 +419,13 @@ bool WebUILoginView::TakeFocus(content::WebContents* source, bool reverse) {
|
| if (!forward_keyboard_event_)
|
| return false;
|
|
|
| - ash::SystemTray* tray = ash::Shell::GetInstance()->GetPrimarySystemTray();
|
| - if (tray && tray->GetWidget()->IsVisible()) {
|
| - tray->SetNextFocusableView(this);
|
| - ash::Shell::GetInstance()->RotateFocus(reverse ? ash::Shell::BACKWARD :
|
| - ash::Shell::FORWARD);
|
| + if (ash::Shell::HasInstance()) {
|
| + ash::SystemTray* tray = ash::Shell::GetInstance()->GetPrimarySystemTray();
|
| + if (tray && tray->GetWidget()->IsVisible()) {
|
| + tray->SetNextFocusableView(this);
|
| + ash::Shell::GetInstance()->RotateFocus(reverse ? ash::Shell::BACKWARD :
|
| + ash::Shell::FORWARD);
|
| + }
|
| }
|
|
|
| return true;
|
|
|