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 <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 | 304 |
305 void ChromeAppDelegate::SetWebContentsBlocked( | 305 void ChromeAppDelegate::SetWebContentsBlocked( |
306 content::WebContents* web_contents, | 306 content::WebContents* web_contents, |
307 bool blocked) { | 307 bool blocked) { |
308 if (!blocked) | 308 if (!blocked) |
309 web_contents->Focus(); | 309 web_contents->Focus(); |
310 // RenderViewHost may be NULL during shutdown. | 310 // RenderViewHost may be NULL during shutdown. |
311 content::RenderFrameHost* host = web_contents->GetMainFrame(); | 311 content::RenderFrameHost* host = web_contents->GetMainFrame(); |
312 if (host) { | 312 if (host) { |
313 extensions::mojom::AppWindowPtr app_window; | 313 extensions::mojom::AppWindowPtr app_window; |
314 host->GetProcess()->GetRemoteInterfaces()->GetInterface(&app_window); | 314 BindInterface(host->GetProcess(), &app_window); |
315 app_window->SetVisuallyDeemphasized(blocked); | 315 app_window->SetVisuallyDeemphasized(blocked); |
316 } | 316 } |
317 } | 317 } |
318 | 318 |
319 bool ChromeAppDelegate::IsWebContentsVisible( | 319 bool ChromeAppDelegate::IsWebContentsVisible( |
320 content::WebContents* web_contents) { | 320 content::WebContents* web_contents) { |
321 return platform_util::IsVisible(web_contents->GetNativeView()); | 321 return platform_util::IsVisible(web_contents->GetNativeView()); |
322 } | 322 } |
323 | 323 |
324 void ChromeAppDelegate::SetTerminatingCallback(const base::Closure& callback) { | 324 void ChromeAppDelegate::SetTerminatingCallback(const base::Closure& callback) { |
(...skipping 23 matching lines...) Expand all Loading... |
348 KeepAliveRestartOption::DISABLED)); | 348 KeepAliveRestartOption::DISABLED)); |
349 } | 349 } |
350 | 350 |
351 void ChromeAppDelegate::Observe(int type, | 351 void ChromeAppDelegate::Observe(int type, |
352 const content::NotificationSource& source, | 352 const content::NotificationSource& source, |
353 const content::NotificationDetails& details) { | 353 const content::NotificationDetails& details) { |
354 DCHECK_EQ(chrome::NOTIFICATION_APP_TERMINATING, type); | 354 DCHECK_EQ(chrome::NOTIFICATION_APP_TERMINATING, type); |
355 if (!terminating_callback_.is_null()) | 355 if (!terminating_callback_.is_null()) |
356 terminating_callback_.Run(); | 356 terminating_callback_.Run(); |
357 } | 357 } |
OLD | NEW |