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

Side by Side Diff: ash/system/tray/tray_notification_view.cc

Issue 16046007: Shows the display info as a popup when a new display is connected. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: PopupDetailedView -> ShowNotificationView Created 7 years, 6 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
« no previous file with comments | « ash/system/tray/tray_notification_view.h ('k') | 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 (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/tray/tray_notification_view.h" 5 #include "ash/system/tray/tray_notification_view.h"
6 6
7 #include "ash/system/tray/system_tray_item.h" 7 #include "ash/system/tray/system_tray_item.h"
8 #include "ash/system/tray/tray_constants.h" 8 #include "ash/system/tray/tray_constants.h"
9 #include "grit/ash_strings.h" 9 #include "grit/ash_strings.h"
10 #include "grit/ui_resources.h" 10 #include "grit/ui_resources.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 void TrayNotificationView::UpdateViewAndImage(views::View* new_contents, 101 void TrayNotificationView::UpdateViewAndImage(views::View* new_contents,
102 const gfx::ImageSkia& image) { 102 const gfx::ImageSkia& image) {
103 RemoveAllChildViews(true); 103 RemoveAllChildViews(true);
104 InitView(new_contents); 104 InitView(new_contents);
105 icon_->SetImage(image); 105 icon_->SetImage(image);
106 Layout(); 106 Layout();
107 PreferredSizeChanged(); 107 PreferredSizeChanged();
108 SchedulePaint(); 108 SchedulePaint();
109 } 109 }
110 110
111 void TrayNotificationView::StartAutoCloseTimer(int seconds) {
112 autoclose_.Stop();
113 autoclose_delay_ = seconds;
114 if (autoclose_delay_) {
115 autoclose_.Start(FROM_HERE,
116 base::TimeDelta::FromSeconds(autoclose_delay_),
117 this, &TrayNotificationView::HandleClose);
118 }
119 }
120
121 void TrayNotificationView::StopAutoCloseTimer() {
122 autoclose_.Stop();
123 }
124
125 void TrayNotificationView::RestartAutoCloseTimer() {
126 if (autoclose_delay_)
127 StartAutoCloseTimer(autoclose_delay_);
128 }
129
111 void TrayNotificationView::ButtonPressed(views::Button* sender, 130 void TrayNotificationView::ButtonPressed(views::Button* sender,
112 const ui::Event& event) { 131 const ui::Event& event) {
113 HandleClose(); 132 HandleClose();
114 } 133 }
115 134
116 bool TrayNotificationView::OnMousePressed(const ui::MouseEvent& event) { 135 bool TrayNotificationView::OnMousePressed(const ui::MouseEvent& event) {
117 HandleClickAction(); 136 HandleClickAction();
118 return true; 137 return true;
119 } 138 }
120 139
(...skipping 22 matching lines...) Expand all
143 owner_->HideNotificationView(); 162 owner_->HideNotificationView();
144 } 163 }
145 164
146 void TrayNotificationView::HandleClickAction() { 165 void TrayNotificationView::HandleClickAction() {
147 HandleClose(); 166 HandleClose();
148 OnClickAction(); 167 OnClickAction();
149 } 168 }
150 169
151 } // namespace internal 170 } // namespace internal
152 } // namespace ash 171 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray/tray_notification_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698