OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_UI_APPS_CHROME_SHELL_WINDOW_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_APPS_CHROME_SHELL_WINDOW_DELEGATE_H_ |
6 #define CHROME_BROWSER_UI_APPS_CHROME_SHELL_WINDOW_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_APPS_CHROME_SHELL_WINDOW_DELEGATE_H_ |
7 | 7 |
8 #include "apps/shell_window.h" | 8 #include "apps/shell_window.h" |
| 9 #include "base/memory/scoped_ptr.h" |
9 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
10 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.h" |
11 #include "content/public/browser/web_contents_delegate.h" | 12 #include "content/public/browser/web_contents_delegate.h" |
12 #include "ui/base/window_open_disposition.h" | 13 #include "ui/base/window_open_disposition.h" |
13 #include "ui/gfx/rect.h" | 14 #include "ui/gfx/rect.h" |
14 | 15 |
15 namespace chrome { | 16 namespace chrome { |
16 | 17 |
| 18 class ShellWindowLinkDelegate : public content::WebContentsDelegate { |
| 19 public: |
| 20 ShellWindowLinkDelegate(); |
| 21 virtual ~ShellWindowLinkDelegate(); |
| 22 |
| 23 private: |
| 24 virtual content::WebContents* OpenURLFromTab( |
| 25 content::WebContents* source, |
| 26 const content::OpenURLParams& params) OVERRIDE; |
| 27 |
| 28 DISALLOW_COPY_AND_ASSIGN(ShellWindowLinkDelegate); |
| 29 }; |
| 30 |
17 class ChromeShellWindowDelegate : public apps::ShellWindow::Delegate { | 31 class ChromeShellWindowDelegate : public apps::ShellWindow::Delegate { |
18 public: | 32 public: |
19 ChromeShellWindowDelegate(); | 33 ChromeShellWindowDelegate(); |
20 virtual ~ChromeShellWindowDelegate(); | 34 virtual ~ChromeShellWindowDelegate(); |
21 | 35 |
22 static void DisableExternalOpenForTesting(); | 36 static void DisableExternalOpenForTesting(); |
23 | 37 |
24 private: | 38 private: |
25 // apps::ShellWindow::Delegate: | 39 // apps::ShellWindow::Delegate: |
26 virtual void InitWebContents(content::WebContents* web_contents) OVERRIDE; | 40 virtual void InitWebContents(content::WebContents* web_contents) OVERRIDE; |
(...skipping 17 matching lines...) Expand all Loading... |
44 content::WebContents* web_contents, | 58 content::WebContents* web_contents, |
45 const content::MediaStreamRequest& request, | 59 const content::MediaStreamRequest& request, |
46 const content::MediaResponseCallback& callback, | 60 const content::MediaResponseCallback& callback, |
47 const extensions::Extension* extension) OVERRIDE; | 61 const extensions::Extension* extension) OVERRIDE; |
48 virtual int PreferredIconSize() OVERRIDE; | 62 virtual int PreferredIconSize() OVERRIDE; |
49 virtual void SetWebContentsBlocked(content::WebContents* web_contents, | 63 virtual void SetWebContentsBlocked(content::WebContents* web_contents, |
50 bool blocked) OVERRIDE; | 64 bool blocked) OVERRIDE; |
51 virtual bool IsWebContentsVisible( | 65 virtual bool IsWebContentsVisible( |
52 content::WebContents* web_contents) OVERRIDE; | 66 content::WebContents* web_contents) OVERRIDE; |
53 | 67 |
| 68 scoped_ptr<ShellWindowLinkDelegate> shell_window_link_delegate_; |
| 69 |
54 DISALLOW_COPY_AND_ASSIGN(ChromeShellWindowDelegate); | 70 DISALLOW_COPY_AND_ASSIGN(ChromeShellWindowDelegate); |
55 }; | 71 }; |
56 | 72 |
57 } // namespace chrome | 73 } // namespace chrome |
58 | 74 |
59 #endif // CHROME_BROWSER_UI_APPS_CHROME_SHELL_WINDOW_DELEGATE_H_ | 75 #endif // CHROME_BROWSER_UI_APPS_CHROME_SHELL_WINDOW_DELEGATE_H_ |
OLD | NEW |