| 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/chromeos/first_run/drive_first_run_controller.h" | 5 #include "chrome/browser/chromeos/first_run/drive_first_run_controller.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/system/tray/system_tray_delegate.h" | 8 #include "ash/system/tray/system_tray_delegate.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // NotificationDelegate for the notification that is displayed when Drive | 78 // NotificationDelegate for the notification that is displayed when Drive |
| 79 // offline mode is enabled automatically. Clicking on the notification button | 79 // offline mode is enabled automatically. Clicking on the notification button |
| 80 // will open the Drive settings page. | 80 // will open the Drive settings page. |
| 81 class DriveOfflineNotificationDelegate | 81 class DriveOfflineNotificationDelegate |
| 82 : public message_center::NotificationDelegate { | 82 : public message_center::NotificationDelegate { |
| 83 public: | 83 public: |
| 84 explicit DriveOfflineNotificationDelegate(Profile* profile) | 84 explicit DriveOfflineNotificationDelegate(Profile* profile) |
| 85 : profile_(profile) {} | 85 : profile_(profile) {} |
| 86 | 86 |
| 87 // message_center::NotificationDelegate overrides: | 87 // message_center::NotificationDelegate overrides: |
| 88 virtual void Display() override {} | |
| 89 virtual void Error() override {} | |
| 90 virtual void Close(bool by_user) override {} | |
| 91 virtual void Click() override {} | |
| 92 virtual void ButtonClick(int button_index) override; | 88 virtual void ButtonClick(int button_index) override; |
| 93 | 89 |
| 94 protected: | 90 protected: |
| 95 virtual ~DriveOfflineNotificationDelegate() {} | 91 virtual ~DriveOfflineNotificationDelegate() {} |
| 96 | 92 |
| 97 private: | 93 private: |
| 98 Profile* profile_; | 94 Profile* profile_; |
| 99 | 95 |
| 100 DISALLOW_COPY_AND_ASSIGN(DriveOfflineNotificationDelegate); | 96 DISALLOW_COPY_AND_ASSIGN(DriveOfflineNotificationDelegate); |
| 101 }; | 97 }; |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 base::UTF8ToUTF16(extension->name()), | 466 base::UTF8ToUTF16(extension->name()), |
| 471 message_center::NotifierId(message_center::NotifierId::APPLICATION, | 467 message_center::NotifierId(message_center::NotifierId::APPLICATION, |
| 472 kDriveHostedAppId), | 468 kDriveHostedAppId), |
| 473 data, | 469 data, |
| 474 new DriveOfflineNotificationDelegate(profile_))); | 470 new DriveOfflineNotificationDelegate(profile_))); |
| 475 notification->set_priority(message_center::LOW_PRIORITY); | 471 notification->set_priority(message_center::LOW_PRIORITY); |
| 476 message_center::MessageCenter::Get()->AddNotification(notification.Pass()); | 472 message_center::MessageCenter::Get()->AddNotification(notification.Pass()); |
| 477 } | 473 } |
| 478 | 474 |
| 479 } // namespace chromeos | 475 } // namespace chromeos |
| OLD | NEW |