OLD | NEW |
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 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 #include "chrome/browser/notifications/notification_ui_manager.h" | 69 #include "chrome/browser/notifications/notification_ui_manager.h" |
70 #include "chrome/browser/platform_util.h" | 70 #include "chrome/browser/platform_util.h" |
71 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 71 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
72 #include "chrome/browser/prefs/pref_service.h" | 72 #include "chrome/browser/prefs/pref_service.h" |
73 #include "chrome/browser/prerender/prerender_tab_helper.h" | 73 #include "chrome/browser/prerender/prerender_tab_helper.h" |
74 #include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h" | 74 #include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h" |
75 #include "chrome/browser/printing/print_preview_tab_controller.h" | 75 #include "chrome/browser/printing/print_preview_tab_controller.h" |
76 #include "chrome/browser/printing/print_view_manager.h" | 76 #include "chrome/browser/printing/print_view_manager.h" |
77 #include "chrome/browser/profiles/profile.h" | 77 #include "chrome/browser/profiles/profile.h" |
78 #include "chrome/browser/profiles/profile_manager.h" | 78 #include "chrome/browser/profiles/profile_manager.h" |
| 79 #include "chrome/browser/profiles/profile_metrics.h" |
79 #include "chrome/browser/sessions/restore_tab_helper.h" | 80 #include "chrome/browser/sessions/restore_tab_helper.h" |
80 #include "chrome/browser/sessions/session_service.h" | 81 #include "chrome/browser/sessions/session_service.h" |
81 #include "chrome/browser/sessions/session_service_factory.h" | 82 #include "chrome/browser/sessions/session_service_factory.h" |
82 #include "chrome/browser/sessions/session_types.h" | 83 #include "chrome/browser/sessions/session_types.h" |
83 #include "chrome/browser/sessions/tab_restore_service.h" | 84 #include "chrome/browser/sessions/tab_restore_service.h" |
84 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 85 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
85 #include "chrome/browser/sync/profile_sync_service.h" | 86 #include "chrome/browser/sync/profile_sync_service.h" |
86 #include "chrome/browser/sync/sync_ui_util.h" | 87 #include "chrome/browser/sync/sync_ui_util.h" |
87 #include "chrome/browser/tab_closeable_state_watcher.h" | 88 #include "chrome/browser/tab_closeable_state_watcher.h" |
88 #include "chrome/browser/tab_contents/background_contents.h" | 89 #include "chrome/browser/tab_contents/background_contents.h" |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 if (profile_->GetProfileSyncService()) | 377 if (profile_->GetProfileSyncService()) |
377 profile_->GetProfileSyncService()->AddObserver(this); | 378 profile_->GetProfileSyncService()->AddObserver(this); |
378 | 379 |
379 CreateInstantIfNecessary(); | 380 CreateInstantIfNecessary(); |
380 | 381 |
381 // Make sure TabFinder has been created. This does nothing if TabFinder is | 382 // Make sure TabFinder has been created. This does nothing if TabFinder is |
382 // not enabled. | 383 // not enabled. |
383 TabFinder::GetInstance(); | 384 TabFinder::GetInstance(); |
384 | 385 |
385 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_INIT); | 386 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_INIT); |
| 387 |
| 388 FilePath profile_path = profile->GetPath(); |
| 389 ProfileMetrics::LogProfileLaunch(profile_path); |
386 } | 390 } |
387 | 391 |
388 Browser::~Browser() { | 392 Browser::~Browser() { |
389 if (profile_->GetProfileSyncService()) | 393 if (profile_->GetProfileSyncService()) |
390 profile_->GetProfileSyncService()->RemoveObserver(this); | 394 profile_->GetProfileSyncService()->RemoveObserver(this); |
391 | 395 |
392 BrowserList::RemoveBrowser(this); | 396 BrowserList::RemoveBrowser(this); |
393 | 397 |
394 #if !defined(OS_MACOSX) | 398 #if !defined(OS_MACOSX) |
395 if (!BrowserList::HasBrowserWithProfile(profile_)) { | 399 if (!BrowserList::HasBrowserWithProfile(profile_)) { |
(...skipping 4927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5323 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); | 5327 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); |
5324 } else { | 5328 } else { |
5325 GlobalErrorService* service = | 5329 GlobalErrorService* service = |
5326 GlobalErrorServiceFactory::GetForProfile(profile()); | 5330 GlobalErrorServiceFactory::GetForProfile(profile()); |
5327 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); | 5331 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); |
5328 if (error) { | 5332 if (error) { |
5329 error->ShowBubbleView(this); | 5333 error->ShowBubbleView(this); |
5330 } | 5334 } |
5331 } | 5335 } |
5332 } | 5336 } |
OLD | NEW |