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

Side by Side Diff: extensions/browser/app_window/app_window.cc

Issue 1909773002: Convert //extensions/browser from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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 "extensions/browser/app_window/app_window.h" 5 #include "extensions/browser/app_window/app_window.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 bounds_properties->SetInteger(name, value); 81 bounds_properties->SetInteger(name, value);
82 else 82 else
83 bounds_properties->Set(name, base::Value::CreateNullValue()); 83 bounds_properties->Set(name, base::Value::CreateNullValue());
84 } 84 }
85 85
86 void SetBoundsProperties(const gfx::Rect& bounds, 86 void SetBoundsProperties(const gfx::Rect& bounds,
87 const gfx::Size& min_size, 87 const gfx::Size& min_size,
88 const gfx::Size& max_size, 88 const gfx::Size& max_size,
89 const std::string& bounds_name, 89 const std::string& bounds_name,
90 base::DictionaryValue* window_properties) { 90 base::DictionaryValue* window_properties) {
91 scoped_ptr<base::DictionaryValue> bounds_properties( 91 std::unique_ptr<base::DictionaryValue> bounds_properties(
92 new base::DictionaryValue()); 92 new base::DictionaryValue());
93 93
94 bounds_properties->SetInteger("left", bounds.x()); 94 bounds_properties->SetInteger("left", bounds.x());
95 bounds_properties->SetInteger("top", bounds.y()); 95 bounds_properties->SetInteger("top", bounds.y());
96 bounds_properties->SetInteger("width", bounds.width()); 96 bounds_properties->SetInteger("width", bounds.width());
97 bounds_properties->SetInteger("height", bounds.height()); 97 bounds_properties->SetInteger("height", bounds.height());
98 98
99 SetConstraintProperty("minWidth", min_size.width(), bounds_properties.get()); 99 SetConstraintProperty("minWidth", min_size.width(), bounds_properties.get());
100 SetConstraintProperty( 100 SetConstraintProperty(
101 "minHeight", min_size.height(), bounds_properties.get()); 101 "minHeight", min_size.height(), bounds_properties.get());
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 app_icon_url_ = url; 576 app_icon_url_ = url;
577 web_contents()->DownloadImage( 577 web_contents()->DownloadImage(
578 url, 578 url,
579 true, // is a favicon 579 true, // is a favicon
580 0, // no maximum size 580 0, // no maximum size
581 false, // normal cache policy 581 false, // normal cache policy
582 base::Bind(&AppWindow::DidDownloadFavicon, 582 base::Bind(&AppWindow::DidDownloadFavicon,
583 image_loader_ptr_factory_.GetWeakPtr())); 583 image_loader_ptr_factory_.GetWeakPtr()));
584 } 584 }
585 585
586 void AppWindow::UpdateShape(scoped_ptr<SkRegion> region) { 586 void AppWindow::UpdateShape(std::unique_ptr<SkRegion> region) {
587 native_app_window_->UpdateShape(std::move(region)); 587 native_app_window_->UpdateShape(std::move(region));
588 } 588 }
589 589
590 void AppWindow::UpdateDraggableRegions( 590 void AppWindow::UpdateDraggableRegions(
591 const std::vector<DraggableRegion>& regions) { 591 const std::vector<DraggableRegion>& regions) {
592 native_app_window_->UpdateDraggableRegions(regions); 592 native_app_window_->UpdateDraggableRegions(regions);
593 } 593 }
594 594
595 void AppWindow::UpdateAppIcon(const gfx::Image& image) { 595 void AppWindow::UpdateAppIcon(const gfx::Image& image) {
596 if (image.IsEmpty()) 596 if (image.IsEmpty())
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
1117 region.bounds.x(), 1117 region.bounds.x(),
1118 region.bounds.y(), 1118 region.bounds.y(),
1119 region.bounds.right(), 1119 region.bounds.right(),
1120 region.bounds.bottom(), 1120 region.bounds.bottom(),
1121 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); 1121 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op);
1122 } 1122 }
1123 return sk_region; 1123 return sk_region;
1124 } 1124 }
1125 1125
1126 } // namespace extensions 1126 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/app_window/app_window.h ('k') | extensions/browser/app_window/app_window_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698