diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-27 22:17:29 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-27 22:17:29 +0000 |
commit | fc14cef961fa421cc1c44e373e3f3f0fb84ec545 (patch) | |
tree | b7f442cf807c187103f4340c9aa9a0b37e3c94d6 /chrome/browser/browser_init.h | |
parent | 933fbfb3a9813625eea8c2258748ce86210444a8 (diff) | |
download | chromium_src-fc14cef961fa421cc1c44e373e3f3f0fb84ec545.zip chromium_src-fc14cef961fa421cc1c44e373e3f3f0fb84ec545.tar.gz chromium_src-fc14cef961fa421cc1c44e373e3f3f0fb84ec545.tar.bz2 |
Move MessageWindow out into its own file. BrowserInit is now cross-platform-capable.
Fix up the header includes in browser_init.cc/h removing a bunch of windows stuff.
Review URL: http://codereview.chromium.org/19034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8762 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_init.h')
-rw-r--r-- | chrome/browser/browser_init.h | 82 |
1 files changed, 7 insertions, 75 deletions
diff --git a/chrome/browser/browser_init.h b/chrome/browser/browser_init.h index 8b27aa1..5e11811 100644 --- a/chrome/browser/browser_init.h +++ b/chrome/browser/browser_init.h @@ -2,21 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_BROWSER_INIT_H__ -#define CHROME_BROWSER_BROWSER_INIT_H__ +#ifndef CHROME_BROWSER_BROWSER_INIT_H_ +#define CHROME_BROWSER_BROWSER_INIT_H_ -#include <atlbase.h> -#include <atlwin.h> -#include <windows.h> #include <string> #include <vector> -#include "base/gfx/rect.h" -#include "chrome/browser/profile_manager.h" +#include "base/basictypes.h" class Browser; class CommandLine; class GURL; +class PrefService; class Profile; class TabContents; @@ -27,68 +24,6 @@ class BrowserInit { // Returns true if the browser is coming up. static bool InProcessStartup(); - // MessageWindow ------------------------------------------------------------- - // - // Class for dealing with the invisible global message window for IPC. This - // window allows different browser processes to communicate with each other. - // It is named according to the user data directory, so we can be sure that - // no more than one copy of the application can be running at once with a - // given data directory. - - class MessageWindow { - public: - explicit MessageWindow(const std::wstring& user_data_dir); - ~MessageWindow(); - - // Returns true if another process was found and notified, false if we - // should continue with this process. Roughly based on Mozilla - // - // TODO(brettw): this will not handle all cases. If two process start up too - // close to each other, the window might not have been created yet for the - // first one, so this function won't find it. - bool NotifyOtherProcess(); - - // Create the toplevel message window for IPC. - void Create(); - - // Blocks the dispatch of CopyData messages. - void Lock() { - locked_ = true; - } - - // Allows the dispatch of CopyData messages. - void Unlock() { - locked_ = false; - } - - // This ugly behemoth handles startup commands sent from another process. - LRESULT OnCopyData(HWND hwnd, const COPYDATASTRUCT* cds); - - // Looks for zombie renderer and plugin processes that could have survived. - void HuntForZombieChromeProcesses(); - - private: - LRESULT CALLBACK WndProc(HWND hwnd, - UINT message, - WPARAM wparam, - LPARAM lparam); - - static LRESULT CALLBACK WndProcStatic(HWND hwnd, - UINT message, - WPARAM wparam, - LPARAM lparam) { - MessageWindow* msg_wnd = reinterpret_cast<MessageWindow*>( - GetWindowLongPtr(hwnd, GWLP_USERDATA)); - return msg_wnd->WndProc(hwnd, message, wparam, lparam); - } - - HWND remote_window_; // The HWND_MESSAGE of another browser. - HWND window_; // The HWND_MESSAGE window. - bool locked_; - - DISALLOW_EVIL_CONSTRUCTORS(MessageWindow); - }; - // LaunchWithProfile --------------------------------------------------------- // // Assists launching the application and appending the initial tabs for a @@ -140,10 +75,7 @@ class BrowserInit { std::wstring command_line_; Profile* profile_; - // Bounds for the browser. - gfx::Rect start_position_; - - DISALLOW_EVIL_CONSTRUCTORS(LaunchWithProfile); + DISALLOW_COPY_AND_ASSIGN(LaunchWithProfile); }; // This function performs command-line handling and is invoked when @@ -175,8 +107,8 @@ class BrowserInit { // This class is for scoping purposes. BrowserInit(); - DISALLOW_EVIL_CONSTRUCTORS(BrowserInit); + DISALLOW_COPY_AND_ASSIGN(BrowserInit); }; -#endif // CHROME_BROWSER_BROWSER_INIT_H__ +#endif // CHROME_BROWSER_BROWSER_INIT_H_ |