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

Side by Side Diff: ash/system/date/date_default_view.cc

Issue 1837093003: NOSUBMIT: Demonstrate accelerated layer painting problem in mus/mash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « ash/system/date/date_default_view.h ('k') | components/mus/public/cpp/lib/window.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/date/date_default_view.h" 5 #include "ash/system/date/date_default_view.h"
6 6
7 #include "ash/metrics/user_metrics_recorder.h" 7 #include "ash/metrics/user_metrics_recorder.h"
8 #include "ash/session/session_state_delegate.h" 8 #include "ash/session/session_state_delegate.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/system/date/date_view.h" 10 #include "ash/system/date/date_view.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 } 119 }
120 120
121 tray::DateView* DateDefaultView::GetDateView() { 121 tray::DateView* DateDefaultView::GetDateView() {
122 return date_view_; 122 return date_view_;
123 } 123 }
124 124
125 const tray::DateView* DateDefaultView::GetDateView() const { 125 const tray::DateView* DateDefaultView::GetDateView() const {
126 return date_view_; 126 return date_view_;
127 } 127 }
128 128
129 void DateDefaultView::OnPaint(gfx::Canvas* canvas) {
130 // JAMES: This is triggered by hovering the mouse over the lower-left corner
131 // of the bubble.
132 LOG(ERROR) << "JAMES OnPaint";
133 views::View::OnPaint(canvas);
134 }
135
129 void DateDefaultView::ButtonPressed(views::Button* sender, 136 void DateDefaultView::ButtonPressed(views::Button* sender,
130 const ui::Event& event) { 137 const ui::Event& event) {
131 ash::Shell* shell = ash::Shell::GetInstance(); 138 ash::Shell* shell = ash::Shell::GetInstance();
132 ash::SystemTrayDelegate* tray_delegate = shell->system_tray_delegate(); 139 ash::SystemTrayDelegate* tray_delegate = shell->system_tray_delegate();
133 if (sender == help_button_) { 140 if (sender == help_button_) {
134 shell->metrics()->RecordUserMetricsAction(ash::UMA_TRAY_HELP); 141 shell->metrics()->RecordUserMetricsAction(ash::UMA_TRAY_HELP);
135 tray_delegate->ShowHelp(); 142 tray_delegate->ShowHelp();
136 } else if (sender == shutdown_button_) { 143 } else if (sender == shutdown_button_) {
137 shell->metrics()->RecordUserMetricsAction(ash::UMA_TRAY_SHUT_DOWN); 144 shell->metrics()->RecordUserMetricsAction(ash::UMA_TRAY_SHUT_DOWN);
138 ash::Shell::GetInstance()->lock_state_controller()->RequestShutdown(); 145 ash::Shell::GetInstance()->lock_state_controller()->RequestShutdown();
139 } else if (sender == lock_button_) { 146 } else if (sender == lock_button_) {
140 shell->metrics()->RecordUserMetricsAction(ash::UMA_TRAY_LOCK_SCREEN); 147 shell->metrics()->RecordUserMetricsAction(ash::UMA_TRAY_LOCK_SCREEN);
141 tray_delegate->RequestLockScreen(); 148 tray_delegate->RequestLockScreen();
142 } else { 149 } else {
143 NOTREACHED(); 150 NOTREACHED();
144 } 151 }
145 } 152 }
146 153
147 void DateDefaultView::OnShutdownPolicyChanged(bool reboot_on_shutdown) { 154 void DateDefaultView::OnShutdownPolicyChanged(bool reboot_on_shutdown) {
148 if (!shutdown_button_) 155 if (!shutdown_button_)
149 return; 156 return;
150 157
151 shutdown_button_->SetTooltipText(l10n_util::GetStringUTF16( 158 shutdown_button_->SetTooltipText(l10n_util::GetStringUTF16(
152 reboot_on_shutdown ? IDS_ASH_STATUS_TRAY_REBOOT 159 reboot_on_shutdown ? IDS_ASH_STATUS_TRAY_REBOOT
153 : IDS_ASH_STATUS_TRAY_SHUTDOWN)); 160 : IDS_ASH_STATUS_TRAY_SHUTDOWN));
154 } 161 }
155 162
156 } // namespace ash 163 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/date/date_default_view.h ('k') | components/mus/public/cpp/lib/window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698