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