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

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

Issue 2795143005: [Ash] Remove pre-MD code paths from HoverHighlightView (Closed)
Patch Set: estade comments Created 3 years, 8 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
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/session/session_state_delegate.h" 7 #include "ash/common/session/session_state_delegate.h"
8 #include "ash/common/system/chromeos/bluetooth/tray_bluetooth_helper.h" 8 #include "ash/common/system/chromeos/bluetooth/tray_bluetooth_helper.h"
9 #include "ash/common/system/tray/hover_highlight_view.h" 9 #include "ash/common/system/tray/hover_highlight_view.h"
10 #include "ash/common/system/tray/system_tray.h" 10 #include "ash/common/system/tray/system_tray.h"
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 if (num_paired_devices > 0) 307 if (num_paired_devices > 0)
308 AddSubHeader(IDS_ASH_STATUS_TRAY_BLUETOOTH_UNPAIRED_DEVICES); 308 AddSubHeader(IDS_ASH_STATUS_TRAY_BLUETOOTH_UNPAIRED_DEVICES);
309 AppendSameTypeDevicesToScrollList(discovered_not_paired_devices_, false, 309 AppendSameTypeDevicesToScrollList(discovered_not_paired_devices_, false,
310 false, bluetooth_enabled); 310 false, bluetooth_enabled);
311 } 311 }
312 312
313 // Show user Bluetooth state if there is no bluetooth devices in list. 313 // Show user Bluetooth state if there is no bluetooth devices in list.
314 if (device_map_.size() == 0) { 314 if (device_map_.size() == 0) {
315 if (bluetooth_available && bluetooth_enabled) { 315 if (bluetooth_available && bluetooth_enabled) {
316 HoverHighlightView* container = new HoverHighlightView(this); 316 HoverHighlightView* container = new HoverHighlightView(this);
317 container->AddLabel(l10n_util::GetStringUTF16( 317 container->AddLabelDeprecated(
318 IDS_ASH_STATUS_TRAY_BLUETOOTH_DISCOVERING), 318 l10n_util::GetStringUTF16(
319 gfx::ALIGN_LEFT, false); 319 IDS_ASH_STATUS_TRAY_BLUETOOTH_DISCOVERING),
320 gfx::ALIGN_LEFT, false);
320 scroll_content()->AddChildView(container); 321 scroll_content()->AddChildView(container);
321 } 322 }
322 } 323 }
323 324
324 // Focus the device which was focused before the device-list update. 325 // Focus the device which was focused before the device-list update.
325 if (!focused_device_address.empty()) 326 if (!focused_device_address.empty())
326 FocusDeviceByAddress(focused_device_address); 327 FocusDeviceByAddress(focused_device_address);
327 328
328 scroll_content()->InvalidateLayout(); 329 scroll_content()->InvalidateLayout();
329 } 330 }
(...skipping 16 matching lines...) Expand all
346 HoverHighlightView* AddScrollListItem(const base::string16& text, 347 HoverHighlightView* AddScrollListItem(const base::string16& text,
347 const gfx::ImageSkia& image, 348 const gfx::ImageSkia& image,
348 bool connected, 349 bool connected,
349 bool connecting) { 350 bool connecting) {
350 HoverHighlightView* container = new HoverHighlightView(this); 351 HoverHighlightView* container = new HoverHighlightView(this);
351 if (connected) { 352 if (connected) {
352 SetupConnectedItem(container, text, image); 353 SetupConnectedItem(container, text, image);
353 } else if (connecting) { 354 } else if (connecting) {
354 SetupConnectingItem(container, text, image); 355 SetupConnectingItem(container, text, image);
355 } else { 356 } else {
356 container->AddIconAndLabel(image, text, false); 357 container->AddIconAndLabel(image, text);
357 } 358 }
358 scroll_content()->AddChildView(container); 359 scroll_content()->AddChildView(container);
359 return container; 360 return container;
360 } 361 }
361 362
362 void AddSubHeader(int message_id) { 363 void AddSubHeader(int message_id) {
363 TriView* header = TrayPopupUtils::CreateSubHeaderRowView(); 364 TriView* header = TrayPopupUtils::CreateSubHeaderRowView();
364 TrayPopupUtils::ConfigureAsStickyHeader(header); 365 TrayPopupUtils::ConfigureAsStickyHeader(header);
365 366
366 views::Label* label = TrayPopupUtils::CreateDefaultLabel(); 367 views::Label* label = TrayPopupUtils::CreateDefaultLabel();
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 detailed_->Update(); 647 detailed_->Update();
647 } 648 }
648 649
649 void TrayBluetooth::OnBluetoothDiscoveringChanged() { 650 void TrayBluetooth::OnBluetoothDiscoveringChanged() {
650 if (!detailed_) 651 if (!detailed_)
651 return; 652 return;
652 detailed_->Update(); 653 detailed_->Update();
653 } 654 }
654 655
655 } // namespace ash 656 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698