OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Download utility implementation | 5 // Download utility implementation |
6 | 6 |
7 #include "chrome/browser/download/download_util.h" | 7 #include "chrome/browser/download/download_util.h" |
8 | 8 |
9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
10 #include <shobjidl.h> | 10 #include <shobjidl.h> |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 } else { | 298 } else { |
299 TabContents* contents = NULL; | 299 TabContents* contents = NULL; |
300 // Get last active normal browser of profile. | 300 // Get last active normal browser of profile. |
301 Browser* last_active = | 301 Browser* last_active = |
302 BrowserList::FindBrowserWithType(profile, Browser::TYPE_NORMAL, true); | 302 BrowserList::FindBrowserWithType(profile, Browser::TYPE_NORMAL, true); |
303 if (last_active) | 303 if (last_active) |
304 contents = last_active->GetSelectedTabContents(); | 304 contents = last_active->GetSelectedTabContents(); |
305 if (contents) { | 305 if (contents) { |
306 contents->AddInfoBar( | 306 contents->AddInfoBar( |
307 new SimpleAlertInfoBarDelegate(contents, | 307 new SimpleAlertInfoBarDelegate(contents, |
308 l10n_util::GetString( | 308 l10n_util::GetStringUTF16( |
309 IDS_EXTENSION_INCOGNITO_INSTALL_INFOBAR_LABEL), | 309 IDS_EXTENSION_INCOGNITO_INSTALL_INFOBAR_LABEL), |
310 ResourceBundle::GetSharedInstance().GetBitmapNamed( | 310 ResourceBundle::GetSharedInstance().GetBitmapNamed( |
311 IDR_INFOBAR_PLUGIN_INSTALL), | 311 IDR_INFOBAR_PLUGIN_INSTALL), |
312 true)); | 312 true)); |
313 } | 313 } |
314 } | 314 } |
315 } | 315 } |
316 | 316 |
317 // Download progress painting -------------------------------------------------- | 317 // Download progress painting -------------------------------------------------- |
318 | 318 |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 } | 754 } |
755 | 755 |
756 FilePath GetCrDownloadPath(const FilePath& suggested_path) { | 756 FilePath GetCrDownloadPath(const FilePath& suggested_path) { |
757 FilePath::StringType file_name; | 757 FilePath::StringType file_name; |
758 SStringPrintf(&file_name, PRFilePathLiteral FILE_PATH_LITERAL(".crdownload"), | 758 SStringPrintf(&file_name, PRFilePathLiteral FILE_PATH_LITERAL(".crdownload"), |
759 suggested_path.value().c_str()); | 759 suggested_path.value().c_str()); |
760 return FilePath(file_name); | 760 return FilePath(file_name); |
761 } | 761 } |
762 | 762 |
763 } // namespace download_util | 763 } // namespace download_util |
OLD | NEW |