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/chromeos/file_system_provider/notification_manager.h" | 5 #include "chrome/browser/chromeos/file_system_provider/notification_manager.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/extensions/app_icon_loader_impl.h" | 9 #include "chrome/browser/extensions/app_icon_loader_impl.h" |
10 #include "chrome/grit/generated_resources.h" | 10 #include "chrome/grit/generated_resources.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 // Passing a raw pointer is safe here, since the life of each notification is | 29 // Passing a raw pointer is safe here, since the life of each notification is |
30 // shorter than life of the |notification_manager|. | 30 // shorter than life of the |notification_manager|. |
31 explicit ProviderNotificationDelegate( | 31 explicit ProviderNotificationDelegate( |
32 NotificationManager* notification_manager) | 32 NotificationManager* notification_manager) |
33 : notification_manager_(notification_manager) {} | 33 : notification_manager_(notification_manager) {} |
34 | 34 |
35 virtual void ButtonClick(int button_index) override { | 35 virtual void ButtonClick(int button_index) override { |
36 notification_manager_->OnButtonClick(button_index); | 36 notification_manager_->OnButtonClick(button_index); |
37 } | 37 } |
38 | 38 |
39 virtual void Display() override {} | |
40 | |
41 virtual void Error() override { notification_manager_->OnError(); } | 39 virtual void Error() override { notification_manager_->OnError(); } |
42 | 40 |
43 virtual void Close(bool by_user) override { | 41 virtual void Close(bool by_user) override { |
44 notification_manager_->OnClose(); | 42 notification_manager_->OnClose(); |
45 } | 43 } |
46 | 44 |
47 virtual void Click() override {} | |
48 | |
49 private: | 45 private: |
50 virtual ~ProviderNotificationDelegate() {} | 46 virtual ~ProviderNotificationDelegate() {} |
51 NotificationManager* notification_manager_; // Not owned. | 47 NotificationManager* notification_manager_; // Not owned. |
52 | 48 |
53 DISALLOW_COPY_AND_ASSIGN(ProviderNotificationDelegate); | 49 DISALLOW_COPY_AND_ASSIGN(ProviderNotificationDelegate); |
54 }; | 50 }; |
55 | 51 |
56 } // namespace | 52 } // namespace |
57 | 53 |
58 NotificationManager::NotificationManager( | 54 NotificationManager::NotificationManager( |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 while (it != callbacks_.end()) { | 148 while (it != callbacks_.end()) { |
153 CallbackMap::iterator current_it = it++; | 149 CallbackMap::iterator current_it = it++; |
154 NotificationCallback callback = current_it->second; | 150 NotificationCallback callback = current_it->second; |
155 callbacks_.erase(current_it); | 151 callbacks_.erase(current_it); |
156 callback.Run(result); | 152 callback.Run(result); |
157 } | 153 } |
158 } | 154 } |
159 | 155 |
160 } // namespace file_system_provider | 156 } // namespace file_system_provider |
161 } // namespace chromeos | 157 } // namespace chromeos |
OLD | NEW |