| OLD | NEW |
| 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 "chrome/browser/sync/sync_error_notifier_ash.h" | 5 #include "chrome/browser/sync/sync_error_notifier_ash.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_delegate.h" | 8 #include "ash/shell_delegate.h" |
| 9 #include "ash/system/system_notifier.h" | 9 #include "ash/system/system_notifier.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 const char kProfileSyncNotificationId[] = "chrome://settings/sync/"; | 39 const char kProfileSyncNotificationId[] = "chrome://settings/sync/"; |
| 40 | 40 |
| 41 // A simple notification delegate for the sync setup button. | 41 // A simple notification delegate for the sync setup button. |
| 42 class SyncNotificationDelegate : public NotificationDelegate { | 42 class SyncNotificationDelegate : public NotificationDelegate { |
| 43 public: | 43 public: |
| 44 SyncNotificationDelegate(const std::string& id, | 44 SyncNotificationDelegate(const std::string& id, |
| 45 Profile* profile); | 45 Profile* profile); |
| 46 | 46 |
| 47 // NotificationDelegate: | 47 // NotificationDelegate: |
| 48 virtual void Display() override; | 48 virtual void Display() override; |
| 49 virtual void Error() override; | |
| 50 virtual void Close(bool by_user) override; | 49 virtual void Close(bool by_user) override; |
| 51 virtual bool HasClickedListener() override; | 50 virtual bool HasClickedListener() override; |
| 52 virtual void Click() override; | 51 virtual void Click() override; |
| 53 virtual void ButtonClick(int button_index) override; | 52 virtual void ButtonClick(int button_index) override; |
| 54 virtual std::string id() const override; | 53 virtual std::string id() const override; |
| 55 | 54 |
| 56 protected: | 55 protected: |
| 57 virtual ~SyncNotificationDelegate(); | 56 virtual ~SyncNotificationDelegate(); |
| 58 | 57 |
| 59 private: | 58 private: |
| (...skipping 13 matching lines...) Expand all Loading... |
| 73 : id_(id), | 72 : id_(id), |
| 74 profile_(profile) { | 73 profile_(profile) { |
| 75 } | 74 } |
| 76 | 75 |
| 77 SyncNotificationDelegate::~SyncNotificationDelegate() { | 76 SyncNotificationDelegate::~SyncNotificationDelegate() { |
| 78 } | 77 } |
| 79 | 78 |
| 80 void SyncNotificationDelegate::Display() { | 79 void SyncNotificationDelegate::Display() { |
| 81 } | 80 } |
| 82 | 81 |
| 83 void SyncNotificationDelegate::Error() { | |
| 84 } | |
| 85 | |
| 86 void SyncNotificationDelegate::Close(bool by_user) { | 82 void SyncNotificationDelegate::Close(bool by_user) { |
| 87 } | 83 } |
| 88 | 84 |
| 89 bool SyncNotificationDelegate::HasClickedListener() { | 85 bool SyncNotificationDelegate::HasClickedListener() { |
| 90 return false; | 86 return false; |
| 91 } | 87 } |
| 92 | 88 |
| 93 void SyncNotificationDelegate::Click() { | 89 void SyncNotificationDelegate::Click() { |
| 94 ShowSyncSetup(); | 90 ShowSyncSetup(); |
| 95 } | 91 } |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 ui::ResourceBundle::GetSharedInstance().GetImageNamed( | 190 ui::ResourceBundle::GetSharedInstance().GetImageNamed( |
| 195 IDR_NOTIFICATION_ALERT), | 191 IDR_NOTIFICATION_ALERT), |
| 196 blink::WebTextDirectionDefault, | 192 blink::WebTextDirectionDefault, |
| 197 notifier_id, | 193 notifier_id, |
| 198 base::string16(), // display_source | 194 base::string16(), // display_source |
| 199 base::ASCIIToUTF16(notification_id_), | 195 base::ASCIIToUTF16(notification_id_), |
| 200 data, | 196 data, |
| 201 delegate); | 197 delegate); |
| 202 notification_ui_manager->Add(notification, profile_); | 198 notification_ui_manager->Add(notification, profile_); |
| 203 } | 199 } |
| OLD | NEW |