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

Side by Side Diff: extensions/shell/browser/shell_browser_main_parts.h

Issue 717233003: Allow app_shell embedders to override extensions client interfaces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: (extensions-client) renderer Created 6 years, 1 month 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/shell/browser/shell_browser_main_parts.cc » ('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 #ifndef EXTENSIONS_SHELL_BROWSER_SHELL_BROWSER_MAIN_PARTS_H_ 5 #ifndef EXTENSIONS_SHELL_BROWSER_SHELL_BROWSER_MAIN_PARTS_H_
6 #define EXTENSIONS_SHELL_BROWSER_SHELL_BROWSER_MAIN_PARTS_H_ 6 #define EXTENSIONS_SHELL_BROWSER_SHELL_BROWSER_MAIN_PARTS_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/task/cancelable_task_tracker.h" 11 #include "base/task/cancelable_task_tracker.h"
12 #include "content/public/browser/browser_main_parts.h" 12 #include "content/public/browser/browser_main_parts.h"
13 #include "content/public/common/main_function_params.h" 13 #include "content/public/common/main_function_params.h"
14 #include "ui/aura/window_tree_host_observer.h" 14 #include "ui/aura/window_tree_host_observer.h"
15 15
16 namespace content { 16 namespace content {
17 class BrowserContext;
17 class DevToolsHttpHandler; 18 class DevToolsHttpHandler;
18 struct MainFunctionParams; 19 struct MainFunctionParams;
19 } 20 }
20 21
21 namespace views { 22 namespace views {
22 class Widget; 23 class Widget;
23 } 24 }
24 25
25 namespace net { 26 namespace net {
26 class NetLog; 27 class NetLog;
27 } 28 }
28 29
29 namespace extensions { 30 namespace extensions {
30 31
31 class AppWindowClient; 32 class AppWindowClient;
32 class DesktopController; 33 class DesktopController;
34 class ExtensionsBrowserClient;
35 class ExtensionsClient;
33 class ShellBrowserContext; 36 class ShellBrowserContext;
34 class ShellBrowserMainDelegate; 37 class ShellBrowserMainDelegate;
35 class ShellDeviceClient; 38 class ShellDeviceClient;
36 class ShellExtensionsBrowserClient;
37 class ShellExtensionsClient;
38 class ShellExtensionSystem; 39 class ShellExtensionSystem;
39 class ShellOAuth2TokenService; 40 class ShellOAuth2TokenService;
40 class ShellOmahaQueryParamsDelegate; 41 class ShellOmahaQueryParamsDelegate;
41 42
42 #if defined(OS_CHROMEOS) 43 #if defined(OS_CHROMEOS)
43 class ShellAudioController; 44 class ShellAudioController;
44 class ShellNetworkController; 45 class ShellNetworkController;
45 #endif 46 #endif
46 47
47 // Handles initialization of AppShell. 48 // Handles initialization of AppShell.
(...skipping 10 matching lines...) Expand all
58 // BrowserMainParts overrides. 59 // BrowserMainParts overrides.
59 void PreEarlyInitialization() override; 60 void PreEarlyInitialization() override;
60 void PreMainMessageLoopStart() override; 61 void PreMainMessageLoopStart() override;
61 void PostMainMessageLoopStart() override; 62 void PostMainMessageLoopStart() override;
62 int PreCreateThreads() override; 63 int PreCreateThreads() override;
63 void PreMainMessageLoopRun() override; 64 void PreMainMessageLoopRun() override;
64 bool MainMessageLoopRun(int* result_code) override; 65 bool MainMessageLoopRun(int* result_code) override;
65 void PostMainMessageLoopRun() override; 66 void PostMainMessageLoopRun() override;
66 void PostDestroyThreads() override; 67 void PostDestroyThreads() override;
67 68
69 protected:
70 // app_shell embedders may need custom extensions client interfaces.
71 // This class takes ownership of the returned objects.
72 virtual ExtensionsClient* CreateExtensionsClient();
73 virtual ExtensionsBrowserClient* CreateExtensionsBrowserClient(
74 content::BrowserContext* context);
75
68 private: 76 private:
69 // Creates and initializes the ExtensionSystem. 77 // Creates and initializes the ExtensionSystem.
70 void CreateExtensionSystem(); 78 void CreateExtensionSystem();
71 79
72 #if defined(OS_CHROMEOS) 80 #if defined(OS_CHROMEOS)
73 scoped_ptr<ShellNetworkController> network_controller_; 81 scoped_ptr<ShellNetworkController> network_controller_;
74 scoped_ptr<ShellAudioController> audio_controller_; 82 scoped_ptr<ShellAudioController> audio_controller_;
75 #endif 83 #endif
76 scoped_ptr<DesktopController> desktop_controller_; 84 scoped_ptr<DesktopController> desktop_controller_;
77 scoped_ptr<ShellBrowserContext> browser_context_; 85 scoped_ptr<ShellBrowserContext> browser_context_;
78 scoped_ptr<ShellDeviceClient> device_client_; 86 scoped_ptr<ShellDeviceClient> device_client_;
79 scoped_ptr<AppWindowClient> app_window_client_; 87 scoped_ptr<AppWindowClient> app_window_client_;
80 scoped_ptr<ShellExtensionsClient> extensions_client_; 88 scoped_ptr<ExtensionsClient> extensions_client_;
81 scoped_ptr<ShellExtensionsBrowserClient> extensions_browser_client_; 89 scoped_ptr<ExtensionsBrowserClient> extensions_browser_client_;
82 scoped_ptr<net::NetLog> net_log_; 90 scoped_ptr<net::NetLog> net_log_;
83 scoped_ptr<content::DevToolsHttpHandler> devtools_http_handler_; 91 scoped_ptr<content::DevToolsHttpHandler> devtools_http_handler_;
84 scoped_ptr<ShellOmahaQueryParamsDelegate> omaha_query_params_delegate_; 92 scoped_ptr<ShellOmahaQueryParamsDelegate> omaha_query_params_delegate_;
85 scoped_ptr<ShellOAuth2TokenService> oauth2_token_service_; 93 scoped_ptr<ShellOAuth2TokenService> oauth2_token_service_;
86 94
87 // Owned by the KeyedService system. 95 // Owned by the KeyedService system.
88 ShellExtensionSystem* extension_system_; 96 ShellExtensionSystem* extension_system_;
89 97
90 // For running app browsertests. 98 // For running app browsertests.
91 const content::MainFunctionParams parameters_; 99 const content::MainFunctionParams parameters_;
92 100
93 // If true, indicates the main message loop should be run 101 // If true, indicates the main message loop should be run
94 // in MainMessageLoopRun. If false, it has already been run. 102 // in MainMessageLoopRun. If false, it has already been run.
95 bool run_message_loop_; 103 bool run_message_loop_;
96 104
97 scoped_ptr<ShellBrowserMainDelegate> browser_main_delegate_; 105 scoped_ptr<ShellBrowserMainDelegate> browser_main_delegate_;
98 106
99 #if !defined(DISABLE_NACL) 107 #if !defined(DISABLE_NACL)
100 base::CancelableTaskTracker task_tracker_; 108 base::CancelableTaskTracker task_tracker_;
101 #endif 109 #endif
102 110
103 DISALLOW_COPY_AND_ASSIGN(ShellBrowserMainParts); 111 DISALLOW_COPY_AND_ASSIGN(ShellBrowserMainParts);
104 }; 112 };
105 113
106 } // namespace extensions 114 } // namespace extensions
107 115
108 #endif // EXTENSIONS_SHELL_BROWSER_SHELL_BROWSER_MAIN_PARTS_H_ 116 #endif // EXTENSIONS_SHELL_BROWSER_SHELL_BROWSER_MAIN_PARTS_H_
OLDNEW
« no previous file with comments | « no previous file | extensions/shell/browser/shell_browser_main_parts.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698