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

Side by Side Diff: chrome/browser/extensions/api/downloads/downloads_api.cc

Issue 293563002: GetScaleFactorForNativeView should return scale factor in float (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/thumbnails/thumbnail_tab_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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
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
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
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/thumbnails/thumbnail_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698