| 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 #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 // defined(OS_WIN) | 10 #endif // defined(OS_WIN) |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 if (!app_name_.empty()) | 370 if (!app_name_.empty()) |
| 371 chrome::RegisterAppPrefs(app_name_, profile_); | 371 chrome::RegisterAppPrefs(app_name_, profile_); |
| 372 tab_strip_model_->AddObserver(this); | 372 tab_strip_model_->AddObserver(this); |
| 373 | 373 |
| 374 toolbar_model_.reset(new ToolbarModelImpl(toolbar_model_delegate_.get())); | 374 toolbar_model_.reset(new ToolbarModelImpl(toolbar_model_delegate_.get())); |
| 375 search_model_.reset(new SearchModel()); | 375 search_model_.reset(new SearchModel()); |
| 376 search_delegate_.reset(new SearchDelegate(search_model_.get())); | 376 search_delegate_.reset(new SearchDelegate(search_model_.get())); |
| 377 | 377 |
| 378 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, | 378 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, |
| 379 content::Source<Profile>(profile_->GetOriginalProfile())); | 379 content::Source<Profile>(profile_->GetOriginalProfile())); |
| 380 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, | 380 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, |
| 381 content::Source<Profile>(profile_->GetOriginalProfile())); | 381 content::Source<Profile>(profile_->GetOriginalProfile())); |
| 382 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED, | 382 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED, |
| 383 content::Source<Profile>(profile_->GetOriginalProfile())); | 383 content::Source<Profile>(profile_->GetOriginalProfile())); |
| 384 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, | 384 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, |
| 385 content::NotificationService::AllSources()); | 385 content::NotificationService::AllSources()); |
| 386 #if defined(ENABLE_THEMES) | 386 #if defined(ENABLE_THEMES) |
| 387 registrar_.Add( | 387 registrar_.Add( |
| 388 this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, | 388 this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, |
| 389 content::Source<ThemeService>( | 389 content::Source<ThemeService>( |
| 390 ThemeServiceFactory::GetForProfile(profile_))); | 390 ThemeServiceFactory::GetForProfile(profile_))); |
| (...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1822 url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false)); | 1822 url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false)); |
| 1823 } | 1823 } |
| 1824 | 1824 |
| 1825 /////////////////////////////////////////////////////////////////////////////// | 1825 /////////////////////////////////////////////////////////////////////////////// |
| 1826 // Browser, content::NotificationObserver implementation: | 1826 // Browser, content::NotificationObserver implementation: |
| 1827 | 1827 |
| 1828 void Browser::Observe(int type, | 1828 void Browser::Observe(int type, |
| 1829 const content::NotificationSource& source, | 1829 const content::NotificationSource& source, |
| 1830 const content::NotificationDetails& details) { | 1830 const content::NotificationDetails& details) { |
| 1831 switch (type) { | 1831 switch (type) { |
| 1832 case chrome::NOTIFICATION_EXTENSION_UNLOADED: { | 1832 case chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: { |
| 1833 chrome::UpdateCommandEnabled( | 1833 chrome::UpdateCommandEnabled( |
| 1834 this, | 1834 this, |
| 1835 IDC_BOOKMARK_PAGE, | 1835 IDC_BOOKMARK_PAGE, |
| 1836 !chrome::ShouldRemoveBookmarkThisPageUI(profile_)); | 1836 !chrome::ShouldRemoveBookmarkThisPageUI(profile_)); |
| 1837 | 1837 |
| 1838 if (window()->GetLocationBar()) | 1838 if (window()->GetLocationBar()) |
| 1839 window()->GetLocationBar()->UpdatePageActions(); | 1839 window()->GetLocationBar()->UpdatePageActions(); |
| 1840 | 1840 |
| 1841 const extensions::UnloadedExtensionInfo* extension_info = | 1841 const extensions::UnloadedExtensionInfo* extension_info = |
| 1842 content::Details<extensions::UnloadedExtensionInfo>(details).ptr(); | 1842 content::Details<extensions::UnloadedExtensionInfo>(details).ptr(); |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2337 if (contents && !allow_js_access) { | 2337 if (contents && !allow_js_access) { |
| 2338 contents->web_contents()->GetController().LoadURL( | 2338 contents->web_contents()->GetController().LoadURL( |
| 2339 target_url, | 2339 target_url, |
| 2340 content::Referrer(), | 2340 content::Referrer(), |
| 2341 content::PAGE_TRANSITION_LINK, | 2341 content::PAGE_TRANSITION_LINK, |
| 2342 std::string()); // No extra headers. | 2342 std::string()); // No extra headers. |
| 2343 } | 2343 } |
| 2344 | 2344 |
| 2345 return contents != NULL; | 2345 return contents != NULL; |
| 2346 } | 2346 } |
| OLD | NEW |