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

Side by Side Diff: chrome/browser/chromeos/login/screens/network_screen.cc

Issue 1562593002: Fix potential crashes in NetworkHandler code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@test
Patch Set: IsShuttingDown -> OnShuttingDown Created 4 years, 11 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 | « no previous file | chrome/browser/chromeos/mobile/mobile_activator_unittest.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chromeos/login/screens/network_screen.h" 5 #include "chrome/browser/chromeos/login/screens/network_screen.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 void NetworkScreen::Initialize(::login::ScreenContext* context) { 111 void NetworkScreen::Initialize(::login::ScreenContext* context) {
112 NetworkModel::Initialize(context); 112 NetworkModel::Initialize(context);
113 OnSystemTimezoneChanged(); 113 OnSystemTimezoneChanged();
114 UpdateLanguageList(); 114 UpdateLanguageList();
115 } 115 }
116 116
117 void NetworkScreen::OnViewDestroyed(NetworkView* view) { 117 void NetworkScreen::OnViewDestroyed(NetworkView* view) {
118 if (view_ == view) { 118 if (view_ == view) {
119 view_ = nullptr; 119 view_ = nullptr;
120 timezone_subscription_.reset(); 120 timezone_subscription_.reset();
121 // Ownership of NetworkScreen is complicated; ensure that we remove
122 // this as a NetworkStateHandler observer when the view is destroyed.
123 UnsubscribeNetworkNotification();
121 } 124 }
122 } 125 }
123 126
124 void NetworkScreen::OnUserAction(const std::string& action_id) { 127 void NetworkScreen::OnUserAction(const std::string& action_id) {
125 if (action_id == kUserActionContinueButtonClicked) { 128 if (action_id == kUserActionContinueButtonClicked) {
126 OnContinueButtonPressed(); 129 OnContinueButtonPressed();
127 } else if (action_id == kUserActionConnectDebuggingFeaturesClicked) { 130 } else if (action_id == kUserActionConnectDebuggingFeaturesClicked) {
128 if (delegate_) 131 if (delegate_)
129 delegate_->OnEnableDebuggingScreenRequested(); 132 delegate_->OnEnableDebuggingScreenRequested();
130 } else { 133 } else {
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 FOR_EACH_OBSERVER(Observer, observers_, OnLanguageListReloaded()); 440 FOR_EACH_OBSERVER(Observer, observers_, OnLanguageListReloaded());
438 } 441 }
439 442
440 void NetworkScreen::OnSystemTimezoneChanged() { 443 void NetworkScreen::OnSystemTimezoneChanged() {
441 std::string current_timezone_id; 444 std::string current_timezone_id;
442 CrosSettings::Get()->GetString(kSystemTimezone, &current_timezone_id); 445 CrosSettings::Get()->GetString(kSystemTimezone, &current_timezone_id);
443 GetContextEditor().SetString(kContextKeyTimezone, current_timezone_id); 446 GetContextEditor().SetString(kContextKeyTimezone, current_timezone_id);
444 } 447 }
445 448
446 } // namespace chromeos 449 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/mobile/mobile_activator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698