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 "extensions/common/constants.h" | 8 #include "extensions/common/constants.h" |
8 #include "extensions/shell/browser/media_capture_util.h" | 9 #include "extensions/shell/browser/media_capture_util.h" |
9 | 10 |
10 namespace extensions { | 11 namespace extensions { |
11 | 12 |
12 ShellAppDelegate::ShellAppDelegate() { | 13 ShellAppDelegate::ShellAppDelegate() { |
13 } | 14 } |
14 | 15 |
15 ShellAppDelegate::~ShellAppDelegate() { | 16 ShellAppDelegate::~ShellAppDelegate() { |
16 } | 17 } |
17 | 18 |
18 void ShellAppDelegate::InitWebContents(content::WebContents* web_contents) { | 19 void ShellAppDelegate::InitWebContents(content::WebContents* web_contents) { |
20 Observe(web_contents); | |
oshima
2014/12/04 23:38:07
just a q: don't you have to stop observing ?
James Cook
2014/12/05 02:01:50
No, you don't, this is a common pattern. There is
| |
19 } | 21 } |
20 | 22 |
21 void ShellAppDelegate::ResizeWebContents(content::WebContents* web_contents, | 23 void ShellAppDelegate::ResizeWebContents(content::WebContents* web_contents, |
22 const gfx::Size& size) { | 24 const gfx::Size& size) { |
23 NOTIMPLEMENTED(); | 25 NOTIMPLEMENTED(); |
24 } | 26 } |
25 | 27 |
26 content::WebContents* ShellAppDelegate::OpenURLFromTab( | 28 content::WebContents* ShellAppDelegate::OpenURLFromTab( |
27 content::BrowserContext* context, | 29 content::BrowserContext* context, |
28 content::WebContents* source, | 30 content::WebContents* source, |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
85 content::WebContents* web_contents) { | 87 content::WebContents* web_contents) { |
86 return true; | 88 return true; |
87 } | 89 } |
88 | 90 |
89 void ShellAppDelegate::SetTerminatingCallback(const base::Closure& callback) { | 91 void ShellAppDelegate::SetTerminatingCallback(const base::Closure& callback) { |
90 // TODO(jamescook): Should app_shell continue to close the app window | 92 // TODO(jamescook): Should app_shell continue to close the app window |
91 // manually or should it use a browser termination callback like Chrome? | 93 // manually or should it use a browser termination callback like Chrome? |
92 NOTIMPLEMENTED(); | 94 NOTIMPLEMENTED(); |
93 } | 95 } |
94 | 96 |
97 void ShellAppDelegate::RenderViewCreated( | |
98 content::RenderViewHost* render_view_host) { | |
99 // The views implementation of AppWindow takes focus via SetInitialFocus() | |
100 // and views::WebView but app_shell is aura-only and must do it manually. | |
101 web_contents()->Focus(); | |
102 } | |
103 | |
95 } // namespace extensions | 104 } // namespace extensions |
OLD | NEW |