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 <stdint.h> | 7 #include <stdint.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 content::SessionStorageNamespace* session_storage_namespace) override; | 173 content::SessionStorageNamespace* session_storage_namespace) override; |
174 | 174 |
175 // content::NotificationObserver overrides: | 175 // content::NotificationObserver overrides: |
176 void Observe(int type, | 176 void Observe(int type, |
177 const content::NotificationSource& source, | 177 const content::NotificationSource& source, |
178 const content::NotificationDetails& details) override; | 178 const content::NotificationDetails& details) override; |
179 | 179 |
180 Profile* profile_; | 180 Profile* profile_; |
181 const std::string app_id_; | 181 const std::string app_id_; |
182 const std::string endpoint_url_; | 182 const std::string endpoint_url_; |
183 scoped_ptr<content::WebContents> web_contents_; | 183 std::unique_ptr<content::WebContents> web_contents_; |
184 content::NotificationRegistrar registrar_; | 184 content::NotificationRegistrar registrar_; |
185 bool started_; | 185 bool started_; |
186 CompletionCallback completion_callback_; | 186 CompletionCallback completion_callback_; |
187 base::WeakPtrFactory<DriveWebContentsManager> weak_ptr_factory_; | 187 base::WeakPtrFactory<DriveWebContentsManager> weak_ptr_factory_; |
188 | 188 |
189 DISALLOW_COPY_AND_ASSIGN(DriveWebContentsManager); | 189 DISALLOW_COPY_AND_ASSIGN(DriveWebContentsManager); |
190 }; | 190 }; |
191 | 191 |
192 DriveWebContentsManager::DriveWebContentsManager( | 192 DriveWebContentsManager::DriveWebContentsManager( |
193 Profile* profile, | 193 Profile* profile, |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 extensions::ExtensionSystem::Get(profile_)->extension_service(); | 452 extensions::ExtensionSystem::Get(profile_)->extension_service(); |
453 DCHECK(service); | 453 DCHECK(service); |
454 const extensions::Extension* extension = | 454 const extensions::Extension* extension = |
455 service->GetExtensionById(drive_hosted_app_id_, false); | 455 service->GetExtensionById(drive_hosted_app_id_, false); |
456 DCHECK(extension); | 456 DCHECK(extension); |
457 | 457 |
458 message_center::RichNotificationData data; | 458 message_center::RichNotificationData data; |
459 data.buttons.push_back(message_center::ButtonInfo( | 459 data.buttons.push_back(message_center::ButtonInfo( |
460 l10n_util::GetStringUTF16(IDS_DRIVE_OFFLINE_NOTIFICATION_BUTTON))); | 460 l10n_util::GetStringUTF16(IDS_DRIVE_OFFLINE_NOTIFICATION_BUTTON))); |
461 ui::ResourceBundle& resource_bundle = ui::ResourceBundle::GetSharedInstance(); | 461 ui::ResourceBundle& resource_bundle = ui::ResourceBundle::GetSharedInstance(); |
462 scoped_ptr<message_center::Notification> notification( | 462 std::unique_ptr<message_center::Notification> notification( |
463 new message_center::Notification( | 463 new message_center::Notification( |
464 message_center::NOTIFICATION_TYPE_SIMPLE, kDriveOfflineNotificationId, | 464 message_center::NOTIFICATION_TYPE_SIMPLE, kDriveOfflineNotificationId, |
465 base::string16(), // title | 465 base::string16(), // title |
466 l10n_util::GetStringUTF16(IDS_DRIVE_OFFLINE_NOTIFICATION_MESSAGE), | 466 l10n_util::GetStringUTF16(IDS_DRIVE_OFFLINE_NOTIFICATION_MESSAGE), |
467 resource_bundle.GetImageNamed(IDR_NOTIFICATION_DRIVE), | 467 resource_bundle.GetImageNamed(IDR_NOTIFICATION_DRIVE), |
468 base::UTF8ToUTF16(extension->name()), GURL(), | 468 base::UTF8ToUTF16(extension->name()), GURL(), |
469 message_center::NotifierId(message_center::NotifierId::APPLICATION, | 469 message_center::NotifierId(message_center::NotifierId::APPLICATION, |
470 kDriveHostedAppId), | 470 kDriveHostedAppId), |
471 data, new DriveOfflineNotificationDelegate(profile_))); | 471 data, new DriveOfflineNotificationDelegate(profile_))); |
472 notification->set_priority(message_center::LOW_PRIORITY); | 472 notification->set_priority(message_center::LOW_PRIORITY); |
473 message_center::MessageCenter::Get()->AddNotification( | 473 message_center::MessageCenter::Get()->AddNotification( |
474 std::move(notification)); | 474 std::move(notification)); |
475 } | 475 } |
476 | 476 |
477 } // namespace chromeos | 477 } // namespace chromeos |
OLD | NEW |