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

Unified Diff: content/public/browser/browser_main_parts.h

Issue 8302016: Make GTK and Aura parts orthogonal to OS parts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: content/public/browser/browser_main_parts.h
diff --git a/content/public/browser/browser_main_parts.h b/content/public/browser/browser_main_parts.h
new file mode 100644
index 0000000000000000000000000000000000000000..3df496decf0e0d821164569caa696af3a8b3e4f6
--- /dev/null
+++ b/content/public/browser/browser_main_parts.h
@@ -0,0 +1,56 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_BROWSER_MAIN_PARTS_H_
jam 2011/10/24 19:36:00 nit: CONTENT_PUBLIC_BROWSER_BOWSER_MAIN_PARTS_H_
stevenjb 2011/10/25 02:51:04 Oops. Done.
+#define CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_BROWSER_MAIN_PARTS_H_
+#pragma once
+
+#include "content/common/content_export.h"
+#include "content/common/result_codes.h"
+
+namespace content {
+
+// Classes deriving fromc BrowserMainParts should ontain singleton member
+// variables specific to the browser process, and virtual methods representing
+// different "stages" to be executed from |BrowserMain()|, mostly to do
+// initialization and shutdown.
jam 2011/10/24 19:36:00 we don't really need to tell embedders where to pu
stevenjb 2011/10/25 02:51:04 Replaced with comment block from browser_main.cc
+//
+// There can be any number of "Parts". These should be constructed in
+// ContentBrowserClient::CreateBrowserMainParts. Each stage will be called
+// for each part in the order it was added. Destruction is in the inverse order.
+
jam 2011/10/24 19:36:00 nit: extra line
stevenjb 2011/10/25 02:51:04 Done.
+class CONTENT_EXPORT BrowserMainParts {
+ public:
+ BrowserMainParts() {};
+ virtual ~BrowserMainParts() {};
+
+ virtual void PreEarlyInitialization() = 0;
+
+ virtual void PostEarlyInitialization() = 0;
+
+ virtual void PreMainMessageLoopStart() = 0;
+
+ // Allows an embedder to do any extra toolkit initialization.
+ virtual void ToolkitInitialized() = 0;
+
+ virtual void PostMainMessageLoopStart() = 0;
+
+ // Returns a result code (see /common/result_codes.h).
+ // Default return value should be content::RESULT_CODE_NORMAL_EXIT.
+ virtual int PreMainMessageLoopRun() = 0;
jam 2011/10/24 19:36:00 why did you change this function to return a value
stevenjb 2011/10/25 02:51:04 That's much better. Done.
+
+ // Returns true if the message loop was run, false otherwise.
+ // If no BrowserMainParts implementations return true, the default
+ // implementation will be run.
+ virtual bool MainMessageLoopRun() = 0;
+
+ virtual void PostMainMessageLoopRun() = 0;
+
+private:
jam 2011/10/24 19:36:00 nit: space before private
stevenjb 2011/10/25 02:51:04 Done.
+ DISALLOW_COPY_AND_ASSIGN(BrowserMainParts);
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_BROWSER_MAIN_PARTS_H_

Powered by Google App Engine
This is Rietveld 408576698