Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/network_dropdown_handler.cc

Issue 8395042: [cros,de-hack] Get rid of singleton for the WebUILoginScreen. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: comment nit Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/ui/webui/chromeos/login/network_dropdown_handler.h" 5 #include "chrome/browser/ui/webui/chromeos/login/network_dropdown_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "chrome/browser/chromeos/login/webui_login_display.h" 9 #include "chrome/browser/chromeos/login/webui_login_display.h"
10 #include "chrome/browser/ui/webui/chromeos/login/network_dropdown.h" 10 #include "chrome/browser/ui/webui/chromeos/login/network_dropdown.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 dropdown_->OnItemChosen(static_cast<int>(id)); 64 dropdown_->OnItemChosen(static_cast<int>(id));
65 } 65 }
66 66
67 void NetworkDropdownHandler::HandleNetworkDropdownShow( 67 void NetworkDropdownHandler::HandleNetworkDropdownShow(
68 const base::ListValue* args) { 68 const base::ListValue* args) {
69 DCHECK(args->GetSize() == 1); 69 DCHECK(args->GetSize() == 1);
70 std::string element_id; 70 std::string element_id;
71 if (!args->GetString(0, &element_id)) 71 if (!args->GetString(0, &element_id))
72 NOTREACHED(); 72 NOTREACHED();
73 73
74 dropdown_.reset(new NetworkDropdown( 74 dropdown_.reset(new NetworkDropdown(web_ui_, GetNativeWindow()));
75 web_ui_, WebUILoginDisplay::GetLoginWindow()->GetNativeWindow()));
76 } 75 }
77 76
78 void NetworkDropdownHandler::HandleNetworkDropdownHide( 77 void NetworkDropdownHandler::HandleNetworkDropdownHide(
79 const base::ListValue* args) { 78 const base::ListValue* args) {
80 DCHECK(args->GetSize() == 0); 79 DCHECK(args->GetSize() == 0);
81 dropdown_.reset(); 80 dropdown_.reset();
82 } 81 }
83 82
84 void NetworkDropdownHandler::HandleNetworkDropdownRefresh( 83 void NetworkDropdownHandler::HandleNetworkDropdownRefresh(
85 const base::ListValue* args) { 84 const base::ListValue* args) {
86 DCHECK(args->GetSize() == 0); 85 DCHECK(args->GetSize() == 0);
87 // Since language change is async, 86 // Since language change is async,
88 // we may in theory be on another screen during this call. 87 // we may in theory be on another screen during this call.
89 if (dropdown_.get()) 88 if (dropdown_.get())
90 dropdown_->Refresh(); 89 dropdown_->Refresh();
91 } 90 }
92 91
93 } // namespace chromeos 92 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/eula_screen_handler.cc ('k') | chrome/browser/ui/webui/chromeos/login/oobe_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698