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

Side by Side Diff: ash/system/chromeos/network/vpn_list_view.cc

Issue 1022573002: Fix crash in VPNListNetworkEntry::UpdateFromNetworkState() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ash/system/chromeos/network/vpn_list_view.h" 5 #include "ash/system/chromeos/network/vpn_list_view.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/metrics/user_metrics_recorder.h" 10 #include "ash/metrics/user_metrics_recorder.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 views::Border::CreateEmptyBorder(0, kTrayPopupPaddingHorizontal, 0, 3)); 217 views::Border::CreateEmptyBorder(0, kTrayPopupPaddingHorizontal, 0, 3));
218 } else { 218 } else {
219 SetBorder( 219 SetBorder(
220 views::Border::CreateEmptyBorder(0, kTrayPopupPaddingHorizontal, 0, 0)); 220 views::Border::CreateEmptyBorder(0, kTrayPopupPaddingHorizontal, 0, 0));
221 } 221 }
222 222
223 // The icon and the disconnect button are always set to their preferred size. 223 // The icon and the disconnect button are always set to their preferred size.
224 // All remaining space is used for the network name. 224 // All remaining space is used for the network name.
225 views::BoxLayout* layout = new views::BoxLayout( 225 views::BoxLayout* layout = new views::BoxLayout(
226 views::BoxLayout::kHorizontal, 0, 3, kTrayPopupPaddingBetweenItems); 226 views::BoxLayout::kHorizontal, 0, 3, kTrayPopupPaddingBetweenItems);
227 SetLayoutManager(layout);
227 layout->SetDefaultFlex(0); 228 layout->SetDefaultFlex(0);
228 layout->SetFlexForView(text_label(), 1); 229 layout->SetFlexForView(text_label(), 1);
229 SetLayoutManager(layout);
230 Layout(); 230 Layout();
231 } 231 }
232 232
233 } // namespace 233 } // namespace
234 234
235 VPNListView::VPNListView(ui::NetworkListDelegate* delegate) 235 VPNListView::VPNListView(ui::NetworkListDelegate* delegate)
236 : delegate_(delegate) { 236 : delegate_(delegate) {
237 Shell::GetInstance()->system_tray_delegate()->GetVPNDelegate()->AddObserver( 237 Shell::GetInstance()->system_tray_delegate()->GetVPNDelegate()->AddObserver(
238 this); 238 this);
239 } 239 }
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 } 410 }
411 } 411 }
412 412
413 // Add providers without any configured networks, in the order that the 413 // Add providers without any configured networks, in the order that the
414 // providers were returned by the extensions system. 414 // providers were returned by the extensions system.
415 for (const VPNProvider& provider : providers) 415 for (const VPNProvider& provider : providers)
416 AddProviderAndNetworks(provider.key, provider.name, networks); 416 AddProviderAndNetworks(provider.key, provider.name, networks);
417 } 417 }
418 418
419 } // namespace ash 419 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698