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

Side by Side Diff: chrome/browser/ui/views/elevation_icon_setter.cc

Issue 1550053002: Convert Pass()→std::move() in //chrome/browser/ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ui/views/elevation_icon_setter.h" 5 #include "chrome/browser/ui/views/elevation_icon_setter.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/task_runner_util.h" 8 #include "base/task_runner_util.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 // TODO(pkasting): Run on a background thread since this call spins a nested 43 // TODO(pkasting): Run on a background thread since this call spins a nested
44 // message loop. 44 // message loop.
45 if (FAILED((*func)(SIID_SHIELD, SHGSI_ICON | SHGSI_SMALLICON, &icon_info))) 45 if (FAILED((*func)(SIID_SHIELD, SHGSI_ICON | SHGSI_SMALLICON, &icon_info)))
46 return icon.Pass(); 46 return icon.Pass();
47 47
48 icon.reset(IconUtil::CreateSkBitmapFromHICON( 48 icon.reset(IconUtil::CreateSkBitmapFromHICON(
49 icon_info.hIcon, 49 icon_info.hIcon,
50 gfx::Size(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON)))); 50 gfx::Size(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON))));
51 DestroyIcon(icon_info.hIcon); 51 DestroyIcon(icon_info.hIcon);
52 #endif 52 #endif
53 return icon.Pass(); 53 return icon;
54 } 54 }
55 55
56 } // namespace 56 } // namespace
57 57
58 58
59 // ElevationIconSetter -------------------------------------------------------- 59 // ElevationIconSetter --------------------------------------------------------
60 60
61 ElevationIconSetter::ElevationIconSetter(views::LabelButton* button, 61 ElevationIconSetter::ElevationIconSetter(views::LabelButton* button,
62 const base::Closure& callback) 62 const base::Closure& callback)
63 : button_(button), 63 : button_(button),
(...skipping 22 matching lines...) Expand all
86 button_->SetImage( 86 button_->SetImage(
87 views::Button::STATE_NORMAL, 87 views::Button::STATE_NORMAL,
88 gfx::ImageSkia(gfx::ImageSkiaRep(*icon, device_scale_factor))); 88 gfx::ImageSkia(gfx::ImageSkiaRep(*icon, device_scale_factor)));
89 button_->SizeToPreferredSize(); 89 button_->SizeToPreferredSize();
90 if (button_->parent()) 90 if (button_->parent())
91 button_->parent()->Layout(); 91 button_->parent()->Layout();
92 if (!callback.is_null()) 92 if (!callback.is_null())
93 callback.Run(); 93 callback.Run();
94 } 94 }
95 } 95 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698