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 "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/profiles/profile.h" | |
11 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
12 #include "content/public/browser/web_contents_delegate.h" | 11 #include "content/public/browser/web_contents_delegate.h" |
13 #include "ui/base/window_open_disposition.h" | 12 #include "ui/base/window_open_disposition.h" |
14 #include "ui/gfx/rect.h" | 13 #include "ui/gfx/rect.h" |
15 | 14 |
| 15 namespace content { |
| 16 class BrowserContext; |
| 17 } |
| 18 |
16 class ShellWindowLinkDelegate : public content::WebContentsDelegate { | 19 class ShellWindowLinkDelegate : public content::WebContentsDelegate { |
17 public: | 20 public: |
18 ShellWindowLinkDelegate(); | 21 ShellWindowLinkDelegate(); |
19 virtual ~ShellWindowLinkDelegate(); | 22 virtual ~ShellWindowLinkDelegate(); |
20 | 23 |
21 private: | 24 private: |
22 virtual content::WebContents* OpenURLFromTab( | 25 virtual content::WebContents* OpenURLFromTab( |
23 content::WebContents* source, | 26 content::WebContents* source, |
24 const content::OpenURLParams& params) OVERRIDE; | 27 const content::OpenURLParams& params) OVERRIDE; |
25 | 28 |
26 DISALLOW_COPY_AND_ASSIGN(ShellWindowLinkDelegate); | 29 DISALLOW_COPY_AND_ASSIGN(ShellWindowLinkDelegate); |
27 }; | 30 }; |
28 | 31 |
29 class ChromeShellWindowDelegate : public apps::ShellWindow::Delegate { | 32 class ChromeShellWindowDelegate : public apps::ShellWindow::Delegate { |
30 public: | 33 public: |
31 ChromeShellWindowDelegate(); | 34 ChromeShellWindowDelegate(); |
32 virtual ~ChromeShellWindowDelegate(); | 35 virtual ~ChromeShellWindowDelegate(); |
33 | 36 |
34 static void DisableExternalOpenForTesting(); | 37 static void DisableExternalOpenForTesting(); |
35 | 38 |
36 private: | 39 private: |
37 // apps::ShellWindow::Delegate: | 40 // apps::ShellWindow::Delegate: |
38 virtual void InitWebContents(content::WebContents* web_contents) OVERRIDE; | 41 virtual void InitWebContents(content::WebContents* web_contents) OVERRIDE; |
39 virtual apps::NativeAppWindow* CreateNativeAppWindow( | 42 virtual apps::NativeAppWindow* CreateNativeAppWindow( |
40 apps::ShellWindow* window, | 43 apps::ShellWindow* window, |
41 const apps::ShellWindow::CreateParams& params) OVERRIDE; | 44 const apps::ShellWindow::CreateParams& params) OVERRIDE; |
42 virtual content::WebContents* OpenURLFromTab( | 45 virtual content::WebContents* OpenURLFromTab( |
43 Profile* profile, | 46 content::BrowserContext* context, |
44 content::WebContents* source, | 47 content::WebContents* source, |
45 const content::OpenURLParams& params) OVERRIDE; | 48 const content::OpenURLParams& params) OVERRIDE; |
46 virtual void AddNewContents(Profile* profile, | 49 virtual void AddNewContents(content::BrowserContext* context, |
47 content::WebContents* new_contents, | 50 content::WebContents* new_contents, |
48 WindowOpenDisposition disposition, | 51 WindowOpenDisposition disposition, |
49 const gfx::Rect& initial_pos, | 52 const gfx::Rect& initial_pos, |
50 bool user_gesture, | 53 bool user_gesture, |
51 bool* was_blocked) OVERRIDE; | 54 bool* was_blocked) OVERRIDE; |
52 virtual content::ColorChooser* ShowColorChooser( | 55 virtual content::ColorChooser* ShowColorChooser( |
53 content::WebContents* web_contents, | 56 content::WebContents* web_contents, |
54 SkColor initial_color) OVERRIDE; | 57 SkColor initial_color) OVERRIDE; |
55 virtual void RunFileChooser( | 58 virtual void RunFileChooser( |
56 content::WebContents* tab, | 59 content::WebContents* tab, |
(...skipping 13 matching lines...) Expand all Loading... |
70 static apps::NativeAppWindow* CreateNativeAppWindowImpl( | 73 static apps::NativeAppWindow* CreateNativeAppWindowImpl( |
71 apps::ShellWindow* window, | 74 apps::ShellWindow* window, |
72 const apps::ShellWindow::CreateParams& params); | 75 const apps::ShellWindow::CreateParams& params); |
73 | 76 |
74 scoped_ptr<ShellWindowLinkDelegate> shell_window_link_delegate_; | 77 scoped_ptr<ShellWindowLinkDelegate> shell_window_link_delegate_; |
75 | 78 |
76 DISALLOW_COPY_AND_ASSIGN(ChromeShellWindowDelegate); | 79 DISALLOW_COPY_AND_ASSIGN(ChromeShellWindowDelegate); |
77 }; | 80 }; |
78 | 81 |
79 #endif // CHROME_BROWSER_UI_APPS_CHROME_SHELL_WINDOW_DELEGATE_H_ | 82 #endif // CHROME_BROWSER_UI_APPS_CHROME_SHELL_WINDOW_DELEGATE_H_ |
OLD | NEW |