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

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

Issue 20483002: Merge 3 different ways of obtaining first run state into a single one. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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/chrome_browser_main_win.h" 5 #include "chrome/browser/chrome_browser_main_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <shellapi.h> 8 #include <shellapi.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 l10n_util::GetStringUTF16(IDS_UNSUPPORTED_OS_PRE_WIN_XP), 204 l10n_util::GetStringUTF16(IDS_UNSUPPORTED_OS_PRE_WIN_XP),
205 chrome::MESSAGE_BOX_TYPE_WARNING); 205 chrome::MESSAGE_BOX_TYPE_WARNING);
206 } 206 }
207 207
208 return rv; 208 return rv;
209 } 209 }
210 210
211 void ChromeBrowserMainPartsWin::PostMainMessageLoopRun() { 211 void ChromeBrowserMainPartsWin::PostMainMessageLoopRun() {
212 // Log the search engine chosen on first run. Do this at shutdown, after any 212 // Log the search engine chosen on first run. Do this at shutdown, after any
213 // changes are made from the first run bubble link, etc. 213 // changes are made from the first run bubble link, etc.
214 if (do_first_run_tasks() && profile() && !profile()->IsOffTheRecord()) { 214 if (is_first_run() && profile() && !profile()->IsOffTheRecord()) {
215 TemplateURLService* url_service = 215 TemplateURLService* url_service =
216 TemplateURLServiceFactory::GetForProfile(profile()); 216 TemplateURLServiceFactory::GetForProfile(profile());
217 const TemplateURL* default_search_engine = 217 const TemplateURL* default_search_engine =
218 url_service->GetDefaultSearchProvider(); 218 url_service->GetDefaultSearchProvider();
219 // The default engine can be NULL if the administrator has disabled 219 // The default engine can be NULL if the administrator has disabled
220 // default search. 220 // default search.
221 SearchEngineType search_engine_type = 221 SearchEngineType search_engine_type =
222 TemplateURLPrepopulateData::GetEngineType(default_search_engine ? 222 TemplateURLPrepopulateData::GetEngineType(default_search_engine ?
223 default_search_engine->url() : std::string()); 223 default_search_engine->url() : std::string());
224 // Record the search engine chosen. 224 // Record the search engine chosen.
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 if (resource_id) 404 if (resource_id)
405 return l10n_util::GetStringUTF16(resource_id); 405 return l10n_util::GetStringUTF16(resource_id);
406 return string16(); 406 return string16();
407 } 407 }
408 408
409 // static 409 // static
410 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { 410 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() {
411 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); 411 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ());
412 installer::SetTranslationDelegate(&delegate); 412 installer::SetTranslationDelegate(&delegate);
413 } 413 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698