| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CONTENT_SHELL_SHELL_CONTENT_BROWSER_CLIENT_H_ | 5 #ifndef CONTENT_SHELL_SHELL_CONTENT_BROWSER_CLIENT_H_ |
| 6 #define CONTENT_SHELL_SHELL_CONTENT_BROWSER_CLIENT_H_ | 6 #define CONTENT_SHELL_SHELL_CONTENT_BROWSER_CLIENT_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "content/public/browser/content_browser_client.h" | 13 #include "content/public/browser/content_browser_client.h" |
| 14 | 14 |
| 15 #if defined(OS_WIN) | 15 #if defined(OS_WIN) |
| 16 #include "content/browser/tab_contents/tab_contents_view_win_delegate.h" | 16 #include "content/browser/tab_contents/tab_contents_view_win_delegate.h" |
| 17 #endif | 17 #endif |
| 18 | 18 |
| 19 class ShellMainDelegate; |
| 20 |
| 19 namespace content { | 21 namespace content { |
| 20 | 22 |
| 21 class ShellBrowserMainParts; | 23 class ShellBrowserMainParts; |
| 22 | 24 |
| 23 class ShellContentBrowserClient : public ContentBrowserClient | 25 class ShellContentBrowserClient : public ContentBrowserClient |
| 24 #if defined(OS_WIN) | 26 #if defined(OS_WIN) |
| 25 , public TabContentsViewWinDelegate | 27 , public TabContentsViewWinDelegate |
| 26 #endif | 28 #endif |
| 27 { | 29 { |
| 28 public: | 30 public: |
| 29 ShellContentBrowserClient(); | 31 ShellContentBrowserClient(ShellMainDelegate* delegate); |
| 30 virtual ~ShellContentBrowserClient(); | 32 virtual ~ShellContentBrowserClient(); |
| 31 | 33 |
| 32 void set_shell_browser_main_parts(ShellBrowserMainParts* parts) { | 34 void set_shell_browser_main_parts(ShellBrowserMainParts* parts) { |
| 33 shell_browser_main_parts_ = parts; | 35 shell_browser_main_parts_ = parts; |
| 34 } | 36 } |
| 35 | 37 |
| 36 virtual BrowserMainParts* CreateBrowserMainParts( | 38 virtual BrowserMainParts* CreateBrowserMainParts( |
| 37 const content::MainFunctionParams& parameters) OVERRIDE; | 39 const content::MainFunctionParams& parameters) OVERRIDE; |
| 38 virtual TabContentsView* CreateTabContentsView( | 40 virtual TabContentsView* CreateTabContentsView( |
| 39 TabContents* tab_contents) OVERRIDE; | 41 TabContents* tab_contents) OVERRIDE; |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 | 174 |
| 173 #if defined(OS_WIN) | 175 #if defined(OS_WIN) |
| 174 // TabContentsViewWinDelegate implementation. | 176 // TabContentsViewWinDelegate implementation. |
| 175 virtual TabContents* CreateNewWindow( | 177 virtual TabContents* CreateNewWindow( |
| 176 TabContentsViewWin* tab_contents_view, | 178 TabContentsViewWin* tab_contents_view, |
| 177 int route_id, | 179 int route_id, |
| 178 const ViewHostMsg_CreateWindow_Params& params) OVERRIDE; | 180 const ViewHostMsg_CreateWindow_Params& params) OVERRIDE; |
| 179 #endif | 181 #endif |
| 180 | 182 |
| 181 private: | 183 private: |
| 184 // The delegate will always outlive this class. |
| 185 ShellMainDelegate* delegate_; |
| 186 |
| 182 ShellBrowserMainParts* shell_browser_main_parts_; | 187 ShellBrowserMainParts* shell_browser_main_parts_; |
| 183 }; | 188 }; |
| 184 | 189 |
| 185 } // namespace content | 190 } // namespace content |
| 186 | 191 |
| 187 #endif // CONTENT_SHELL_SHELL_CONTENT_BROWSER_CLIENT_H_ | 192 #endif // CONTENT_SHELL_SHELL_CONTENT_BROWSER_CLIENT_H_ |
| OLD | NEW |