| 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 "extensions/shell/browser/shell_app_delegate.h" | 5 #include "extensions/shell/browser/shell_app_delegate.h" |
| 6 | 6 |
| 7 #include "content/public/browser/web_contents.h" | 7 #include "content/public/browser/web_contents.h" |
| 8 #include "extensions/common/constants.h" | 8 #include "extensions/common/constants.h" |
| 9 #include "extensions/shell/browser/media_capture_util.h" | 9 #include "extensions/shell/browser/media_capture_util.h" |
| 10 #include "extensions/shell/browser/shell_extension_web_contents_observer.h" |
| 10 | 11 |
| 11 namespace extensions { | 12 namespace extensions { |
| 12 | 13 |
| 13 ShellAppDelegate::ShellAppDelegate() { | 14 ShellAppDelegate::ShellAppDelegate() { |
| 14 } | 15 } |
| 15 | 16 |
| 16 ShellAppDelegate::~ShellAppDelegate() { | 17 ShellAppDelegate::~ShellAppDelegate() { |
| 17 } | 18 } |
| 18 | 19 |
| 19 void ShellAppDelegate::InitWebContents(content::WebContents* web_contents) { | 20 void ShellAppDelegate::InitWebContents(content::WebContents* web_contents) { |
| 21 ShellExtensionWebContentsObserver::CreateForWebContents(web_contents); |
| 20 } | 22 } |
| 21 | 23 |
| 22 void ShellAppDelegate::RenderViewCreated( | 24 void ShellAppDelegate::RenderViewCreated( |
| 23 content::RenderViewHost* render_view_host) { | 25 content::RenderViewHost* render_view_host) { |
| 24 // The views implementation of AppWindow takes focus via SetInitialFocus() | 26 // The views implementation of AppWindow takes focus via SetInitialFocus() |
| 25 // and views::WebView but app_shell is aura-only and must do it manually. | 27 // and views::WebView but app_shell is aura-only and must do it manually. |
| 26 content::WebContents::FromRenderViewHost(render_view_host)->Focus(); | 28 content::WebContents::FromRenderViewHost(render_view_host)->Focus(); |
| 27 } | 29 } |
| 28 | 30 |
| 29 void ShellAppDelegate::ResizeWebContents(content::WebContents* web_contents, | 31 void ShellAppDelegate::ResizeWebContents(content::WebContents* web_contents, |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 content::WebContents* web_contents) { | 95 content::WebContents* web_contents) { |
| 94 return true; | 96 return true; |
| 95 } | 97 } |
| 96 | 98 |
| 97 void ShellAppDelegate::SetTerminatingCallback(const base::Closure& callback) { | 99 void ShellAppDelegate::SetTerminatingCallback(const base::Closure& callback) { |
| 98 // TODO(jamescook): Should app_shell continue to close the app window | 100 // TODO(jamescook): Should app_shell continue to close the app window |
| 99 // manually or should it use a browser termination callback like Chrome? | 101 // manually or should it use a browser termination callback like Chrome? |
| 100 } | 102 } |
| 101 | 103 |
| 102 } // namespace extensions | 104 } // namespace extensions |
| OLD | NEW |