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

Side by Side Diff: athena/system/network_selector.cc

Issue 623103002: replace OVERRIDE and FINAL with override and final in athena/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master Created 6 years, 2 months 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
« no previous file with comments | « athena/system/background_controller.cc ('k') | athena/system/orientation_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "athena/system/network_selector.h" 5 #include "athena/system/network_selector.h"
6 6
7 #include "base/memory/weak_ptr.h" 7 #include "base/memory/weak_ptr.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chromeos/network/network_configuration_handler.h" 9 #include "chromeos/network/network_configuration_handler.h"
10 #include "chromeos/network/network_connection_handler.h" 10 #include "chromeos/network/network_connection_handler.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 network_.service_path, 146 network_.service_path,
147 base::Bind(&PasswordView::OnConnectionSucceed, weak_ptr_.GetWeakPtr()), 147 base::Bind(&PasswordView::OnConnectionSucceed, weak_ptr_.GetWeakPtr()),
148 base::Bind(&PasswordView::OnKnownError, weak_ptr_.GetWeakPtr()), 148 base::Bind(&PasswordView::OnKnownError, weak_ptr_.GetWeakPtr()),
149 check_error_state); 149 check_error_state);
150 } 150 }
151 151
152 void OnConnectionSucceed() { Close(true); } 152 void OnConnectionSucceed() { Close(true); }
153 153
154 // views::View: 154 // views::View:
155 virtual void ViewHierarchyChanged( 155 virtual void ViewHierarchyChanged(
156 const views::View::ViewHierarchyChangedDetails& details) OVERRIDE { 156 const views::View::ViewHierarchyChangedDetails& details) override {
157 if (details.is_add && details.child == this) 157 if (details.is_add && details.child == this)
158 textfield_->RequestFocus(); 158 textfield_->RequestFocus();
159 } 159 }
160 160
161 // views::ButtonListener: 161 // views::ButtonListener:
162 virtual void ButtonPressed(views::Button* sender, 162 virtual void ButtonPressed(views::Button* sender,
163 const ui::Event& event) OVERRIDE { 163 const ui::Event& event) override {
164 if (sender == connect_) { 164 if (sender == connect_) {
165 if (error_msg_) { 165 if (error_msg_) {
166 RemoveChildView(error_msg_); 166 RemoveChildView(error_msg_);
167 delete error_msg_; 167 delete error_msg_;
168 error_msg_ = NULL; 168 error_msg_ = NULL;
169 } 169 }
170 connect_->SetEnabled(false); 170 connect_->SetEnabled(false);
171 NetworkHandler::Get()->network_configuration_handler()->SetNetworkProfile( 171 NetworkHandler::Get()->network_configuration_handler()->SetNetworkProfile(
172 network_.service_path, 172 network_.service_path,
173 NetworkProfileHandler::GetSharedProfilePath(), 173 NetworkProfileHandler::GetSharedProfilePath(),
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 network_.service_path, 288 network_.service_path,
289 base::Closure(), 289 base::Closure(),
290 base::Bind(&NetworkRow::OnNetworkConnectionError, 290 base::Bind(&NetworkRow::OnNetworkConnectionError,
291 weak_ptr_.GetWeakPtr(), 291 weak_ptr_.GetWeakPtr(),
292 network_.service_path), 292 network_.service_path),
293 false); 293 false);
294 } 294 }
295 } 295 }
296 296
297 // views::View: 297 // views::View:
298 virtual void OnMouseEvent(ui::MouseEvent* event) OVERRIDE { 298 virtual void OnMouseEvent(ui::MouseEvent* event) override {
299 if (event->type() != ui::ET_MOUSE_PRESSED) 299 if (event->type() != ui::ET_MOUSE_PRESSED)
300 return; 300 return;
301 ActivateNetwork(); 301 ActivateNetwork();
302 event->SetHandled(); 302 event->SetHandled();
303 } 303 }
304 304
305 virtual void OnGestureEvent(ui::GestureEvent* gesture) OVERRIDE { 305 virtual void OnGestureEvent(ui::GestureEvent* gesture) override {
306 if (gesture->type() != ui::ET_GESTURE_TAP) 306 if (gesture->type() != ui::ET_GESTURE_TAP)
307 return; 307 return;
308 ActivateNetwork(); 308 ActivateNetwork();
309 gesture->SetHandled(); 309 gesture->SetHandled();
310 } 310 }
311 311
312 ui::NetworkInfo network_; 312 ui::NetworkInfo network_;
313 views::View* container_; 313 views::View* container_;
314 scoped_ptr<views::View> password_view_; 314 scoped_ptr<views::View> password_view_;
315 base::WeakPtrFactory<NetworkRow> weak_ptr_; 315 base::WeakPtrFactory<NetworkRow> weak_ptr_;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 384
385 network_list_.set_content_view(scroll_content_); 385 network_list_.set_content_view(scroll_content_);
386 } 386 }
387 387
388 void UpdateNetworkList() { network_list_.UpdateNetworkList(); } 388 void UpdateNetworkList() { network_list_.UpdateNetworkList(); }
389 389
390 void Close() { delete this; } 390 void Close() { delete this; }
391 391
392 // ui::NetworkListDelegate: 392 // ui::NetworkListDelegate:
393 virtual views::View* CreateViewForNetwork( 393 virtual views::View* CreateViewForNetwork(
394 const ui::NetworkInfo& info) OVERRIDE { 394 const ui::NetworkInfo& info) override {
395 return new NetworkRow(info, background_view_); 395 return new NetworkRow(info, background_view_);
396 } 396 }
397 397
398 virtual bool IsViewHovered(views::View* view) OVERRIDE { 398 virtual bool IsViewHovered(views::View* view) override {
399 return static_cast<NetworkRow*>(view)->has_password_view(); 399 return static_cast<NetworkRow*>(view)->has_password_view();
400 } 400 }
401 401
402 virtual chromeos::NetworkTypePattern GetNetworkTypePattern() const OVERRIDE { 402 virtual chromeos::NetworkTypePattern GetNetworkTypePattern() const override {
403 return chromeos::NetworkTypePattern::NonVirtual(); 403 return chromeos::NetworkTypePattern::NonVirtual();
404 } 404 }
405 405
406 virtual void UpdateViewForNetwork(views::View* view, 406 virtual void UpdateViewForNetwork(views::View* view,
407 const ui::NetworkInfo& info) OVERRIDE { 407 const ui::NetworkInfo& info) override {
408 static_cast<NetworkRow*>(view)->Update(info); 408 static_cast<NetworkRow*>(view)->Update(info);
409 } 409 }
410 410
411 virtual views::Label* CreateInfoLabel() OVERRIDE { 411 virtual views::Label* CreateInfoLabel() override {
412 views::Label* label = new views::Label(); 412 views::Label* label = new views::Label();
413 return label; 413 return label;
414 } 414 }
415 415
416 virtual void RelayoutScrollList() OVERRIDE { scroller_->Layout(); } 416 virtual void RelayoutScrollList() override { scroller_->Layout(); }
417 417
418 // chromeos::NetworkStateHandlerObserver: 418 // chromeos::NetworkStateHandlerObserver:
419 virtual void NetworkListChanged() OVERRIDE { UpdateNetworkList(); } 419 virtual void NetworkListChanged() override { UpdateNetworkList(); }
420 420
421 virtual void DeviceListChanged() OVERRIDE {} 421 virtual void DeviceListChanged() override {}
422 422
423 virtual void DefaultNetworkChanged( 423 virtual void DefaultNetworkChanged(
424 const chromeos::NetworkState* network) OVERRIDE {} 424 const chromeos::NetworkState* network) override {}
425 425
426 virtual void NetworkConnectionStateChanged( 426 virtual void NetworkConnectionStateChanged(
427 const chromeos::NetworkState* network) OVERRIDE {} 427 const chromeos::NetworkState* network) override {}
428 428
429 virtual void NetworkPropertiesUpdated( 429 virtual void NetworkPropertiesUpdated(
430 const chromeos::NetworkState* network) OVERRIDE {} 430 const chromeos::NetworkState* network) override {}
431 431
432 // ui::EventHandler: 432 // ui::EventHandler:
433 virtual void OnMouseEvent(ui::MouseEvent* mouse) OVERRIDE { 433 virtual void OnMouseEvent(ui::MouseEvent* mouse) override {
434 CHECK_EQ(background_view_, mouse->target()); 434 CHECK_EQ(background_view_, mouse->target());
435 if (mouse->type() == ui::ET_MOUSE_PRESSED && !mouse->handled()) { 435 if (mouse->type() == ui::ET_MOUSE_PRESSED && !mouse->handled()) {
436 Close(); 436 Close();
437 mouse->SetHandled(); 437 mouse->SetHandled();
438 } 438 }
439 } 439 }
440 440
441 virtual void OnGestureEvent(ui::GestureEvent* gesture) OVERRIDE { 441 virtual void OnGestureEvent(ui::GestureEvent* gesture) override {
442 CHECK_EQ(background_view_, gesture->target()); 442 CHECK_EQ(background_view_, gesture->target());
443 if (gesture->type() == ui::ET_GESTURE_TAP && !gesture->handled()) { 443 if (gesture->type() == ui::ET_GESTURE_TAP && !gesture->handled()) {
444 Close(); 444 Close();
445 gesture->SetHandled(); 445 gesture->SetHandled();
446 } 446 }
447 } 447 }
448 448
449 scoped_ptr<views::Widget> widget_; 449 scoped_ptr<views::Widget> widget_;
450 views::View* background_view_; 450 views::View* background_view_;
451 views::View* scroll_content_; 451 views::View* scroll_content_;
452 views::ScrollView* scroller_; 452 views::ScrollView* scroller_;
453 453
454 views::View* connect_; 454 views::View* connect_;
455 455
456 ui::NetworkListView network_list_; 456 ui::NetworkListView network_list_;
457 457
458 DISALLOW_COPY_AND_ASSIGN(NetworkSelector); 458 DISALLOW_COPY_AND_ASSIGN(NetworkSelector);
459 }; 459 };
460 460
461 } // namespace 461 } // namespace
462 462
463 namespace athena { 463 namespace athena {
464 464
465 void CreateNetworkSelector(aura::Window* container) { 465 void CreateNetworkSelector(aura::Window* container) {
466 new NetworkSelector(container); 466 new NetworkSelector(container);
467 } 467 }
468 468
469 } // namespace athena 469 } // namespace athena
OLDNEW
« no previous file with comments | « athena/system/background_controller.cc ('k') | athena/system/orientation_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698