Home | History | Annotate | Download | only in shell
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CONTENT_SHELL_SHELL_BROWSER_MAIN_PARTS_H_
      6 #define CONTENT_SHELL_SHELL_BROWSER_MAIN_PARTS_H_
      7 
      8 #include "base/basictypes.h"
      9 #include "base/memory/scoped_ptr.h"
     10 #include "content/public/browser/browser_main_parts.h"
     11 #include "content/public/common/main_function_params.h"
     12 
     13 namespace base {
     14 class Thread;
     15 }
     16 
     17 namespace net {
     18 class NetLog;
     19 }
     20 
     21 namespace content {
     22 
     23 class ShellBrowserContext;
     24 class ShellDevToolsDelegate;
     25 class ShellPluginServiceFilter;
     26 
     27 class ShellBrowserMainParts : public BrowserMainParts {
     28  public:
     29   explicit ShellBrowserMainParts(const MainFunctionParams& parameters);
     30   virtual ~ShellBrowserMainParts();
     31 
     32   // BrowserMainParts overrides.
     33   virtual void PreEarlyInitialization() OVERRIDE;
     34   virtual void PreMainMessageLoopStart() OVERRIDE;
     35   virtual void PostMainMessageLoopStart() OVERRIDE;
     36   virtual void PreMainMessageLoopRun() OVERRIDE;
     37   virtual bool MainMessageLoopRun(int* result_code) OVERRIDE;
     38   virtual void PostMainMessageLoopRun() OVERRIDE;
     39 
     40   ShellDevToolsDelegate* devtools_delegate() {
     41     return devtools_delegate_.get();
     42   }
     43 
     44   ShellBrowserContext* browser_context() { return browser_context_.get(); }
     45   ShellBrowserContext* off_the_record_browser_context() {
     46     return off_the_record_browser_context_.get();
     47   }
     48 
     49   net::NetLog* net_log() { return net_log_.get(); }
     50 
     51  private:
     52   scoped_ptr<net::NetLog> net_log_;
     53   scoped_ptr<ShellBrowserContext> browser_context_;
     54   scoped_ptr<ShellBrowserContext> off_the_record_browser_context_;
     55 
     56   // For running content_browsertests.
     57   const MainFunctionParams parameters_;
     58   bool run_message_loop_;
     59 
     60   scoped_ptr<ShellDevToolsDelegate> devtools_delegate_;
     61 #if defined(ENABLE_PLUGINS)
     62   scoped_ptr<ShellPluginServiceFilter> plugin_service_filter_;
     63 #endif
     64 
     65   DISALLOW_COPY_AND_ASSIGN(ShellBrowserMainParts);
     66 };
     67 
     68 }  // namespace content
     69 
     70 #endif  // CONTENT_SHELL_SHELL_BROWSER_MAIN_PARTS_H_
     71