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

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

Issue 7967024: Profile shouldn't own PersonalDataManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addresses isherman #11 Created 9 years, 3 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/ui/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #endif // OS_WIN 10 #endif // OS_WIN
11 11
12 #include <algorithm> 12 #include <algorithm>
13 #include <string> 13 #include <string>
14 14
15 #include "base/base_paths.h" 15 #include "base/base_paths.h"
16 #include "base/command_line.h" 16 #include "base/command_line.h"
17 #include "base/logging.h" 17 #include "base/logging.h"
18 #include "base/metrics/histogram.h" 18 #include "base/metrics/histogram.h"
19 #include "base/path_service.h" 19 #include "base/path_service.h"
20 #include "base/string_number_conversions.h" 20 #include "base/string_number_conversions.h"
21 #include "base/string_util.h" 21 #include "base/string_util.h"
22 #include "base/threading/thread.h" 22 #include "base/threading/thread.h"
23 #include "base/threading/thread_restrictions.h" 23 #include "base/threading/thread_restrictions.h"
24 #include "base/time.h" 24 #include "base/time.h"
25 #include "base/utf_string_conversions.h" 25 #include "base/utf_string_conversions.h"
26 #include "chrome/app/chrome_command_ids.h" 26 #include "chrome/app/chrome_command_ids.h"
27 #include "chrome/browser/autofill/autofill_manager.h" 27 #include "chrome/browser/autofill/autofill_manager.h"
28 #include "chrome/browser/autofill/personal_data_manager_factory.h"
28 #include "chrome/browser/background/background_contents_service.h" 29 #include "chrome/browser/background/background_contents_service.h"
29 #include "chrome/browser/bookmarks/bookmark_model.h" 30 #include "chrome/browser/bookmarks/bookmark_model.h"
30 #include "chrome/browser/bookmarks/bookmark_utils.h" 31 #include "chrome/browser/bookmarks/bookmark_utils.h"
31 #include "chrome/browser/browser_process.h" 32 #include "chrome/browser/browser_process.h"
32 #include "chrome/browser/browser_shutdown.h" 33 #include "chrome/browser/browser_shutdown.h"
33 #include "chrome/browser/character_encoding.h" 34 #include "chrome/browser/character_encoding.h"
34 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" 35 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
35 #include "chrome/browser/custom_handlers/register_protocol_handler_infobar_deleg ate.h" 36 #include "chrome/browser/custom_handlers/register_protocol_handler_infobar_deleg ate.h"
36 #include "chrome/browser/debugger/devtools_toggle_action.h" 37 #include "chrome/browser/debugger/devtools_toggle_action.h"
37 #include "chrome/browser/debugger/devtools_window.h" 38 #include "chrome/browser/debugger/devtools_window.h"
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 // This enables the compact navigation bar host. 517 // This enables the compact navigation bar host.
517 UseCompactNavigationBarChanged(); 518 UseCompactNavigationBarChanged();
518 } 519 }
519 520
520 PrefService* local_state = g_browser_process->local_state(); 521 PrefService* local_state = g_browser_process->local_state();
521 if (local_state && local_state->FindPreference( 522 if (local_state && local_state->FindPreference(
522 prefs::kAutofillPersonalDataManagerFirstRun) && 523 prefs::kAutofillPersonalDataManagerFirstRun) &&
523 local_state->GetBoolean(prefs::kAutofillPersonalDataManagerFirstRun)) { 524 local_state->GetBoolean(prefs::kAutofillPersonalDataManagerFirstRun)) {
524 // Notify PDM that this is a first run. 525 // Notify PDM that this is a first run.
525 #if defined(OS_WIN) 526 #if defined(OS_WIN)
526 ImportAutofillDataWin(profile_->GetPersonalDataManager()); 527 ImportAutofillDataWin(PersonalDataManagerFactory::GetForProfile(profile_));
527 #endif // defined(OS_WIN) 528 #endif // defined(OS_WIN)
528 // Reset the preference so we don't call it again for subsequent windows. 529 // Reset the preference so we don't call it again for subsequent windows.
529 local_state->ClearPref(prefs::kAutofillPersonalDataManagerFirstRun); 530 local_state->ClearPref(prefs::kAutofillPersonalDataManagerFirstRun);
530 } 531 }
531 532
532 // Permanently dismiss ntp4 bubble for new users. 533 // Permanently dismiss ntp4 bubble for new users.
533 if (FirstRun::IsChromeFirstRun()) 534 if (FirstRun::IsChromeFirstRun())
534 NewTabPageHandler::DismissIntroMessage(profile_->GetPrefs()); 535 NewTabPageHandler::DismissIntroMessage(profile_->GetPrefs());
535 } 536 }
536 537
(...skipping 4738 matching lines...) Expand 10 before | Expand all | Expand 10 after
5275 } else if (is_type_tabbed()) { 5276 } else if (is_type_tabbed()) {
5276 GlobalErrorService* service = 5277 GlobalErrorService* service =
5277 GlobalErrorServiceFactory::GetForProfile(profile()); 5278 GlobalErrorServiceFactory::GetForProfile(profile());
5278 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); 5279 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView();
5279 if (error) { 5280 if (error) {
5280 error->ShowBubbleView(this); 5281 error->ShowBubbleView(this);
5281 did_show_bubble = true; 5282 did_show_bubble = true;
5282 } 5283 }
5283 } 5284 }
5284 } 5285 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/test/integration/autofill_helper.cc ('k') | chrome/browser/ui/webui/bidi_checker_web_ui_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698