| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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.h" | 5 #include "chrome/browser/browser.h" |
| 6 | 6 |
| 7 #include "app/animation.h" | 7 #include "app/animation.h" |
| 8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/keyboard_codes.h" | 10 #include "base/keyboard_codes.h" |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 registrar_.Add(this, NotificationType::SSL_VISIBLE_STATE_CHANGED, | 133 registrar_.Add(this, NotificationType::SSL_VISIBLE_STATE_CHANGED, |
| 134 NotificationService::AllSources()); | 134 NotificationService::AllSources()); |
| 135 registrar_.Add(this, NotificationType::EXTENSION_UPDATE_DISABLED, | 135 registrar_.Add(this, NotificationType::EXTENSION_UPDATE_DISABLED, |
| 136 NotificationService::AllSources()); | 136 NotificationService::AllSources()); |
| 137 registrar_.Add(this, NotificationType::EXTENSION_UNLOADED, | 137 registrar_.Add(this, NotificationType::EXTENSION_UNLOADED, |
| 138 NotificationService::AllSources()); | 138 NotificationService::AllSources()); |
| 139 registrar_.Add(this, NotificationType::EXTENSION_PROCESS_CRASHED, | 139 registrar_.Add(this, NotificationType::EXTENSION_PROCESS_CRASHED, |
| 140 NotificationService::AllSources()); | 140 NotificationService::AllSources()); |
| 141 registrar_.Add(this, NotificationType::BROWSER_THEME_CHANGED, | 141 registrar_.Add(this, NotificationType::BROWSER_THEME_CHANGED, |
| 142 NotificationService::AllSources()); | 142 NotificationService::AllSources()); |
| 143 registrar_.Add(this, NotificationType::HISTORY_TOO_NEW, | 143 registrar_.Add(this, NotificationType::PROFILE_ERROR, |
| 144 NotificationService::AllSources()); | 144 NotificationService::AllSources()); |
| 145 | 145 |
| 146 // Need to know when to alert the user of theme install delay. | 146 // Need to know when to alert the user of theme install delay. |
| 147 registrar_.Add(this, NotificationType::EXTENSION_READY_FOR_INSTALL, | 147 registrar_.Add(this, NotificationType::EXTENSION_READY_FOR_INSTALL, |
| 148 NotificationService::AllSources()); | 148 NotificationService::AllSources()); |
| 149 | 149 |
| 150 InitCommandState(); | 150 InitCommandState(); |
| 151 BrowserList::AddBrowser(this); | 151 BrowserList::AddBrowser(this); |
| 152 | 152 |
| 153 encoding_auto_detect_.Init(prefs::kWebKitUsesUniversalDetector, | 153 encoding_auto_detect_.Init(prefs::kWebKitUsesUniversalDetector, |
| (...skipping 2087 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2241 window()->UserChangedTheme(); | 2241 window()->UserChangedTheme(); |
| 2242 break; | 2242 break; |
| 2243 | 2243 |
| 2244 case NotificationType::EXTENSION_READY_FOR_INSTALL: { | 2244 case NotificationType::EXTENSION_READY_FOR_INSTALL: { |
| 2245 if (BrowserList::GetLastActive() != this) | 2245 if (BrowserList::GetLastActive() != this) |
| 2246 break; | 2246 break; |
| 2247 window()->ShowThemeInstallBubble(); | 2247 window()->ShowThemeInstallBubble(); |
| 2248 break; | 2248 break; |
| 2249 } | 2249 } |
| 2250 | 2250 |
| 2251 case NotificationType::HISTORY_TOO_NEW: { | 2251 case NotificationType::PROFILE_ERROR: { |
| 2252 if (BrowserList::GetLastActive() != this) | 2252 if (BrowserList::GetLastActive() != this) |
| 2253 break; | 2253 break; |
| 2254 window()->ShowHistoryTooNewDialog(); | 2254 int* message_id = Details<int>(details).ptr(); |
| 2255 window()->ShowProfileErrorDialog(*message_id); |
| 2255 break; | 2256 break; |
| 2256 } | 2257 } |
| 2257 | 2258 |
| 2258 default: | 2259 default: |
| 2259 NOTREACHED() << "Got a notification we didn't register for."; | 2260 NOTREACHED() << "Got a notification we didn't register for."; |
| 2260 } | 2261 } |
| 2261 } | 2262 } |
| 2262 | 2263 |
| 2263 | 2264 |
| 2264 /////////////////////////////////////////////////////////////////////////////// | 2265 /////////////////////////////////////////////////////////////////////////////// |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2979 /////////////////////////////////////////////////////////////////////////////// | 2980 /////////////////////////////////////////////////////////////////////////////// |
| 2980 // BrowserToolbarModel (private): | 2981 // BrowserToolbarModel (private): |
| 2981 | 2982 |
| 2982 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { | 2983 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { |
| 2983 // This |current_tab| can be NULL during the initialization of the | 2984 // This |current_tab| can be NULL during the initialization of the |
| 2984 // toolbar during window creation (i.e. before any tabs have been added | 2985 // toolbar during window creation (i.e. before any tabs have been added |
| 2985 // to the window). | 2986 // to the window). |
| 2986 TabContents* current_tab = browser_->GetSelectedTabContents(); | 2987 TabContents* current_tab = browser_->GetSelectedTabContents(); |
| 2987 return current_tab ? ¤t_tab->controller() : NULL; | 2988 return current_tab ? ¤t_tab->controller() : NULL; |
| 2988 } | 2989 } |
| OLD | NEW |