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