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