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

Side by Side Diff: ui/views/controls/webview/webview.cc

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr 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
« no previous file with comments | « ui/views/controls/webview/webview.h ('k') | ui/views/controls/webview/webview_unittest.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 "ui/views/controls/webview/webview.h" 5 #include "ui/views/controls/webview/webview.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "content/public/browser/browser_accessibility_state.h" 10 #include "content/public/browser/browser_accessibility_state.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 PreferredSizeChanged(); 105 PreferredSizeChanged();
106 } 106 }
107 107
108 //////////////////////////////////////////////////////////////////////////////// 108 ////////////////////////////////////////////////////////////////////////////////
109 // WebView, View overrides: 109 // WebView, View overrides:
110 110
111 const char* WebView::GetClassName() const { 111 const char* WebView::GetClassName() const {
112 return kViewClassName; 112 return kViewClassName;
113 } 113 }
114 114
115 scoped_ptr<content::WebContents> WebView::SwapWebContents( 115 std::unique_ptr<content::WebContents> WebView::SwapWebContents(
116 scoped_ptr<content::WebContents> new_web_contents) { 116 std::unique_ptr<content::WebContents> new_web_contents) {
117 if (wc_owner_) 117 if (wc_owner_)
118 wc_owner_->SetDelegate(NULL); 118 wc_owner_->SetDelegate(NULL);
119 scoped_ptr<content::WebContents> old_web_contents(std::move(wc_owner_)); 119 std::unique_ptr<content::WebContents> old_web_contents(std::move(wc_owner_));
120 wc_owner_ = std::move(new_web_contents); 120 wc_owner_ = std::move(new_web_contents);
121 if (wc_owner_) 121 if (wc_owner_)
122 wc_owner_->SetDelegate(this); 122 wc_owner_->SetDelegate(this);
123 SetWebContents(wc_owner_.get()); 123 SetWebContents(wc_owner_.get());
124 return old_web_contents; 124 return old_web_contents;
125 } 125 }
126 126
127 void WebView::OnBoundsChanged(const gfx::Rect& previous_bounds) { 127 void WebView::OnBoundsChanged(const gfx::Rect& previous_bounds) {
128 // In most cases, the holder is simply sized to fill this WebView's bounds. 128 // In most cases, the holder is simply sized to fill this WebView's bounds.
129 // Only WebContentses that are in fullscreen mode and being screen-captured 129 // Only WebContentses that are in fullscreen mode and being screen-captured
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 if (!contents) { 382 if (!contents) {
383 content::WebContents::CreateParams create_params( 383 content::WebContents::CreateParams create_params(
384 browser_context, NULL); 384 browser_context, NULL);
385 return content::WebContents::Create(create_params); 385 return content::WebContents::Create(create_params);
386 } 386 }
387 387
388 return contents; 388 return contents;
389 } 389 }
390 390
391 } // namespace views 391 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/webview/webview.h ('k') | ui/views/controls/webview/webview_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698