#include "chrome/browser/favicon/favicon_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_switches.h"
-#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/extension_icon_set.h"
-#include "chrome/common/extensions/incognito_handler.h"
#include "chrome/common/extensions/manifest_handlers/icons_handler.h"
#include "chrome/common/url_constants.h"
#include "components/user_prefs/pref_registry_syncable.h"
#include "content/public/browser/web_ui.h"
#include "content/public/common/bindings_policy.h"
#include "content/public/common/page_transition_types.h"
+#include "extensions/common/extension.h"
#include "extensions/common/extension_resource.h"
+#include "extensions/common/manifest_handlers/incognito_info.h"
#include "net/base/file_stream.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/codec/png_codec.h"
// Reloads the page in |web_contents| if it uses the same profile as |profile|
// and if the current URL is a chrome URL.
-void UnregisterAndReplaceOverrideForWebContents(
- const std::string& page, Profile* profile, WebContents* web_contents) {
+void UnregisterAndReplaceOverrideForWebContents(const std::string& page,
+ Profile* profile,
+ WebContents* web_contents) {
if (Profile::FromBrowserContext(web_contents->GetBrowserContext()) != profile)
return;
GURL url = web_contents->GetURL();
- if (!url.SchemeIs(chrome::kChromeUIScheme) || url.host() != page)
+ if (!url.SchemeIs(content::kChromeUIScheme) || url.host() != page)
return;
// Don't use Reload() since |url| isn't the same as the internal URL that
// NavigationController has.
web_contents->GetController().LoadURL(
- url, content::Referrer(url, WebKit::WebReferrerPolicyDefault),
+ url, content::Referrer(url, blink::WebReferrerPolicyDefault),
content::PAGE_TRANSITION_RELOAD, std::string());
}
// those (this is also reflected in ChromeWebUIControllerFactory::
// UseWebUIBindingsForURL).
int bindings = 0;
-
- // Bind externalHost to Extension WebUI loaded in Chrome Frame.
- const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
- if (browser_command_line.HasSwitch(switches::kChromeFrame))
- bindings |= content::BINDINGS_POLICY_EXTERNAL_HOST;
web_ui->SetBindings(bindings);
// Hack: A few things we specialize just for the bookmark manager.
// static
bool ExtensionWebUI::HandleChromeURLOverride(
- GURL* url, content::BrowserContext* browser_context) {
- if (!url->SchemeIs(chrome::kChromeUIScheme))
+ GURL* url,
+ content::BrowserContext* browser_context) {
+ if (!url->SchemeIs(content::kChromeUIScheme))
return false;
Profile* profile = Profile::FromBrowserContext(browser_context);
size_t i = 0;
while (i < url_list->GetSize()) {
- const Value* val = NULL;
+ const base::Value* val = NULL;
url_list->Get(i, &val);
// Verify that the override value is good. If not, unregister it and find
// extension uses split mode.
bool incognito_override_allowed =
extensions::IncognitoInfo::IsSplitMode(extension) &&
- extension_util::IsIncognitoEnabled(extension->id(), service);
+ extensions::util::IsIncognitoEnabled(extension->id(), profile);
if (profile->IsOffTheRecord() && !incognito_override_allowed) {
++i;
continue;
if (!(*it2)->GetAsString(&override))
continue;
if (StartsWithASCII(url->spec(), override, true)) {
- GURL original_url(chrome::kChromeUIScheme + std::string("://") +
+ GURL original_url(content::kChromeUIScheme + std::string("://") +
it.key() + url->spec().substr(override.length()));
*url = original_url;
return true;
}
// Insert the override at the front of the list. Last registered override
// wins.
- page_overrides->Insert(0, new StringValue(iter->second.spec()));
+ page_overrides->Insert(0, new base::StringValue(iter->second.spec()));
}
}
void ExtensionWebUI::UnregisterAndReplaceOverride(const std::string& page,
Profile* profile,
base::ListValue* list,
- const Value* override) {
+ const base::Value* override) {
size_t index = 0;
bool found = list->Remove(*override, &index);
if (found && index == 0) {
// tabs for this override and get them to reload the original URL.
base::Callback<void(WebContents*)> callback =
base::Bind(&UnregisterAndReplaceOverrideForWebContents, page, profile);
- ExtensionTabUtil::ForEachTab(callback);
+ extensions::ExtensionTabUtil::ForEachTab(callback);
}
}
// static
void ExtensionWebUI::UnregisterChromeURLOverride(const std::string& page,
Profile* profile,
- const Value* override) {
+ const base::Value* override) {
if (!override)
return;
PrefService* prefs = profile->GetPrefs();
NOTREACHED();
continue;
} else {
- StringValue override(iter->second.spec());
+ base::StringValue override(iter->second.spec());
UnregisterAndReplaceOverride(iter->first, profile,
page_overrides, &override);
}