OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 toolbar_model_.reset(new ToolbarModelImpl(toolbar_model_delegate_.get(), | 388 toolbar_model_.reset(new ToolbarModelImpl(toolbar_model_delegate_.get(), |
389 content::kMaxURLDisplayChars)); | 389 content::kMaxURLDisplayChars)); |
390 search_model_.reset(new SearchModel()); | 390 search_model_.reset(new SearchModel()); |
391 search_delegate_.reset(new SearchDelegate(search_model_.get())); | 391 search_delegate_.reset(new SearchDelegate(search_model_.get())); |
392 | 392 |
393 extension_registry_observer_.Add( | 393 extension_registry_observer_.Add( |
394 extensions::ExtensionRegistry::Get(profile_)); | 394 extensions::ExtensionRegistry::Get(profile_)); |
395 registrar_.Add(this, | 395 registrar_.Add(this, |
396 extensions::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, | 396 extensions::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, |
397 content::NotificationService::AllSources()); | 397 content::NotificationService::AllSources()); |
398 #if defined(ENABLE_THEMES) | 398 #if !defined(OS_ANDROID) |
399 registrar_.Add( | 399 registrar_.Add( |
400 this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, | 400 this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, |
401 content::Source<ThemeService>( | 401 content::Source<ThemeService>( |
402 ThemeServiceFactory::GetForProfile(profile_))); | 402 ThemeServiceFactory::GetForProfile(profile_))); |
403 #endif | 403 #endif |
404 registrar_.Add(this, chrome::NOTIFICATION_WEB_CONTENT_SETTINGS_CHANGED, | 404 registrar_.Add(this, chrome::NOTIFICATION_WEB_CONTENT_SETTINGS_CHANGED, |
405 content::NotificationService::AllSources()); | 405 content::NotificationService::AllSources()); |
406 | 406 |
407 profile_pref_registrar_.Init(profile_->GetPrefs()); | 407 profile_pref_registrar_.Init(profile_->GetPrefs()); |
408 profile_pref_registrar_.Add( | 408 profile_pref_registrar_.Add( |
(...skipping 1578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1987 const content::NotificationSource& source, | 1987 const content::NotificationSource& source, |
1988 const content::NotificationDetails& details) { | 1988 const content::NotificationDetails& details) { |
1989 switch (type) { | 1989 switch (type) { |
1990 case extensions::NOTIFICATION_EXTENSION_PROCESS_TERMINATED: { | 1990 case extensions::NOTIFICATION_EXTENSION_PROCESS_TERMINATED: { |
1991 Profile* profile = content::Source<Profile>(source).ptr(); | 1991 Profile* profile = content::Source<Profile>(source).ptr(); |
1992 if (profile_->IsSameProfile(profile) && window()->GetLocationBar()) | 1992 if (profile_->IsSameProfile(profile) && window()->GetLocationBar()) |
1993 window()->GetLocationBar()->UpdatePageActions(); | 1993 window()->GetLocationBar()->UpdatePageActions(); |
1994 break; | 1994 break; |
1995 } | 1995 } |
1996 | 1996 |
1997 #if defined(ENABLE_THEMES) | 1997 #if !defined(OS_ANDROID) |
1998 case chrome::NOTIFICATION_BROWSER_THEME_CHANGED: | 1998 case chrome::NOTIFICATION_BROWSER_THEME_CHANGED: |
1999 window()->UserChangedTheme(); | 1999 window()->UserChangedTheme(); |
2000 break; | 2000 break; |
2001 #endif | 2001 #endif |
2002 | 2002 |
2003 case chrome::NOTIFICATION_WEB_CONTENT_SETTINGS_CHANGED: { | 2003 case chrome::NOTIFICATION_WEB_CONTENT_SETTINGS_CHANGED: { |
2004 WebContents* web_contents = content::Source<WebContents>(source).ptr(); | 2004 WebContents* web_contents = content::Source<WebContents>(source).ptr(); |
2005 if (web_contents == tab_strip_model_->GetActiveWebContents()) { | 2005 if (web_contents == tab_strip_model_->GetActiveWebContents()) { |
2006 LocationBar* location_bar = window()->GetLocationBar(); | 2006 LocationBar* location_bar = window()->GetLocationBar(); |
2007 if (location_bar) | 2007 if (location_bar) |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2600 // new window later, thus we need to navigate the window now. | 2600 // new window later, thus we need to navigate the window now. |
2601 if (contents) { | 2601 if (contents) { |
2602 contents->web_contents()->GetController().LoadURL( | 2602 contents->web_contents()->GetController().LoadURL( |
2603 target_url, content::Referrer(), ui::PAGE_TRANSITION_LINK, | 2603 target_url, content::Referrer(), ui::PAGE_TRANSITION_LINK, |
2604 std::string()); // No extra headers. | 2604 std::string()); // No extra headers. |
2605 } | 2605 } |
2606 } | 2606 } |
2607 | 2607 |
2608 return contents != NULL; | 2608 return contents != NULL; |
2609 } | 2609 } |
OLD | NEW |