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

Side by Side Diff: chrome/browser/chromeos/hats/hats_notification_controller.cc

Issue 2294473003: Clicking on the HaTS notification now opens the survey dialog (Closed)
Patch Set: Created 4 years, 3 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 | « chrome/browser/chromeos/hats/hats_notification_controller.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) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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 "chrome/browser/chromeos/hats/hats_notification_controller.h" 5 #include "chrome/browser/chromeos/hats/hats_notification_controller.h"
6 6
7 #include "ash/common/system/system_notifier.h" 7 #include "ash/common/system/system_notifier.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/feature_list.h" 9 #include "base/feature_list.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 173
174 return true; 174 return true;
175 } 175 }
176 176
177 // NotificationDelegate override: 177 // NotificationDelegate override:
178 std::string HatsNotificationController::id() const { 178 std::string HatsNotificationController::id() const {
179 return kDelegateId; 179 return kDelegateId;
180 } 180 }
181 181
182 // message_center::NotificationDelegate override: 182 // message_center::NotificationDelegate override:
183 void HatsNotificationController::Click() {
184 ButtonClick(0 /* This argument is no-op in the function. */);
stevenjb 2016/08/30 15:39:16 nit: ButtonClick(0 /* unused */);
malaykeshav 2016/08/30 18:10:30 done
185 }
186
187 // message_center::NotificationDelegate override:
183 void HatsNotificationController::ButtonClick(int button_index) { 188 void HatsNotificationController::ButtonClick(int button_index) {
stevenjb 2016/08/30 15:39:16 nit: int /* button_index */
malaykeshav 2016/08/30 18:10:30 done
184 UpdateLastInteractionTime(); 189 UpdateLastInteractionTime();
185 190
186 // The dialog deletes itslef on close. 191 // The dialog deletes itslef on close.
187 HatsDialog::CreateAndShow(IsGoogleUser(profile_->GetProfileUserName())); 192 HatsDialog::CreateAndShow(IsGoogleUser(profile_->GetProfileUserName()));
188 193
189 // Remove the notification. 194 // Remove the notification.
190 g_browser_process->notification_ui_manager()->CancelById( 195 g_browser_process->notification_ui_manager()->CancelById(
191 id(), NotificationUIManager::GetProfileID(profile_)); 196 id(), NotificationUIManager::GetProfileID(profile_));
192 } 197 }
193 198
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 GURL(kNotificationOriginUrl), kNotificationId, optional, this); 273 GURL(kNotificationOriginUrl), kNotificationId, optional, this);
269 } 274 }
270 275
271 void HatsNotificationController::UpdateLastInteractionTime() { 276 void HatsNotificationController::UpdateLastInteractionTime() {
272 PrefService* pref_service = profile_->GetPrefs(); 277 PrefService* pref_service = profile_->GetPrefs();
273 pref_service->SetInt64(prefs::kHatsLastInteractionTimestamp, 278 pref_service->SetInt64(prefs::kHatsLastInteractionTimestamp,
274 base::Time::Now().ToInternalValue()); 279 base::Time::Now().ToInternalValue());
275 } 280 }
276 281
277 } // namespace chromeos 282 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/hats/hats_notification_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698