| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEB_VIEW_HANDLE_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEB_VIEW_HANDLE_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "base/memory/ref_counted.h" | |
| 12 | |
| 13 class Profile; | |
| 14 | |
| 15 namespace views { | |
| 16 class WebView; | |
| 17 } | |
| 18 | |
| 19 namespace chromeos { | |
| 20 | |
| 21 // Owns a views::WebView instance. Any caller actively using the views::WebView | |
| 22 // instance should increase/decrease the refcount. | |
| 23 class WebViewHandle : public base::RefCounted<WebViewHandle> { | |
| 24 public: | |
| 25 explicit WebViewHandle(Profile* profile); | |
| 26 | |
| 27 // Returns an unowned pointer to the stored |web_view| instance. | |
| 28 views::WebView* web_view() { return web_view_.get(); } | |
| 29 | |
| 30 private: | |
| 31 friend class base::RefCounted<WebViewHandle>; | |
| 32 ~WebViewHandle(); | |
| 33 | |
| 34 std::unique_ptr<views::WebView> web_view_; | |
| 35 | |
| 36 DISALLOW_COPY_AND_ASSIGN(WebViewHandle); | |
| 37 }; | |
| 38 | |
| 39 } // namespace chromeos | |
| 40 | |
| 41 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEB_VIEW_HANDLE_H_ | |
| OLD | NEW |