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

Side by Side Diff: chrome/browser/browser_main_win.cc

Issue 2931007: BrowserMain() refactoring, part 2. (Closed)
Patch Set: Updated per brettw and merged ToT. Created 10 years, 4 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 | « chrome/browser/browser_main_posix.cc ('k') | chrome/chrome_browser.gypi » ('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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/browser_main.h" 5 #include "chrome/browser/browser_main.h"
6 #include "chrome/browser/browser_main_win.h" 6 #include "chrome/browser/browser_main_win.h"
7 7
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 10
(...skipping 15 matching lines...) Expand all
26 #include "chrome/common/result_codes.h" 26 #include "chrome/common/result_codes.h"
27 #include "chrome/installer/util/helper.h" 27 #include "chrome/installer/util/helper.h"
28 #include "chrome/installer/util/install_util.h" 28 #include "chrome/installer/util/install_util.h"
29 #include "chrome/installer/util/shell_util.h" 29 #include "chrome/installer/util/shell_util.h"
30 #include "grit/chromium_strings.h" 30 #include "grit/chromium_strings.h"
31 #include "grit/generated_resources.h" 31 #include "grit/generated_resources.h"
32 #include "net/base/winsock_init.h" 32 #include "net/base/winsock_init.h"
33 #include "views/focus/accelerator_handler.h" 33 #include "views/focus/accelerator_handler.h"
34 #include "views/window/window.h" 34 #include "views/window/window.h"
35 35
36 void WillInitializeMainMessageLoop(const MainFunctionParams& parameters) {
37 OleInitialize(NULL);
38 }
39
40 void DidEndMainMessageLoop() { 36 void DidEndMainMessageLoop() {
41 OleUninitialize(); 37 OleUninitialize();
42 } 38 }
43 39
44 void RecordBreakpadStatusUMA(MetricsService* metrics) { 40 void RecordBreakpadStatusUMA(MetricsService* metrics) {
45 DWORD len = ::GetEnvironmentVariableW( 41 DWORD len = ::GetEnvironmentVariableW(
46 ASCIIToWide(env_vars::kNoOOBreakpad).c_str() , NULL, 0); 42 ASCIIToWide(env_vars::kNoOOBreakpad).c_str() , NULL, 0);
47 metrics->RecordBreakpadRegistration((len == 0)); 43 metrics->RecordBreakpadRegistration((len == 0));
48 metrics->RecordBreakpadHasDebugger(TRUE == ::IsDebuggerPresent()); 44 metrics->RecordBreakpadHasDebugger(TRUE == ::IsDebuggerPresent());
49 } 45 }
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 return false; 200 return false;
205 } 201 }
206 202
207 // BrowserMainPartsWin --------------------------------------------------------- 203 // BrowserMainPartsWin ---------------------------------------------------------
208 204
209 class BrowserMainPartsWin : public BrowserMainParts { 205 class BrowserMainPartsWin : public BrowserMainParts {
210 public: 206 public:
211 explicit BrowserMainPartsWin(const MainFunctionParams& parameters) 207 explicit BrowserMainPartsWin(const MainFunctionParams& parameters)
212 : BrowserMainParts(parameters) {} 208 : BrowserMainParts(parameters) {}
213 209
214 private: 210 protected:
215 virtual void PreEarlyInitialization() { 211 virtual void PreEarlyInitialization() {
216 // Initialize Winsock. 212 // Initialize Winsock.
217 net::EnsureWinsockInit(); 213 net::EnsureWinsockInit();
218 } 214 }
215
216 virtual void PreMainMessageLoopStart() {
217 OleInitialize(NULL);
218 }
219 }; 219 };
220 220
221 // static 221 // static
222 BrowserMainParts* BrowserMainParts::CreateBrowserMainParts( 222 BrowserMainParts* BrowserMainParts::CreateBrowserMainParts(
223 const MainFunctionParams& parameters) { 223 const MainFunctionParams& parameters) {
224 return new BrowserMainPartsWin(parameters); 224 return new BrowserMainPartsWin(parameters);
225 } 225 }
OLDNEW
« no previous file with comments | « chrome/browser/browser_main_posix.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698