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

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

Issue 2509243002: Revert of 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
« no previous file with comments | « no previous file | ash/common/system/tray/fixed_sized_scroll_view.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 "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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 // Show user Bluetooth state if there is no bluetooth devices in list. 323 // Show user Bluetooth state if there is no bluetooth devices in list.
324 if (device_map_.size() == 0) { 324 if (device_map_.size() == 0) {
325 if (bluetooth_available && bluetooth_enabled) { 325 if (bluetooth_available && bluetooth_enabled) {
326 AddScrollListItem(l10n_util::GetStringUTF16( 326 AddScrollListItem(l10n_util::GetStringUTF16(
327 IDS_ASH_STATUS_TRAY_BLUETOOTH_DISCOVERING), 327 IDS_ASH_STATUS_TRAY_BLUETOOTH_DISCOVERING),
328 false /* highlight */, false /* checked */, 328 false /* highlight */, false /* checked */,
329 true /* enabled */); 329 true /* enabled */);
330 } 330 }
331 } 331 }
332 332
333 scroll_content()->InvalidateLayout(); 333 scroll_content()->SizeToPreferredSize();
334 } 334 }
335 335
336 void AppendSameTypeDevicesToScrollList(const BluetoothDeviceList& list, 336 void AppendSameTypeDevicesToScrollList(const BluetoothDeviceList& list,
337 bool highlight, 337 bool highlight,
338 bool checked, 338 bool checked,
339 bool enabled) { 339 bool enabled) {
340 for (size_t i = 0; i < list.size(); ++i) { 340 for (size_t i = 0; i < list.size(); ++i) {
341 HoverHighlightView* container = nullptr; 341 HoverHighlightView* container = nullptr;
342 if (UseMd()) { 342 if (UseMd()) {
343 gfx::ImageSkia icon_image = CreateVectorIcon( 343 gfx::ImageSkia icon_image = CreateVectorIcon(
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 detailed_->Update(); 743 detailed_->Update();
744 } 744 }
745 745
746 void TrayBluetooth::OnBluetoothDiscoveringChanged() { 746 void TrayBluetooth::OnBluetoothDiscoveringChanged() {
747 if (!detailed_) 747 if (!detailed_)
748 return; 748 return;
749 detailed_->Update(); 749 detailed_->Update();
750 } 750 }
751 751
752 } // namespace ash 752 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/common/system/tray/fixed_sized_scroll_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698