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

Side by Side Diff: ash/system/web_notification/web_notification_tray.cc

Issue 145033006: views: Make View::set_border() take a scoped_ptr<>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Further renaming Created 6 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 | Annotate | Revision Log
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/system/web_notification/web_notification_tray.h" 5 #include "ash/system/web_notification/web_notification_tray.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/shelf/shelf_layout_manager.h" 9 #include "ash/shelf/shelf_layout_manager.h"
10 #include "ash/shelf/shelf_layout_manager_observer.h" 10 #include "ash/shelf/shelf_layout_manager_observer.h"
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 : TrayBackgroundView(status_area_widget), 304 : TrayBackgroundView(status_area_widget),
305 button_(NULL), 305 button_(NULL),
306 show_message_center_on_unlock_(false), 306 show_message_center_on_unlock_(false),
307 should_update_tray_content_(false), 307 should_update_tray_content_(false),
308 should_block_shelf_auto_hide_(false) { 308 should_block_shelf_auto_hide_(false) {
309 button_ = new internal::WebNotificationButton(this); 309 button_ = new internal::WebNotificationButton(this);
310 button_->set_triggerable_event_flags( 310 button_->set_triggerable_event_flags(
311 ui::EF_LEFT_MOUSE_BUTTON | ui::EF_RIGHT_MOUSE_BUTTON); 311 ui::EF_LEFT_MOUSE_BUTTON | ui::EF_RIGHT_MOUSE_BUTTON);
312 tray_container()->AddChildView(button_); 312 tray_container()->AddChildView(button_);
313 SetContentsBackground(); 313 SetContentsBackground();
314 tray_container()->set_border(NULL); 314 tray_container()->ClearBorder();
315 SetVisible(false); 315 SetVisible(false);
316 message_center_tray_.reset(new message_center::MessageCenterTray( 316 message_center_tray_.reset(new message_center::MessageCenterTray(
317 this, 317 this,
318 message_center::MessageCenter::Get())); 318 message_center::MessageCenter::Get()));
319 work_area_observer_.reset(new internal::WorkAreaObserver()); 319 work_area_observer_.reset(new internal::WorkAreaObserver());
320 OnMessageCenterTrayChanged(); 320 OnMessageCenterTrayChanged();
321 } 321 }
322 322
323 WebNotificationTray::~WebNotificationTray() { 323 WebNotificationTray::~WebNotificationTray() {
324 // Release any child views that might have back pointers before ~View(). 324 // Release any child views that might have back pointers before ~View().
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 451
452 void WebNotificationTray::UpdateAfterLoginStatusChange( 452 void WebNotificationTray::UpdateAfterLoginStatusChange(
453 user::LoginStatus login_status) { 453 user::LoginStatus login_status) {
454 OnMessageCenterTrayChanged(); 454 OnMessageCenterTrayChanged();
455 } 455 }
456 456
457 void WebNotificationTray::SetShelfAlignment(ShelfAlignment alignment) { 457 void WebNotificationTray::SetShelfAlignment(ShelfAlignment alignment) {
458 if (alignment == shelf_alignment()) 458 if (alignment == shelf_alignment())
459 return; 459 return;
460 internal::TrayBackgroundView::SetShelfAlignment(alignment); 460 internal::TrayBackgroundView::SetShelfAlignment(alignment);
461 tray_container()->set_border(NULL); 461 tray_container()->ClearBorder();
462 // Destroy any existing bubble so that it will be rebuilt correctly. 462 // Destroy any existing bubble so that it will be rebuilt correctly.
463 message_center_tray_->HideMessageCenterBubble(); 463 message_center_tray_->HideMessageCenterBubble();
464 message_center_tray_->HidePopupBubble(); 464 message_center_tray_->HidePopupBubble();
465 } 465 }
466 466
467 void WebNotificationTray::AnchorUpdated() { 467 void WebNotificationTray::AnchorUpdated() {
468 if (message_center_bubble()) { 468 if (message_center_bubble()) {
469 message_center_bubble()->bubble_view()->UpdateBubble(); 469 message_center_bubble()->bubble_view()->UpdateBubble();
470 UpdateBubbleViewArrow(message_center_bubble()->bubble_view()); 470 UpdateBubbleViewArrow(message_center_bubble()->bubble_view());
471 } 471 }
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 621
622 message_center::MessageCenterBubble* 622 message_center::MessageCenterBubble*
623 WebNotificationTray::GetMessageCenterBubbleForTest() { 623 WebNotificationTray::GetMessageCenterBubbleForTest() {
624 if (!message_center_bubble()) 624 if (!message_center_bubble())
625 return NULL; 625 return NULL;
626 return static_cast<message_center::MessageCenterBubble*>( 626 return static_cast<message_center::MessageCenterBubble*>(
627 message_center_bubble()->bubble()); 627 message_center_bubble()->bubble());
628 } 628 }
629 629
630 } // namespace ash 630 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698