Commit 60224b03 authored by tfarina@chromium.org's avatar tfarina@chromium.org

extension_utils: Remove old files and update DEPS whitelist.

BUG=125846
TBR=ben@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10832195

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150486 0039d316-1c4b-4281-b951-d872f2087c98
parent 1a77e63e
......@@ -3,7 +3,6 @@ include_rules = [
# TODO(tfarina): Remove all these. crbug.com/125846.
# DO NOT ADD ANY MORE ITEMS TO THE LIST BELOW!
"!chrome/browser/ui/views/ash/chrome_shell_delegate.h",
"!chrome/browser/ui/views/ash/extension_utils.h",
"!chrome/browser/ui/views/ash/launcher/chrome_launcher_controller.h",
"!chrome/browser/ui/views/ash/panel_view_aura.h",
"!chrome/browser/ui/views/find_bar_host.h",
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/views/ash/extension_utils.h"
#include "chrome/browser/event_disposition.h"
#include "chrome/browser/extensions/extension_prefs.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/extensions/application_launch.h"
#include "chrome/common/extensions/extension.h"
#include "googleurl/src/gurl.h"
namespace extension_utils {
// Opens an extension. |event_flags| holds the flags of the event
// which invokes this extension.
void OpenExtension(Profile* profile,
const extensions::Extension* extension,
int event_flags) {
DCHECK(profile);
DCHECK(extension);
WindowOpenDisposition disposition =
chrome::DispositionFromEventFlags(event_flags);
extension_misc::LaunchContainer container;
if (disposition == NEW_FOREGROUND_TAB || disposition == NEW_BACKGROUND_TAB) {
container = extension_misc::LAUNCH_TAB;
} else if (disposition == NEW_WINDOW) {
container = extension_misc::LAUNCH_WINDOW;
} else {
// Look at preference to find the right launch container. If no preference
// is set, launch as a regular tab.
container =
profile->GetExtensionService()->extension_prefs()->GetLaunchContainer(
extension, extensions::ExtensionPrefs::LAUNCH_DEFAULT);
disposition = NEW_FOREGROUND_TAB;
}
application_launch::OpenApplication(application_launch::LaunchParams(
profile, extension, container, disposition));
}
} // namespace extension_utils
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_VIEWS_ASH_EXTENSION_UTILS_H_
#define CHROME_BROWSER_UI_VIEWS_ASH_EXTENSION_UTILS_H_
class Profile;
namespace extensions {
class Extension;
}
namespace extension_utils {
// Opens an extension. |event_flags| holds the flags of the event
// which triggered this extension.
void OpenExtension(Profile* profile,
const extensions::Extension* extension,
int event_flags);
} // namespace extension_utils
#endif // CHROME_BROWSER_UI_VIEWS_ASH_EXTENSION_UTILS_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment