| 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/ui/webui/uber/uber_ui.h" | 5 #include "chrome/browser/ui/webui/uber/uber_ui.h" |
| 6 | 6 |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/chrome_pages.h" |
| 10 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" | 11 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
| 11 #include "chrome/browser/ui/webui/extensions/extensions_ui.h" | 12 #include "chrome/browser/ui/webui/extensions/extensions_ui.h" |
| 12 #include "chrome/browser/ui/webui/log_web_ui_url.h" | 13 #include "chrome/browser/ui/webui/log_web_ui_url.h" |
| 13 #include "chrome/browser/ui/webui/options/options_ui.h" | 14 #include "chrome/browser/ui/webui/options/options_ui.h" |
| 14 #include "chrome/common/chrome_features.h" | 15 #include "chrome/common/chrome_features.h" |
| 15 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
| 16 #include "chrome/common/extensions/chrome_manifest_url_handlers.h" | 17 #include "chrome/common/extensions/chrome_manifest_url_handlers.h" |
| 17 #include "chrome/common/url_constants.h" | 18 #include "chrome/common/url_constants.h" |
| 18 #include "chrome/grit/chromium_strings.h" | 19 #include "chrome/grit/chromium_strings.h" |
| 19 #include "chrome/grit/generated_resources.h" | 20 #include "chrome/grit/generated_resources.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 50 // Hack alert: continue showing "Loading..." until a real title is set. | 51 // Hack alert: continue showing "Loading..." until a real title is set. |
| 51 source->AddLocalizedString("pageTitle", IDS_TAB_LOADING_TITLE); | 52 source->AddLocalizedString("pageTitle", IDS_TAB_LOADING_TITLE); |
| 52 | 53 |
| 53 source->AddString("extensionsFrameURL", chrome::kChromeUIExtensionsFrameURL); | 54 source->AddString("extensionsFrameURL", chrome::kChromeUIExtensionsFrameURL); |
| 54 source->AddString("extensionsHost", chrome::kChromeUIExtensionsHost); | 55 source->AddString("extensionsHost", chrome::kChromeUIExtensionsHost); |
| 55 source->AddString("helpFrameURL", chrome::kChromeUIHelpFrameURL); | 56 source->AddString("helpFrameURL", chrome::kChromeUIHelpFrameURL); |
| 56 source->AddString("helpHost", chrome::kChromeUIHelpHost); | 57 source->AddString("helpHost", chrome::kChromeUIHelpHost); |
| 57 source->AddString("historyFrameURL", chrome::kChromeUIHistoryFrameURL); | 58 source->AddString("historyFrameURL", chrome::kChromeUIHistoryFrameURL); |
| 58 source->AddString("historyHost", chrome::kChromeUIHistoryHost); | 59 source->AddString("historyHost", chrome::kChromeUIHistoryHost); |
| 59 source->AddString("settingsFrameURL", chrome::kChromeUISettingsFrameURL); | 60 source->AddString("settingsFrameURL", chrome::kChromeUISettingsFrameURL); |
| 60 source->AddString("settingsHost", chrome::kChromeUISettingsHost); | 61 source->AddString("settingsHost", chrome::GetLegacySettingsHost()); |
| 61 | 62 |
| 62 return source; | 63 return source; |
| 63 } | 64 } |
| 64 | 65 |
| 65 // Determines whether the user has an active extension of the given type. | 66 // Determines whether the user has an active extension of the given type. |
| 66 bool HasExtensionType(content::BrowserContext* browser_context, | 67 bool HasExtensionType(content::BrowserContext* browser_context, |
| 67 const std::string& extension_type) { | 68 const std::string& extension_type) { |
| 68 const extensions::ExtensionSet& extension_set = | 69 const extensions::ExtensionSet& extension_set = |
| 69 extensions::ExtensionRegistry::Get(browser_context)->enabled_extensions(); | 70 extensions::ExtensionRegistry::Get(browser_context)->enabled_extensions(); |
| 70 for (extensions::ExtensionSet::const_iterator iter = extension_set.begin(); | 71 for (extensions::ExtensionSet::const_iterator iter = extension_set.begin(); |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 // opens the default history page if one is uninstalled or disabled. | 242 // opens the default history page if one is uninstalled or disabled. |
| 242 UpdateHistoryNavigation(web_ui()); | 243 UpdateHistoryNavigation(web_ui()); |
| 243 } | 244 } |
| 244 | 245 |
| 245 void UberFrameUI::OnExtensionUnloaded( | 246 void UberFrameUI::OnExtensionUnloaded( |
| 246 content::BrowserContext* browser_context, | 247 content::BrowserContext* browser_context, |
| 247 const extensions::Extension* extension, | 248 const extensions::Extension* extension, |
| 248 extensions::UnloadedExtensionInfo::Reason reason) { | 249 extensions::UnloadedExtensionInfo::Reason reason) { |
| 249 UpdateHistoryNavigation(web_ui()); | 250 UpdateHistoryNavigation(web_ui()); |
| 250 } | 251 } |
| OLD | NEW |