Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(856)

Side by Side Diff: chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc

Issue 1922873005: ppapi: PPB_VpnProvider: Bind VpnService to the PPAPI Resource Host (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@vpn-api-resource-host
Patch Set: Remove redundant code. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | extensions/browser/api/vpn_provider/vpn_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/extensions/chrome_content_browser_client_extensions_par t.h" 5 #include "chrome/browser/extensions/chrome_content_browser_client_extensions_par t.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 #include "extensions/browser/view_type_utils.h" 45 #include "extensions/browser/view_type_utils.h"
46 #include "extensions/common/constants.h" 46 #include "extensions/common/constants.h"
47 #include "extensions/common/extensions_client.h" 47 #include "extensions/common/extensions_client.h"
48 #include "extensions/common/manifest_constants.h" 48 #include "extensions/common/manifest_constants.h"
49 #include "extensions/common/manifest_handlers/app_isolation_info.h" 49 #include "extensions/common/manifest_handlers/app_isolation_info.h"
50 #include "extensions/common/manifest_handlers/background_info.h" 50 #include "extensions/common/manifest_handlers/background_info.h"
51 #include "extensions/common/manifest_handlers/web_accessible_resources_info.h" 51 #include "extensions/common/manifest_handlers/web_accessible_resources_info.h"
52 #include "extensions/common/permissions/permissions_data.h" 52 #include "extensions/common/permissions/permissions_data.h"
53 #include "extensions/common/switches.h" 53 #include "extensions/common/switches.h"
54 54
55 #if defined(OS_CHROMEOS)
56 #include "extensions/browser/api/vpn_provider/vpn_service.h"
57 #include "extensions/browser/api/vpn_provider/vpn_service_factory.h"
58 #endif // defined(OS_CHROMEOS)
59
55 using content::BrowserContext; 60 using content::BrowserContext;
56 using content::BrowserThread; 61 using content::BrowserThread;
57 using content::BrowserURLHandler; 62 using content::BrowserURLHandler;
58 using content::RenderViewHost; 63 using content::RenderViewHost;
59 using content::SiteInstance; 64 using content::SiteInstance;
60 using content::WebContents; 65 using content::WebContents;
61 using content::WebPreferences; 66 using content::WebPreferences;
62 67
63 namespace extensions { 68 namespace extensions {
64 69
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 return true; 500 return true;
496 } 501 }
497 } 502 }
498 return false; 503 return false;
499 } 504 }
500 505
501 // static 506 // static
502 std::unique_ptr<content::VpnServiceProxy> 507 std::unique_ptr<content::VpnServiceProxy>
503 ChromeContentBrowserClientExtensionsPart::GetVpnServiceProxy( 508 ChromeContentBrowserClientExtensionsPart::GetVpnServiceProxy(
504 content::BrowserContext* browser_context) { 509 content::BrowserContext* browser_context) {
510 #if defined(OS_CHROMEOS)
511 chromeos::VpnService* vpn_service =
512 chromeos::VpnServiceFactory::GetForBrowserContext(browser_context);
513 if (!vpn_service)
514 return nullptr;
515 return vpn_service->GetVpnServiceProxy();
516 #else
505 return nullptr; 517 return nullptr;
518 #endif
506 } 519 }
507 520
508 void ChromeContentBrowserClientExtensionsPart::RenderProcessWillLaunch( 521 void ChromeContentBrowserClientExtensionsPart::RenderProcessWillLaunch(
509 content::RenderProcessHost* host) { 522 content::RenderProcessHost* host) {
510 int id = host->GetID(); 523 int id = host->GetID();
511 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); 524 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext());
512 525
513 host->AddFilter(new ChromeExtensionMessageFilter(id, profile)); 526 host->AddFilter(new ChromeExtensionMessageFilter(id, profile));
514 host->AddFilter(new ExtensionMessageFilter(id, profile)); 527 host->AddFilter(new ExtensionMessageFilter(id, profile));
515 host->AddFilter(new IOThreadExtensionMessageFilter(id, profile)); 528 host->AddFilter(new IOThreadExtensionMessageFilter(id, profile));
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 command_line->AppendSwitch(::switches::kEnableWebRtcHWH264Encoding); 656 command_line->AppendSwitch(::switches::kEnableWebRtcHWH264Encoding);
644 #endif 657 #endif
645 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 658 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
646 switches::kEnableMojoSerialService)) { 659 switches::kEnableMojoSerialService)) {
647 command_line->AppendSwitch(switches::kEnableMojoSerialService); 660 command_line->AppendSwitch(switches::kEnableMojoSerialService);
648 } 661 }
649 } 662 }
650 } 663 }
651 664
652 } // namespace extensions 665 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | extensions/browser/api/vpn_provider/vpn_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698