| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/printing/cloud_print/privet_notifications.h" | 5 #include "chrome/browser/printing/cloud_print/privet_notifications.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 | 370 |
| 371 DCHECK_EQ(1, button_index); | 371 DCHECK_EQ(1, button_index); |
| 372 ReportPrivetUmaEvent(PRIVET_DISABLE_NOTIFICATIONS_CLICKED); | 372 ReportPrivetUmaEvent(PRIVET_DISABLE_NOTIFICATIONS_CLICKED); |
| 373 DisableNotifications(); | 373 DisableNotifications(); |
| 374 } | 374 } |
| 375 | 375 |
| 376 void PrivetNotificationDelegate::OpenTab(const GURL& url) { | 376 void PrivetNotificationDelegate::OpenTab(const GURL& url) { |
| 377 Profile* profile = Profile::FromBrowserContext(profile_); | 377 Profile* profile = Profile::FromBrowserContext(profile_); |
| 378 chrome::NavigateParams params(profile, url, | 378 chrome::NavigateParams params(profile, url, |
| 379 ui::PAGE_TRANSITION_AUTO_TOPLEVEL); | 379 ui::PAGE_TRANSITION_AUTO_TOPLEVEL); |
| 380 params.disposition = NEW_FOREGROUND_TAB; | 380 params.disposition = WindowOpenDisposition::NEW_FOREGROUND_TAB; |
| 381 chrome::Navigate(¶ms); | 381 chrome::Navigate(¶ms); |
| 382 } | 382 } |
| 383 | 383 |
| 384 void PrivetNotificationDelegate::DisableNotifications() { | 384 void PrivetNotificationDelegate::DisableNotifications() { |
| 385 Profile* profile = Profile::FromBrowserContext(profile_); | 385 Profile* profile = Profile::FromBrowserContext(profile_); |
| 386 profile->GetPrefs()->SetBoolean(prefs::kLocalDiscoveryNotificationsEnabled, | 386 profile->GetPrefs()->SetBoolean(prefs::kLocalDiscoveryNotificationsEnabled, |
| 387 false); | 387 false); |
| 388 } | 388 } |
| 389 | 389 |
| 390 } // namespace cloud_print | 390 } // namespace cloud_print |
| OLD | NEW |