OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" | 106 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" |
107 #include "chrome/browser/chromeos/login/user_manager.h" | 107 #include "chrome/browser/chromeos/login/user_manager.h" |
108 #elif defined(OS_LINUX) | 108 #elif defined(OS_LINUX) |
109 #include "chrome/browser/chrome_browser_main_linux.h" | 109 #include "chrome/browser/chrome_browser_main_linux.h" |
110 #elif defined(OS_POSIX) | 110 #elif defined(OS_POSIX) |
111 #include "chrome/browser/chrome_browser_main_posix.h" | 111 #include "chrome/browser/chrome_browser_main_posix.h" |
112 #endif | 112 #endif |
113 | 113 |
114 #if defined(USE_AURA) | 114 #if defined(USE_AURA) |
115 #include "chrome/browser/tab_contents/chrome_web_contents_view_delegate_aura.h" | 115 #include "chrome/browser/tab_contents/chrome_web_contents_view_delegate_aura.h" |
| 116 #include "chrome/browser/tab_contents/chrome_web_contents_view_delegate_views.h" |
116 #elif defined(OS_WIN) | 117 #elif defined(OS_WIN) |
117 #include "chrome/browser/tab_contents/chrome_web_contents_view_delegate_win.h" | 118 #include "chrome/browser/tab_contents/chrome_web_contents_view_delegate_views.h" |
118 #endif | 119 #endif |
119 | 120 |
120 #if defined(TOOLKIT_USES_GTK) | 121 #if defined(TOOLKIT_USES_GTK) |
121 #include "chrome/browser/chrome_browser_main_extra_parts_gtk.h" | 122 #include "chrome/browser/chrome_browser_main_extra_parts_gtk.h" |
122 #endif | 123 #endif |
123 | 124 |
124 #if defined(TOOLKIT_VIEWS) | 125 #if defined(TOOLKIT_VIEWS) |
125 #include "chrome/browser/chrome_browser_main_extra_parts_views.h" | 126 #include "chrome/browser/chrome_browser_main_extra_parts_views.h" |
126 #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" | 127 #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" |
127 #endif | 128 #endif |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 #if defined(USE_AURA) | 358 #if defined(USE_AURA) |
358 main_parts->AddParts(new ChromeBrowserMainExtraPartsAura()); | 359 main_parts->AddParts(new ChromeBrowserMainExtraPartsAura()); |
359 #endif | 360 #endif |
360 | 361 |
361 return main_parts; | 362 return main_parts; |
362 } | 363 } |
363 | 364 |
364 content::WebContentsView* | 365 content::WebContentsView* |
365 ChromeContentBrowserClient::OverrideCreateWebContentsView( | 366 ChromeContentBrowserClient::OverrideCreateWebContentsView( |
366 WebContents* web_contents) { | 367 WebContents* web_contents) { |
367 #if defined(TOOLKIT_VIEWS) && (!defined(OS_WIN) || defined(USE_AURA)) | 368 #if defined(USE_AURA) |
368 return new TabContentsViewViews(web_contents, | 369 // TODO(beng): remove this once TCVV is gone. |
369 GetWebContentsViewDelegate(web_contents)); | 370 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 371 if (!command_line.HasSwitch(switches::kEnableTCVA)) { |
| 372 return new TabContentsViewViews(web_contents, |
| 373 GetWebContentsViewDelegate(web_contents)); |
| 374 } |
370 #endif | 375 #endif |
371 return NULL; | 376 return NULL; |
372 } | 377 } |
373 | 378 |
374 content::WebContentsViewDelegate* | 379 content::WebContentsViewDelegate* |
375 ChromeContentBrowserClient::GetWebContentsViewDelegate( | 380 ChromeContentBrowserClient::GetWebContentsViewDelegate( |
376 content::WebContents* web_contents) { | 381 content::WebContents* web_contents) { |
377 #if defined(OS_WIN) && !defined(USE_AURA) | 382 #if defined(OS_WIN) || defined(USE_AURA) |
378 return new ChromeWebContentsViewDelegateWin(web_contents); | 383 // TODO(beng): replace all of this once TCVV is removed. |
| 384 #if defined(OS_WIN) |
| 385 return new ChromeWebContentsViewDelegateViews(web_contents); |
| 386 #elif defined(USE_AURA) |
| 387 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 388 if (command_line.HasSwitch(switches::kEnableTCVA)) |
| 389 return new ChromeWebContentsViewDelegateViews(web_contents); |
| 390 return new ChromeWebContentsViewDelegateAura(web_contents); |
| 391 #endif |
379 #elif defined(TOOLKIT_GTK) | 392 #elif defined(TOOLKIT_GTK) |
380 return new ChromeWebContentsViewDelegateGtk(web_contents); | 393 return new ChromeWebContentsViewDelegateGtk(web_contents); |
381 #elif defined(OS_MACOSX) | 394 #elif defined(OS_MACOSX) |
382 return | 395 return |
383 chrome_web_contents_view_delegate_mac::CreateWebContentsViewDelegateMac( | 396 chrome_web_contents_view_delegate_mac::CreateWebContentsViewDelegateMac( |
384 web_contents); | 397 web_contents); |
385 #elif defined(USE_AURA) | |
386 return new ChromeWebContentsViewDelegateAura(web_contents); | |
387 #else | 398 #else |
388 return NULL; | 399 return NULL; |
389 #endif | 400 #endif |
390 } | 401 } |
391 | 402 |
392 void ChromeContentBrowserClient::RenderViewHostCreated( | 403 void ChromeContentBrowserClient::RenderViewHostCreated( |
393 RenderViewHost* render_view_host) { | 404 RenderViewHost* render_view_host) { |
394 | 405 |
395 SiteInstance* site_instance = render_view_host->GetSiteInstance(); | 406 SiteInstance* site_instance = render_view_host->GetSiteInstance(); |
396 Profile* profile = Profile::FromBrowserContext( | 407 Profile* profile = Profile::FromBrowserContext( |
(...skipping 1239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1636 #if defined(USE_NSS) | 1647 #if defined(USE_NSS) |
1637 crypto::CryptoModuleBlockingPasswordDelegate* | 1648 crypto::CryptoModuleBlockingPasswordDelegate* |
1638 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 1649 ChromeContentBrowserClient::GetCryptoPasswordDelegate( |
1639 const GURL& url) { | 1650 const GURL& url) { |
1640 return browser::NewCryptoModuleBlockingDialogDelegate( | 1651 return browser::NewCryptoModuleBlockingDialogDelegate( |
1641 browser::kCryptoModulePasswordKeygen, url.host()); | 1652 browser::kCryptoModulePasswordKeygen, url.host()); |
1642 } | 1653 } |
1643 #endif | 1654 #endif |
1644 | 1655 |
1645 } // namespace chrome | 1656 } // namespace chrome |
OLD | NEW |