| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 }; | 160 }; |
| 161 | 161 |
| 162 // Get History Information. | 162 // Get History Information. |
| 163 class DownloadsHistoryDataCollector { | 163 class DownloadsHistoryDataCollector { |
| 164 public: | 164 public: |
| 165 DownloadsHistoryDataCollector(int64 download_db_handle, | 165 DownloadsHistoryDataCollector(int64 download_db_handle, |
| 166 DownloadManager* manager) | 166 DownloadManager* manager) |
| 167 : result_valid_(false), | 167 : result_valid_(false), |
| 168 download_db_handle_(download_db_handle) { | 168 download_db_handle_(download_db_handle) { |
| 169 HistoryService* hs = | 169 HistoryService* hs = |
| 170 Profile::FromBrowserContext(manager->browser_context())-> | 170 Profile::FromBrowserContext(manager->BrowserContext())-> |
| 171 GetHistoryService(Profile::EXPLICIT_ACCESS); | 171 GetHistoryService(Profile::EXPLICIT_ACCESS); |
| 172 DCHECK(hs); | 172 DCHECK(hs); |
| 173 hs->QueryDownloads( | 173 hs->QueryDownloads( |
| 174 &callback_consumer_, | 174 &callback_consumer_, |
| 175 base::Bind(&DownloadsHistoryDataCollector::OnQueryDownloadsComplete, | 175 base::Bind(&DownloadsHistoryDataCollector::OnQueryDownloadsComplete, |
| 176 base::Unretained(this))); | 176 base::Unretained(this))); |
| 177 | 177 |
| 178 // TODO(rdsmith): Move message loop out of constructor. | 178 // TODO(rdsmith): Move message loop out of constructor. |
| 179 // Cannot complete immediately because the history backend runs on a | 179 // Cannot complete immediately because the history backend runs on a |
| 180 // separate thread, so we can assume that the RunMessageLoop below will | 180 // separate thread, so we can assume that the RunMessageLoop below will |
| (...skipping 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1539 EXPECT_EQ(1u, observer->NumDangerousDownloadsSeen()); | 1539 EXPECT_EQ(1u, observer->NumDangerousDownloadsSeen()); |
| 1540 | 1540 |
| 1541 // Download shelf should close. Download panel stays open on ChromeOS. | 1541 // Download shelf should close. Download panel stays open on ChromeOS. |
| 1542 CheckDownloadUI(browser(), false, true, FilePath()); | 1542 CheckDownloadUI(browser(), false, true, FilePath()); |
| 1543 | 1543 |
| 1544 // Check that the extension was installed. | 1544 // Check that the extension was installed. |
| 1545 ExtensionService* extension_service = | 1545 ExtensionService* extension_service = |
| 1546 browser()->profile()->GetExtensionService(); | 1546 browser()->profile()->GetExtensionService(); |
| 1547 ASSERT_TRUE(extension_service->GetExtensionById(kLargeThemeCrxId, false)); | 1547 ASSERT_TRUE(extension_service->GetExtensionById(kLargeThemeCrxId, false)); |
| 1548 } | 1548 } |
| OLD | NEW |