| 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 "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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |