| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/extensions/extension_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 #include "chrome/browser/history/history_extension_api.h" | 69 #include "chrome/browser/history/history_extension_api.h" |
| 70 #include "chrome/browser/net/chrome_url_request_context.h" | 70 #include "chrome/browser/net/chrome_url_request_context.h" |
| 71 #include "chrome/browser/prefs/pref_service.h" | 71 #include "chrome/browser/prefs/pref_service.h" |
| 72 #include "chrome/browser/profiles/profile.h" | 72 #include "chrome/browser/profiles/profile.h" |
| 73 #include "chrome/browser/profiles/profile_manager.h" | 73 #include "chrome/browser/profiles/profile_manager.h" |
| 74 #include "chrome/browser/search_engines/template_url_service.h" | 74 #include "chrome/browser/search_engines/template_url_service.h" |
| 75 #include "chrome/browser/search_engines/template_url_service_factory.h" | 75 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 76 #include "chrome/browser/themes/theme_service.h" | 76 #include "chrome/browser/themes/theme_service.h" |
| 77 #include "chrome/browser/themes/theme_service_factory.h" | 77 #include "chrome/browser/themes/theme_service_factory.h" |
| 78 #include "chrome/browser/ui/browser.h" | 78 #include "chrome/browser/ui/browser.h" |
| 79 #include "chrome/browser/ui/browser_list.h" | 79 #include "chrome/browser/ui/browser_finder.h" |
| 80 #include "chrome/browser/ui/global_error_service.h" | 80 #include "chrome/browser/ui/global_error_service.h" |
| 81 #include "chrome/browser/ui/global_error_service_factory.h" | 81 #include "chrome/browser/ui/global_error_service_factory.h" |
| 82 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 82 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
| 83 #include "chrome/browser/ui/webui/favicon_source.h" | 83 #include "chrome/browser/ui/webui/favicon_source.h" |
| 84 #include "chrome/browser/ui/webui/ntp/thumbnail_source.h" | 84 #include "chrome/browser/ui/webui/ntp/thumbnail_source.h" |
| 85 #include "chrome/common/child_process_logging.h" | 85 #include "chrome/common/child_process_logging.h" |
| 86 #include "chrome/common/chrome_notification_types.h" | 86 #include "chrome/common/chrome_notification_types.h" |
| 87 #include "chrome/common/chrome_paths.h" | 87 #include "chrome/common/chrome_paths.h" |
| 88 #include "chrome/common/chrome_switches.h" | 88 #include "chrome/common/chrome_switches.h" |
| 89 #include "chrome/common/extensions/extension.h" | 89 #include "chrome/common/extensions/extension.h" |
| (...skipping 1686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1776 | 1776 |
| 1777 // Build up the lists of extensions that require acknowledgment. If this is | 1777 // Build up the lists of extensions that require acknowledgment. If this is |
| 1778 // the first time, grandfather extensions that would have caused | 1778 // the first time, grandfather extensions that would have caused |
| 1779 // notification. | 1779 // notification. |
| 1780 extension_global_error_.reset(new ExtensionGlobalError(this)); | 1780 extension_global_error_.reset(new ExtensionGlobalError(this)); |
| 1781 | 1781 |
| 1782 bool did_show_alert = false; | 1782 bool did_show_alert = false; |
| 1783 if (PopulateExtensionGlobalError(extension_global_error_.get())) { | 1783 if (PopulateExtensionGlobalError(extension_global_error_.get())) { |
| 1784 if (extension_prefs_->SetAlertSystemFirstRun()) { | 1784 if (extension_prefs_->SetAlertSystemFirstRun()) { |
| 1785 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1785 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 1786 Browser* browser = BrowserList::GetLastActiveWithProfile(profile_); | 1786 Browser* browser = browser::FindLastActiveWithProfile(profile_); |
| 1787 if (browser) { | 1787 if (browser) { |
| 1788 extension_global_error_->ShowBubbleView(browser); | 1788 extension_global_error_->ShowBubbleView(browser); |
| 1789 did_show_alert = true; | 1789 did_show_alert = true; |
| 1790 } | 1790 } |
| 1791 } else { | 1791 } else { |
| 1792 // First run. Just acknowledge all the extensions, silently, by | 1792 // First run. Just acknowledge all the extensions, silently, by |
| 1793 // shortcutting the display of the UI and going straight to the | 1793 // shortcutting the display of the UI and going straight to the |
| 1794 // callback for pressing the Accept button. | 1794 // callback for pressing the Accept button. |
| 1795 HandleExtensionAlertAccept(); | 1795 HandleExtensionAlertAccept(); |
| 1796 } | 1796 } |
| (...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2634 // To coexist with certain unit tests that don't have an IO thread message | 2634 // To coexist with certain unit tests that don't have an IO thread message |
| 2635 // loop available at ExtensionService shutdown, we lazy-initialize this | 2635 // loop available at ExtensionService shutdown, we lazy-initialize this |
| 2636 // object so that those cases neither create nor destroy an | 2636 // object so that those cases neither create nor destroy an |
| 2637 // APIResourceController. | 2637 // APIResourceController. |
| 2638 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 2638 CHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 2639 if (!api_resource_controller_) { | 2639 if (!api_resource_controller_) { |
| 2640 api_resource_controller_ = new extensions::APIResourceController(); | 2640 api_resource_controller_ = new extensions::APIResourceController(); |
| 2641 } | 2641 } |
| 2642 return api_resource_controller_; | 2642 return api_resource_controller_; |
| 2643 } | 2643 } |
| OLD | NEW |