OLD | NEW |
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/extensions/api/downloads/downloads_api.h" | 5 #include "chrome/browser/extensions/api/downloads/downloads_api.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1512 return false; | 1512 return false; |
1513 // In-progress downloads return the intermediate filename for GetFullPath() | 1513 // In-progress downloads return the intermediate filename for GetFullPath() |
1514 // which doesn't have the final extension. Therefore a good file icon can't be | 1514 // which doesn't have the final extension. Therefore a good file icon can't be |
1515 // found, so use GetTargetFilePath() instead. | 1515 // found, so use GetTargetFilePath() instead. |
1516 DCHECK(icon_extractor_.get()); | 1516 DCHECK(icon_extractor_.get()); |
1517 DCHECK(icon_size == 16 || icon_size == 32); | 1517 DCHECK(icon_size == 16 || icon_size == 32); |
1518 float scale = 1.0; | 1518 float scale = 1.0; |
1519 content::WebContents* web_contents = | 1519 content::WebContents* web_contents = |
1520 dispatcher()->delegate()->GetVisibleWebContents(); | 1520 dispatcher()->delegate()->GetVisibleWebContents(); |
1521 if (web_contents) { | 1521 if (web_contents) { |
1522 scale = ui::GetImageScale(ui::GetScaleFactorForNativeView( | 1522 scale = ui::GetScaleFactorForNativeView( |
1523 web_contents->GetRenderWidgetHostView()->GetNativeView())); | 1523 web_contents->GetRenderWidgetHostView()->GetNativeView()); |
1524 } | 1524 } |
1525 EXTENSION_FUNCTION_VALIDATE(icon_extractor_->ExtractIconURLForPath( | 1525 EXTENSION_FUNCTION_VALIDATE(icon_extractor_->ExtractIconURLForPath( |
1526 download_item->GetTargetFilePath(), | 1526 download_item->GetTargetFilePath(), |
1527 scale, | 1527 scale, |
1528 IconLoaderSizeFromPixelSize(icon_size), | 1528 IconLoaderSizeFromPixelSize(icon_size), |
1529 base::Bind(&DownloadsGetFileIconFunction::OnIconURLExtracted, this))); | 1529 base::Bind(&DownloadsGetFileIconFunction::OnIconURLExtracted, this))); |
1530 return true; | 1530 return true; |
1531 } | 1531 } |
1532 | 1532 |
1533 void DownloadsGetFileIconFunction::OnIconURLExtracted(const std::string& url) { | 1533 void DownloadsGetFileIconFunction::OnIconURLExtracted(const std::string& url) { |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1930 const extensions::Extension* extension, | 1930 const extensions::Extension* extension, |
1931 extensions::UnloadedExtensionInfo::Reason reason) { | 1931 extensions::UnloadedExtensionInfo::Reason reason) { |
1932 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1932 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
1933 std::set<const extensions::Extension*>::iterator iter = | 1933 std::set<const extensions::Extension*>::iterator iter = |
1934 shelf_disabling_extensions_.find(extension); | 1934 shelf_disabling_extensions_.find(extension); |
1935 if (iter != shelf_disabling_extensions_.end()) | 1935 if (iter != shelf_disabling_extensions_.end()) |
1936 shelf_disabling_extensions_.erase(iter); | 1936 shelf_disabling_extensions_.erase(iter); |
1937 } | 1937 } |
1938 | 1938 |
1939 } // namespace extensions | 1939 } // namespace extensions |
OLD | NEW |