Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: chrome/browser/ui/webui/chromeos/drive_internals_ui.cc

Issue 23514025: Use GetForBrowserContext instead of GetForProfile for DriveNotificationManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase & resolve conflict Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/webui/chromeos/drive_internals_ui.h" 5 #include "chrome/browser/ui/webui/chromeos/drive_internals_ui.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_enumerator.h" 10 #include "base/files/file_enumerator.h"
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 &DriveInternalsWebUIHandler::OnGetFilesystemMetadataForDeltaUpdate, 556 &DriveInternalsWebUIHandler::OnGetFilesystemMetadataForDeltaUpdate,
557 weak_ptr_factory_.GetWeakPtr())); 557 weak_ptr_factory_.GetWeakPtr()));
558 } 558 }
559 559
560 void DriveInternalsWebUIHandler::OnGetFilesystemMetadataForDeltaUpdate( 560 void DriveInternalsWebUIHandler::OnGetFilesystemMetadataForDeltaUpdate(
561 const drive::FileSystemMetadata& metadata) { 561 const drive::FileSystemMetadata& metadata) {
562 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 562 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
563 563
564 Profile* profile = Profile::FromWebUI(web_ui()); 564 Profile* profile = Profile::FromWebUI(web_ui());
565 drive::DriveNotificationManager* drive_notification_manager = 565 drive::DriveNotificationManager* drive_notification_manager =
566 drive::DriveNotificationManagerFactory::GetForProfile(profile); 566 drive::DriveNotificationManagerFactory::GetForBrowserContext(profile);
567 if (!drive_notification_manager) 567 if (!drive_notification_manager)
568 return; 568 return;
569 569
570 base::DictionaryValue delta_update_status; 570 base::DictionaryValue delta_update_status;
571 delta_update_status.SetBoolean( 571 delta_update_status.SetBoolean(
572 "push-notification-enabled", 572 "push-notification-enabled",
573 drive_notification_manager->push_notification_enabled()); 573 drive_notification_manager->push_notification_enabled());
574 delta_update_status.SetString( 574 delta_update_status.SetString(
575 "last-update-check-time", 575 "last-update-check-time",
576 google_apis::util::FormatTimeAsStringLocaltime( 576 google_apis::util::FormatTimeAsStringLocaltime(
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 content::WebUIDataSource::Create(chrome::kChromeUIDriveInternalsHost); 816 content::WebUIDataSource::Create(chrome::kChromeUIDriveInternalsHost);
817 source->AddResourcePath("drive_internals.css", IDR_DRIVE_INTERNALS_CSS); 817 source->AddResourcePath("drive_internals.css", IDR_DRIVE_INTERNALS_CSS);
818 source->AddResourcePath("drive_internals.js", IDR_DRIVE_INTERNALS_JS); 818 source->AddResourcePath("drive_internals.js", IDR_DRIVE_INTERNALS_JS);
819 source->SetDefaultResource(IDR_DRIVE_INTERNALS_HTML); 819 source->SetDefaultResource(IDR_DRIVE_INTERNALS_HTML);
820 820
821 Profile* profile = Profile::FromWebUI(web_ui); 821 Profile* profile = Profile::FromWebUI(web_ui);
822 content::WebUIDataSource::Add(profile, source); 822 content::WebUIDataSource::Add(profile, source);
823 } 823 }
824 824
825 } // namespace chromeos 825 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698