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

Side by Side Diff: ash/common/system/chromeos/bluetooth/tray_bluetooth.cc

Issue 2509783002: Don't reset scroll position of contents on every ScrollView layout. (Closed)
Patch Set: Created 4 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) 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 "ash/common/system/chromeos/bluetooth/tray_bluetooth.h" 5 #include "ash/common/system/chromeos/bluetooth/tray_bluetooth.h"
6 6
7 #include "ash/common/material_design/material_design_controller.h" 7 #include "ash/common/material_design/material_design_controller.h"
8 #include "ash/common/session/session_state_delegate.h" 8 #include "ash/common/session/session_state_delegate.h"
9 #include "ash/common/system/tray/fixed_sized_scroll_view.h" 9 #include "ash/common/system/tray/fixed_sized_scroll_view.h"
10 #include "ash/common/system/tray/hover_highlight_view.h" 10 #include "ash/common/system/tray/hover_highlight_view.h"
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 // Show user Bluetooth state if there is no bluetooth devices in list. 322 // Show user Bluetooth state if there is no bluetooth devices in list.
323 if (device_map_.size() == 0) { 323 if (device_map_.size() == 0) {
324 if (bluetooth_available && bluetooth_enabled) { 324 if (bluetooth_available && bluetooth_enabled) {
325 AddScrollListItem(l10n_util::GetStringUTF16( 325 AddScrollListItem(l10n_util::GetStringUTF16(
326 IDS_ASH_STATUS_TRAY_BLUETOOTH_DISCOVERING), 326 IDS_ASH_STATUS_TRAY_BLUETOOTH_DISCOVERING),
327 false /* highlight */, false /* checked */, 327 false /* highlight */, false /* checked */,
328 true /* enabled */); 328 true /* enabled */);
329 } 329 }
330 } 330 }
331 331
332 scroll_content()->SizeToPreferredSize(); 332 scroll_content()->InvalidateLayout();
333 } 333 }
334 334
335 void AppendSameTypeDevicesToScrollList(const BluetoothDeviceList& list, 335 void AppendSameTypeDevicesToScrollList(const BluetoothDeviceList& list,
336 bool highlight, 336 bool highlight,
337 bool checked, 337 bool checked,
338 bool enabled) { 338 bool enabled) {
339 for (size_t i = 0; i < list.size(); ++i) { 339 for (size_t i = 0; i < list.size(); ++i) {
340 HoverHighlightView* container = nullptr; 340 HoverHighlightView* container = nullptr;
341 if (UseMd()) { 341 if (UseMd()) {
342 gfx::ImageSkia icon_image = CreateVectorIcon( 342 gfx::ImageSkia icon_image = CreateVectorIcon(
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 detailed_->Update(); 728 detailed_->Update();
729 } 729 }
730 730
731 void TrayBluetooth::OnBluetoothDiscoveringChanged() { 731 void TrayBluetooth::OnBluetoothDiscoveringChanged() {
732 if (!detailed_) 732 if (!detailed_)
733 return; 733 return;
734 detailed_->Update(); 734 detailed_->Update();
735 } 735 }
736 736
737 } // namespace ash 737 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/common/system/tray/fixed_sized_scroll_view.cc » ('j') | ui/views/controls/scroll_view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698