OLD | NEW |
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/apps/chrome_app_delegate.h" | 5 #include "chrome/browser/ui/apps/chrome_app_delegate.h" |
6 | 6 |
| 7 #include <memory> |
7 #include <utility> | 8 #include <utility> |
8 | 9 |
9 #include "base/macros.h" | 10 #include "base/macros.h" |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
12 #include "chrome/browser/app_mode/app_mode_utils.h" | 12 #include "chrome/browser/app_mode/app_mode_utils.h" |
13 #include "chrome/browser/chrome_notification_types.h" | 13 #include "chrome/browser/chrome_notification_types.h" |
14 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" | 14 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" |
15 #include "chrome/browser/favicon/favicon_utils.h" | 15 #include "chrome/browser/favicon/favicon_utils.h" |
16 #include "chrome/browser/file_select_helper.h" | 16 #include "chrome/browser/file_select_helper.h" |
17 #include "chrome/browser/lifetime/keep_alive_types.h" | 17 #include "chrome/browser/lifetime/keep_alive_types.h" |
18 #include "chrome/browser/lifetime/scoped_keep_alive.h" | 18 #include "chrome/browser/lifetime/scoped_keep_alive.h" |
19 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 19 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
20 #include "chrome/browser/platform_util.h" | 20 #include "chrome/browser/platform_util.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 106 |
107 } // namespace | 107 } // namespace |
108 | 108 |
109 // static | 109 // static |
110 void ChromeAppDelegate::RelinquishKeepAliveAfterTimeout( | 110 void ChromeAppDelegate::RelinquishKeepAliveAfterTimeout( |
111 const base::WeakPtr<ChromeAppDelegate>& chrome_app_delegate) { | 111 const base::WeakPtr<ChromeAppDelegate>& chrome_app_delegate) { |
112 // Resetting the ScopedKeepAlive may cause nested destruction of the | 112 // Resetting the ScopedKeepAlive may cause nested destruction of the |
113 // ChromeAppDelegate which also resets the ScopedKeepAlive. To avoid this, | 113 // ChromeAppDelegate which also resets the ScopedKeepAlive. To avoid this, |
114 // move the ScopedKeepAlive out to here and let it fall out of scope. | 114 // move the ScopedKeepAlive out to here and let it fall out of scope. |
115 if (chrome_app_delegate.get() && chrome_app_delegate->is_hidden_) | 115 if (chrome_app_delegate.get() && chrome_app_delegate->is_hidden_) |
116 scoped_ptr<ScopedKeepAlive>(std::move(chrome_app_delegate->keep_alive_)); | 116 std::unique_ptr<ScopedKeepAlive>( |
| 117 std::move(chrome_app_delegate->keep_alive_)); |
117 } | 118 } |
118 | 119 |
119 class ChromeAppDelegate::NewWindowContentsDelegate | 120 class ChromeAppDelegate::NewWindowContentsDelegate |
120 : public content::WebContentsDelegate { | 121 : public content::WebContentsDelegate { |
121 public: | 122 public: |
122 NewWindowContentsDelegate() {} | 123 NewWindowContentsDelegate() {} |
123 ~NewWindowContentsDelegate() override {} | 124 ~NewWindowContentsDelegate() override {} |
124 | 125 |
125 content::WebContents* OpenURLFromTab( | 126 content::WebContents* OpenURLFromTab( |
126 content::WebContents* source, | 127 content::WebContents* source, |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 const content::NotificationDetails& details) { | 338 const content::NotificationDetails& details) { |
338 switch (type) { | 339 switch (type) { |
339 case chrome::NOTIFICATION_APP_TERMINATING: | 340 case chrome::NOTIFICATION_APP_TERMINATING: |
340 if (!terminating_callback_.is_null()) | 341 if (!terminating_callback_.is_null()) |
341 terminating_callback_.Run(); | 342 terminating_callback_.Run(); |
342 break; | 343 break; |
343 default: | 344 default: |
344 NOTREACHED() << "Received unexpected notification"; | 345 NOTREACHED() << "Received unexpected notification"; |
345 } | 346 } |
346 } | 347 } |
OLD | NEW |