| 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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 unload_controller_.reset(new chrome::UnloadController(this)); | 369 unload_controller_.reset(new chrome::UnloadController(this)); |
| 370 | 370 |
| 371 if (!app_name_.empty()) | 371 if (!app_name_.empty()) |
| 372 chrome::RegisterAppPrefs(app_name_, profile_); | 372 chrome::RegisterAppPrefs(app_name_, profile_); |
| 373 tab_strip_model_->AddObserver(this); | 373 tab_strip_model_->AddObserver(this); |
| 374 | 374 |
| 375 toolbar_model_.reset(new ToolbarModelImpl(toolbar_model_delegate_.get())); | 375 toolbar_model_.reset(new ToolbarModelImpl(toolbar_model_delegate_.get())); |
| 376 search_model_.reset(new SearchModel()); | 376 search_model_.reset(new SearchModel()); |
| 377 search_delegate_.reset(new SearchDelegate(search_model_.get())); | 377 search_delegate_.reset(new SearchDelegate(search_model_.get())); |
| 378 | 378 |
| 379 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, | 379 registrar_.Add(this, |
| 380 chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, |
| 380 content::Source<Profile>(profile_->GetOriginalProfile())); | 381 content::Source<Profile>(profile_->GetOriginalProfile())); |
| 381 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, | 382 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, |
| 382 content::Source<Profile>(profile_->GetOriginalProfile())); | 383 content::Source<Profile>(profile_->GetOriginalProfile())); |
| 383 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED, | 384 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED, |
| 384 content::Source<Profile>(profile_->GetOriginalProfile())); | 385 content::Source<Profile>(profile_->GetOriginalProfile())); |
| 385 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, | 386 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, |
| 386 content::NotificationService::AllSources()); | 387 content::NotificationService::AllSources()); |
| 387 #if defined(ENABLE_THEMES) | 388 #if defined(ENABLE_THEMES) |
| 388 registrar_.Add( | 389 registrar_.Add( |
| 389 this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, | 390 this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED, |
| (...skipping 1522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1912 break; | 1913 break; |
| 1913 } | 1914 } |
| 1914 | 1915 |
| 1915 case chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED: { | 1916 case chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED: { |
| 1916 Profile* profile = content::Source<Profile>(source).ptr(); | 1917 Profile* profile = content::Source<Profile>(source).ptr(); |
| 1917 if (profile_->IsSameProfile(profile) && window()->GetLocationBar()) | 1918 if (profile_->IsSameProfile(profile) && window()->GetLocationBar()) |
| 1918 window()->GetLocationBar()->InvalidatePageActions(); | 1919 window()->GetLocationBar()->InvalidatePageActions(); |
| 1919 break; | 1920 break; |
| 1920 } | 1921 } |
| 1921 | 1922 |
| 1922 case chrome::NOTIFICATION_EXTENSION_LOADED: | 1923 case chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED: |
| 1923 chrome::UpdateCommandEnabled( | 1924 chrome::UpdateCommandEnabled( |
| 1924 this, | 1925 this, |
| 1925 IDC_BOOKMARK_PAGE, | 1926 IDC_BOOKMARK_PAGE, |
| 1926 !chrome::ShouldRemoveBookmarkThisPageUI(profile_)); | 1927 !chrome::ShouldRemoveBookmarkThisPageUI(profile_)); |
| 1927 chrome::UpdateCommandEnabled( | 1928 chrome::UpdateCommandEnabled( |
| 1928 this, | 1929 this, |
| 1929 IDC_BOOKMARK_ALL_TABS, | 1930 IDC_BOOKMARK_ALL_TABS, |
| 1930 !chrome::ShouldRemoveBookmarkOpenPagesUI(profile_)); | 1931 !chrome::ShouldRemoveBookmarkOpenPagesUI(profile_)); |
| 1931 // fallthrough | 1932 // fallthrough |
| 1932 case chrome::NOTIFICATION_EXTENSION_UNINSTALLED: | 1933 case chrome::NOTIFICATION_EXTENSION_UNINSTALLED: |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2410 if (contents && !allow_js_access) { | 2411 if (contents && !allow_js_access) { |
| 2411 contents->web_contents()->GetController().LoadURL( | 2412 contents->web_contents()->GetController().LoadURL( |
| 2412 target_url, | 2413 target_url, |
| 2413 content::Referrer(), | 2414 content::Referrer(), |
| 2414 content::PAGE_TRANSITION_LINK, | 2415 content::PAGE_TRANSITION_LINK, |
| 2415 std::string()); // No extra headers. | 2416 std::string()); // No extra headers. |
| 2416 } | 2417 } |
| 2417 | 2418 |
| 2418 return contents != NULL; | 2419 return contents != NULL; |
| 2419 } | 2420 } |
| OLD | NEW |