summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-27 15:29:39 +0000
committerasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-27 15:29:39 +0000
commit88cd06107c1280ad59ba96273e49ffdc7558c86c (patch)
treece6c10c55031f89680181cc69cbf1462247f5e24
parent35b149f40836c1d2dadafab6300730aa5c5d498f (diff)
downloadchromium_src-88cd06107c1280ad59ba96273e49ffdc7558c86c.zip
chromium_src-88cd06107c1280ad59ba96273e49ffdc7558c86c.tar.gz
chromium_src-88cd06107c1280ad59ba96273e49ffdc7558c86c.tar.bz2
Revert 208927 "Move ShellWindow into apps component."
broke build: ../../chrome/browser/ui/apps/chrome_shell_window_delegate.cc:7:31: fatal error: base/stringprintf.h: No such file or directory (I think it was moved to base/strings/stringprintf.h) > Move ShellWindow into apps component. > > This involves creating a new delegate type, ShellWindow::Delegate, which > is implemented in chrome. > > BUG=159366 > > Review URL: https://chromiumcodereview.appspot.com/16702003 TBR=benwells@chromium.org Review URL: https://codereview.chromium.org/18062007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208929 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--apps/DEPS7
-rw-r--r--apps/app_lifetime_monitor.cc2
-rw-r--r--apps/app_restore_service.cc2
-rw-r--r--apps/app_shim/extension_app_shim_handler_mac.cc2
-rw-r--r--apps/apps.gypi2
-rw-r--r--chrome/browser/chromeos/app_mode/app_session_lifetime.cc7
-rw-r--r--chrome/browser/extensions/DEPS5
-rw-r--r--chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.cc3
-rw-r--r--chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.h26
-rw-r--r--chrome/browser/extensions/api/app_window/app_window_api.cc13
-rw-r--r--chrome/browser/extensions/api/app_window/app_window_apitest.cc4
-rw-r--r--chrome/browser/extensions/api/developer_private/developer_private_api.cc3
-rw-r--r--chrome/browser/extensions/api/developer_private/entry_picker.cc2
-rw-r--r--chrome/browser/extensions/api/file_system/file_system_api.cc3
-rw-r--r--chrome/browser/extensions/api/identity/web_auth_flow.cc5
-rw-r--r--chrome/browser/extensions/api/identity/web_auth_flow.h9
-rw-r--r--chrome/browser/extensions/api/media_galleries/media_galleries_api.cc3
-rw-r--r--chrome/browser/extensions/api/tabs/ash_panel_contents.cc3
-rw-r--r--chrome/browser/extensions/api/tabs/ash_panel_contents.h12
-rw-r--r--chrome/browser/extensions/api/tabs/tabs_api.cc9
-rw-r--r--chrome/browser/extensions/app_window_contents.cc2
-rw-r--r--chrome/browser/extensions/app_window_contents.h12
-rw-r--r--chrome/browser/extensions/extension_tab_util.cc3
-rw-r--r--chrome/browser/extensions/platform_app_browsertest.cc3
-rw-r--r--chrome/browser/extensions/platform_app_browsertest_util.cc10
-rw-r--r--chrome/browser/extensions/platform_app_browsertest_util.h18
-rw-r--r--chrome/browser/extensions/shell_window_registry.cc6
-rw-r--r--chrome/browser/extensions/shell_window_registry.h38
-rw-r--r--chrome/browser/extensions/web_view_browsertest.cc2
-rw-r--r--chrome/browser/extensions/web_view_interactive_browsertest.cc6
-rw-r--r--chrome/browser/sessions/session_id.h2
-rw-r--r--chrome/browser/ui/apps/chrome_shell_window_delegate.cc156
-rw-r--r--chrome/browser/ui/apps/chrome_shell_window_delegate.h59
-rw-r--r--chrome/browser/ui/ash/chrome_shell_delegate.cc4
-rw-r--r--chrome/browser/ui/ash/chrome_shell_delegate_browsertest.cc3
-rw-r--r--chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc1
-rw-r--r--chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc3
-rw-r--r--chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_browsertest.cc3
-rw-r--r--chrome/browser/ui/ash/launcher/shell_window_launcher_controller.cc4
-rw-r--r--chrome/browser/ui/ash/launcher/shell_window_launcher_controller.h12
-rw-r--r--chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.cc4
-rw-r--r--chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.h15
-rw-r--r--chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc4
-rw-r--r--chrome/browser/ui/browser.cc1
-rw-r--r--chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.cc2
-rw-r--r--chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.h2
-rw-r--r--chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.h8
-rw-r--r--chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm2
-rw-r--r--chrome/browser/ui/extensions/apps_metro_handler_win.cc4
-rw-r--r--chrome/browser/ui/extensions/native_app_window.h9
-rw-r--r--chrome/browser/ui/extensions/shell_window.cc (renamed from apps/shell_window.cc)154
-rw-r--r--chrome/browser/ui/extensions/shell_window.h (renamed from apps/shell_window.h)66
-rw-r--r--chrome/browser/ui/gtk/extensions/native_app_window_gtk.cc2
-rw-r--r--chrome/browser/ui/gtk/extensions/native_app_window_gtk.h8
-rw-r--r--chrome/browser/ui/views/extensions/native_app_window_views.cc2
-rw-r--r--chrome/browser/ui/views/extensions/native_app_window_views.h14
-rw-r--r--chrome/browser/ui/views/select_file_dialog_extension.cc3
-rw-r--r--chrome/browser/ui/webui/extensions/extension_settings_handler.cc2
-rw-r--r--chrome/chrome_browser_ui.gypi4
59 files changed, 244 insertions, 531 deletions
diff --git a/apps/DEPS b/apps/DEPS
index d7900fdb..3a522f1 100644
--- a/apps/DEPS
+++ b/apps/DEPS
@@ -3,22 +3,17 @@ include_rules = [
"+content",
"+components/browser_context_keyed_service",
"+components/user_prefs/pref_registry_syncable.h",
- "+components/web_modal",
- "+extensions",
- "+skia/ext",
- "+third_party/skia/include",
"+ui",
"+win8",
# Temporary allowed includes.
# TODO(benwells): remove these (http://crbug.com/159366)
"+chrome/browser/browser_process.h",
"+chrome/browser/extensions",
- "+chrome/browser/lifetime/application_lifetime.h",
"+chrome/browser/profiles",
- "+chrome/browser/sessions/session_id.h",
"+chrome/browser/shell_integration.h",
"+chrome/browser/ui/extensions/application_launch.h",
"+chrome/browser/ui/extensions/native_app_window.h",
+ "+chrome/browser/ui/extensions/shell_window.h",
"+chrome/browser/ui/host_desktop.h",
"+chrome/browser/ui/web_applications/web_app_ui.h",
"+chrome/browser/web_applications/web_app.h",
diff --git a/apps/app_lifetime_monitor.cc b/apps/app_lifetime_monitor.cc
index c8c8235..6c2b9b9 100644
--- a/apps/app_lifetime_monitor.cc
+++ b/apps/app_lifetime_monitor.cc
@@ -4,8 +4,8 @@
#include "apps/app_lifetime_monitor.h"
-#include "apps/shell_window.h"
#include "chrome/browser/extensions/extension_host.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
#include "content/public/browser/notification_details.h"
diff --git a/apps/app_restore_service.cc b/apps/app_restore_service.cc
index d865fb2..210ccf3 100644
--- a/apps/app_restore_service.cc
+++ b/apps/app_restore_service.cc
@@ -7,14 +7,12 @@
#include "apps/app_lifetime_monitor_factory.h"
#include "apps/app_restore_service_factory.h"
#include "apps/saved_files_service.h"
-#include "apps/shell_window.h"
#include "chrome/browser/extensions/api/app_runtime/app_runtime_api.h"
#include "chrome/browser/extensions/extension_host.h"
#include "chrome/browser/extensions/extension_prefs.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/extensions/platform_app_launcher.h"
-#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_set.h"
diff --git a/apps/app_shim/extension_app_shim_handler_mac.cc b/apps/app_shim/extension_app_shim_handler_mac.cc
index c020fb6..eea475c 100644
--- a/apps/app_shim/extension_app_shim_handler_mac.cc
+++ b/apps/app_shim/extension_app_shim_handler_mac.cc
@@ -6,7 +6,6 @@
#include "apps/app_lifetime_monitor_factory.h"
#include "apps/app_shim/app_shim_messages.h"
-#include "apps/shell_window.h"
#include "base/files/file_path.h"
#include "base/logging.h"
#include "chrome/browser/browser_process.h"
@@ -18,6 +17,7 @@
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/extensions/application_launch.h"
#include "chrome/browser/ui/extensions/native_app_window.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/browser/ui/web_applications/web_app_ui.h"
#include "chrome/browser/web_applications/web_app_mac.h"
#include "chrome/common/chrome_notification_types.h"
diff --git a/apps/apps.gypi b/apps/apps.gypi
index 9ed738d..fd45772d 100644
--- a/apps/apps.gypi
+++ b/apps/apps.gypi
@@ -56,8 +56,6 @@
'saved_files_service.h',
'saved_files_service_factory.cc',
'saved_files_service_factory.h',
- 'shell_window.cc',
- 'shell_window.h',
'shell_window_geometry_cache.cc',
'shell_window_geometry_cache.h',
'shortcut_manager.cc',
diff --git a/chrome/browser/chromeos/app_mode/app_session_lifetime.cc b/chrome/browser/chromeos/app_mode/app_session_lifetime.cc
index 48514f0..3e4aadc 100644
--- a/chrome/browser/chromeos/app_mode/app_session_lifetime.cc
+++ b/chrome/browser/chromeos/app_mode/app_session_lifetime.cc
@@ -36,10 +36,9 @@ class AppWindowWatcher : public ShellWindowRegistry::Observer {
private:
// extensions::ShellWindowRegistry::Observer overrides:
- virtual void OnShellWindowAdded(apps::ShellWindow* shell_window) OVERRIDE {}
- virtual void OnShellWindowIconChanged(apps::ShellWindow* shell_window)
- OVERRIDE {}
- virtual void OnShellWindowRemoved(apps::ShellWindow* shell_window) OVERRIDE {
+ virtual void OnShellWindowAdded(ShellWindow* shell_window) OVERRIDE {}
+ virtual void OnShellWindowIconChanged(ShellWindow* shell_window) OVERRIDE {}
+ virtual void OnShellWindowRemoved(ShellWindow* shell_window) OVERRIDE {
if (window_registry_->shell_windows().empty()) {
chrome::AttemptUserExit();
window_registry_->RemoveObserver(this);
diff --git a/chrome/browser/extensions/DEPS b/chrome/browser/extensions/DEPS
index 05df41b..92be07f 100644
--- a/chrome/browser/extensions/DEPS
+++ b/chrome/browser/extensions/DEPS
@@ -1,10 +1,5 @@
include_rules = [
- # TODO(benwells): Once the extensions component is established
- # and there are only chrome specific extension things left in
- # chrome/browser/extensions, the restriction of not being able
- # to depend on apps will be lifted.
"-apps",
- "+apps/shell_window.h",
# TODO(tfarina): Remove all these. crbug.com/125846.
# DO NOT ADD ANY MORE ITEMS TO THE LIST BELOW!
diff --git a/chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.cc b/chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.cc
index 2f1b92b..c1912ea 100644
--- a/chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.cc
+++ b/chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.cc
@@ -4,15 +4,14 @@
#include "chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.h"
-#include "apps/shell_window.h"
#include "base/command_line.h"
#include "chrome/browser/extensions/shell_window_registry.h"
#include "chrome/browser/ui/extensions/native_app_window.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/api/app_current_window_internal.h"
#include "chrome/common/extensions/api/app_window.h"
-using apps::ShellWindow;
namespace SetBounds = extensions::api::app_current_window_internal::SetBounds;
using extensions::api::app_current_window_internal::Bounds;
namespace SetIcon = extensions::api::app_current_window_internal::SetIcon;
diff --git a/chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.h b/chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.h
index 806ae3b..110b5eb 100644
--- a/chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.h
+++ b/chrome/browser/extensions/api/app_current_window_internal/app_current_window_internal_api.h
@@ -7,9 +7,7 @@
#include "chrome/browser/extensions/extension_function.h"
-namespace apps {
class ShellWindow;
-}
namespace extensions {
@@ -18,7 +16,7 @@ class AppCurrentWindowInternalExtensionFunction : public SyncExtensionFunction {
virtual ~AppCurrentWindowInternalExtensionFunction() {}
// Invoked with the current shell window.
- virtual bool RunWithWindow(apps::ShellWindow* window) = 0;
+ virtual bool RunWithWindow(ShellWindow* window) = 0;
private:
virtual bool RunImpl() OVERRIDE;
@@ -32,7 +30,7 @@ class AppCurrentWindowInternalFocusFunction
protected:
virtual ~AppCurrentWindowInternalFocusFunction() {}
- virtual bool RunWithWindow(apps::ShellWindow* window) OVERRIDE;
+ virtual bool RunWithWindow(ShellWindow* window) OVERRIDE;
};
class AppCurrentWindowInternalFullscreenFunction
@@ -43,7 +41,7 @@ class AppCurrentWindowInternalFullscreenFunction
protected:
virtual ~AppCurrentWindowInternalFullscreenFunction() {}
- virtual bool RunWithWindow(apps::ShellWindow* window) OVERRIDE;
+ virtual bool RunWithWindow(ShellWindow* window) OVERRIDE;
};
class AppCurrentWindowInternalMaximizeFunction
@@ -54,7 +52,7 @@ class AppCurrentWindowInternalMaximizeFunction
protected:
virtual ~AppCurrentWindowInternalMaximizeFunction() {}
- virtual bool RunWithWindow(apps::ShellWindow* window) OVERRIDE;
+ virtual bool RunWithWindow(ShellWindow* window) OVERRIDE;
};
class AppCurrentWindowInternalMinimizeFunction
@@ -65,7 +63,7 @@ class AppCurrentWindowInternalMinimizeFunction
protected:
virtual ~AppCurrentWindowInternalMinimizeFunction() {}
- virtual bool RunWithWindow(apps::ShellWindow* window) OVERRIDE;
+ virtual bool RunWithWindow(ShellWindow* window) OVERRIDE;
};
class AppCurrentWindowInternalRestoreFunction
@@ -76,7 +74,7 @@ class AppCurrentWindowInternalRestoreFunction
protected:
virtual ~AppCurrentWindowInternalRestoreFunction() {}
- virtual bool RunWithWindow(apps::ShellWindow* window) OVERRIDE;
+ virtual bool RunWithWindow(ShellWindow* window) OVERRIDE;
};
class AppCurrentWindowInternalDrawAttentionFunction
@@ -87,7 +85,7 @@ class AppCurrentWindowInternalDrawAttentionFunction
protected:
virtual ~AppCurrentWindowInternalDrawAttentionFunction() {}
- virtual bool RunWithWindow(apps::ShellWindow* window) OVERRIDE;
+ virtual bool RunWithWindow(ShellWindow* window) OVERRIDE;
};
class AppCurrentWindowInternalClearAttentionFunction
@@ -98,7 +96,7 @@ class AppCurrentWindowInternalClearAttentionFunction
protected:
virtual ~AppCurrentWindowInternalClearAttentionFunction() {}
- virtual bool RunWithWindow(apps::ShellWindow* window) OVERRIDE;
+ virtual bool RunWithWindow(ShellWindow* window) OVERRIDE;
};
class AppCurrentWindowInternalShowFunction
@@ -109,7 +107,7 @@ class AppCurrentWindowInternalShowFunction
protected:
virtual ~AppCurrentWindowInternalShowFunction() {}
- virtual bool RunWithWindow(apps::ShellWindow* window) OVERRIDE;
+ virtual bool RunWithWindow(ShellWindow* window) OVERRIDE;
};
class AppCurrentWindowInternalHideFunction
@@ -120,7 +118,7 @@ class AppCurrentWindowInternalHideFunction
protected:
virtual ~AppCurrentWindowInternalHideFunction() {}
- virtual bool RunWithWindow(apps::ShellWindow* window) OVERRIDE;
+ virtual bool RunWithWindow(ShellWindow* window) OVERRIDE;
};
class AppCurrentWindowInternalSetBoundsFunction
@@ -130,7 +128,7 @@ class AppCurrentWindowInternalSetBoundsFunction
APP_CURRENTWINDOWINTERNAL_SETBOUNDS)
protected:
virtual ~AppCurrentWindowInternalSetBoundsFunction() {}
- virtual bool RunWithWindow(apps::ShellWindow* window) OVERRIDE;
+ virtual bool RunWithWindow(ShellWindow* window) OVERRIDE;
};
class AppCurrentWindowInternalSetIconFunction
@@ -141,7 +139,7 @@ class AppCurrentWindowInternalSetIconFunction
protected:
virtual ~AppCurrentWindowInternalSetIconFunction() {}
- virtual bool RunWithWindow(apps::ShellWindow* window) OVERRIDE;
+ virtual bool RunWithWindow(ShellWindow* window) OVERRIDE;
};
} // namespace extensions
diff --git a/chrome/browser/extensions/api/app_window/app_window_api.cc b/chrome/browser/extensions/api/app_window/app_window_api.cc
index 7283c94..74a004f 100644
--- a/chrome/browser/extensions/api/app_window/app_window_api.cc
+++ b/chrome/browser/extensions/api/app_window/app_window_api.cc
@@ -4,7 +4,6 @@
#include "chrome/browser/extensions/api/app_window/app_window_api.h"
-#include "apps/shell_window.h"
#include "base/command_line.h"
#include "base/time.h"
#include "base/values.h"
@@ -13,8 +12,8 @@
#include "chrome/browser/devtools/devtools_window.h"
#include "chrome/browser/extensions/shell_window_registry.h"
#include "chrome/browser/extensions/window_controller.h"
-#include "chrome/browser/ui/apps/chrome_shell_window_delegate.h"
#include "chrome/browser/ui/extensions/native_app_window.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/api/app_window.h"
#include "content/public/browser/notification_registrar.h"
@@ -34,8 +33,6 @@
#include "ui/aura/window.h"
#endif
-using apps::ShellWindow;
-
namespace app_window = extensions::api::app_window;
namespace Create = app_window::Create;
@@ -292,12 +289,8 @@ bool AppWindowCreateFunction::RunImpl() {
if (force_maximize)
create_params.state = ui::SHOW_STATE_MAXIMIZED;
- ShellWindow* shell_window = ShellWindow::Create(
- profile(),
- new chrome::ChromeShellWindowDelegate(),
- GetExtension(),
- url,
- create_params);
+ ShellWindow* shell_window =
+ ShellWindow::Create(profile(), GetExtension(), url, create_params);
if (chrome::ShouldForceFullscreenApp())
shell_window->Fullscreen();
diff --git a/chrome/browser/extensions/api/app_window/app_window_apitest.cc b/chrome/browser/extensions/api/app_window/app_window_apitest.cc
index 31eeaf7..a7acfc3 100644
--- a/chrome/browser/extensions/api/app_window/app_window_apitest.cc
+++ b/chrome/browser/extensions/api/app_window/app_window_apitest.cc
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "apps/shell_window.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "chrome/browser/extensions/extension_test_message_listener.h"
@@ -10,6 +9,7 @@
#include "chrome/browser/extensions/shell_window_registry.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/extensions/native_app_window.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/test/base/testing_profile.h"
#include "ui/base/base_window.h"
#include "ui/gfx/rect.h"
@@ -18,8 +18,6 @@
#include "content/public/test/test_utils.h"
#endif
-using apps::ShellWindow;
-
namespace {
class TestShellWindowRegistryObserver
diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.cc b/chrome/browser/extensions/api/developer_private/developer_private_api.cc
index c54017b..0a72d79 100644
--- a/chrome/browser/extensions/api/developer_private/developer_private_api.cc
+++ b/chrome/browser/extensions/api/developer_private/developer_private_api.cc
@@ -7,7 +7,6 @@
#include "apps/app_load_service.h"
#include "apps/app_restore_service.h"
#include "apps/saved_files_service.h"
-#include "apps/shell_window.h"
#include "base/base64.h"
#include "base/command_line.h"
#include "base/file_util.h"
@@ -33,6 +32,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync_file_system/drive_file_sync_service.h"
#include "chrome/browser/ui/chrome_select_file_policy.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/browser/ui/webui/extensions/extension_icon_source.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
@@ -65,7 +65,6 @@
#include "webkit/browser/fileapi/syncable/syncable_file_system_util.h"
#include "webkit/common/blob/shareable_file_reference.h"
-using apps::ShellWindow;
using content::RenderViewHost;
namespace extensions {
diff --git a/chrome/browser/extensions/api/developer_private/entry_picker.cc b/chrome/browser/extensions/api/developer_private/entry_picker.cc
index 91bc1f3..e70ae4a 100644
--- a/chrome/browser/extensions/api/developer_private/entry_picker.cc
+++ b/chrome/browser/extensions/api/developer_private/entry_picker.cc
@@ -8,8 +8,10 @@
#include "base/files/file_path.h"
#include "base/strings/string_util.h"
#include "chrome/browser/extensions/api/developer_private/developer_private_api.h"
+#include "chrome/browser/extensions/shell_window_registry.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/ui/chrome_select_file_policy.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
#include "ui/shell_dialogs/select_file_dialog.h"
diff --git a/chrome/browser/extensions/api/file_system/file_system_api.cc b/chrome/browser/extensions/api/file_system/file_system_api.cc
index 11234a6..c0241cf 100644
--- a/chrome/browser/extensions/api/file_system/file_system_api.cc
+++ b/chrome/browser/extensions/api/file_system/file_system_api.cc
@@ -5,7 +5,6 @@
#include "chrome/browser/extensions/api/file_system/file_system_api.h"
#include "apps/saved_files_service.h"
-#include "apps/shell_window.h"
#include "base/bind.h"
#include "base/file_util.h"
#include "base/files/file_path.h"
@@ -20,6 +19,7 @@
#include "chrome/browser/extensions/shell_window_registry.h"
#include "chrome/browser/platform_util.h"
#include "chrome/browser/ui/chrome_select_file_policy.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/extensions/api/file_system.h"
#include "chrome/common/extensions/permissions/api_permission.h"
@@ -50,7 +50,6 @@
using apps::SavedFileEntry;
using apps::SavedFilesService;
-using apps::ShellWindow;
using fileapi::IsolatedContext;
const char kInvalidParameters[] = "Invalid parameters";
diff --git a/chrome/browser/extensions/api/identity/web_auth_flow.cc b/chrome/browser/extensions/api/identity/web_auth_flow.cc
index 4a8f2ad..84fa56b 100644
--- a/chrome/browser/extensions/api/identity/web_auth_flow.cc
+++ b/chrome/browser/extensions/api/identity/web_auth_flow.cc
@@ -4,7 +4,6 @@
#include "chrome/browser/extensions/api/identity/web_auth_flow.h"
-#include "apps/shell_window.h"
#include "base/base64.h"
#include "base/location.h"
#include "base/message_loop.h"
@@ -16,6 +15,7 @@
#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/common/extensions/extension_constants.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/navigation_entry.h"
@@ -30,7 +30,6 @@
#include "googleurl/src/gurl.h"
#include "grit/browser_resources.h"
-using apps::ShellWindow;
using content::RenderViewHost;
using content::ResourceRedirectDetails;
using content::WebContents;
@@ -125,8 +124,6 @@ void WebAuthFlow::OnShellWindowAdded(ShellWindow* shell_window) {
}
}
-void WebAuthFlow::OnShellWindowIconChanged(ShellWindow* shell_window) {}
-
void WebAuthFlow::OnShellWindowRemoved(ShellWindow* shell_window) {
if (shell_window->window_key() == shell_window_key_ &&
shell_window->extension()->id() == extension_misc::kIdentityApiUiAppId) {
diff --git a/chrome/browser/extensions/api/identity/web_auth_flow.h b/chrome/browser/extensions/api/identity/web_auth_flow.h
index cbe42c6..df6c0f9 100644
--- a/chrome/browser/extensions/api/identity/web_auth_flow.h
+++ b/chrome/browser/extensions/api/identity/web_auth_flow.h
@@ -92,10 +92,9 @@ class WebAuthFlow : public content::NotificationObserver,
friend class ::WebAuthFlowTest;
// ShellWindowRegistry::Observer implementation.
- virtual void OnShellWindowAdded(apps::ShellWindow* shell_window) OVERRIDE;
- virtual void OnShellWindowIconChanged(apps::ShellWindow* shell_window)
- OVERRIDE;
- virtual void OnShellWindowRemoved(apps::ShellWindow* shell_window) OVERRIDE;
+ virtual void OnShellWindowAdded(ShellWindow* shell_window) OVERRIDE;
+ virtual void OnShellWindowIconChanged(ShellWindow* shell_window) OVERRIDE {}
+ virtual void OnShellWindowRemoved(ShellWindow* shell_window) OVERRIDE;
// NotificationObserver implementation.
virtual void Observe(int type,
@@ -133,7 +132,7 @@ class WebAuthFlow : public content::NotificationObserver,
GURL provider_url_;
Mode mode_;
- apps::ShellWindow* shell_window_;
+ ShellWindow* shell_window_;
std::string shell_window_key_;
bool embedded_window_created_;
diff --git a/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc b/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc
index 49d55f0..ec33b45 100644
--- a/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc
+++ b/chrome/browser/extensions/api/media_galleries/media_galleries_api.cc
@@ -10,7 +10,6 @@
#include <string>
#include <vector>
-#include "apps/shell_window.h"
#include "base/memory/scoped_ptr.h"
#include "base/platform_file.h"
#include "base/stl_util.h"
@@ -22,6 +21,7 @@
#include "chrome/browser/media_galleries/media_galleries_dialog_controller.h"
#include "chrome/browser/storage_monitor/storage_monitor.h"
#include "chrome/browser/ui/chrome_select_file_policy.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/common/extensions/api/experimental_media_galleries.h"
#include "chrome/common/extensions/api/media_galleries.h"
#include "chrome/common/extensions/extension.h"
@@ -39,7 +39,6 @@
#include "base/strings/sys_string_conversions.h"
#endif
-using apps::ShellWindow;
using chrome::MediaFileSystemInfo;
using chrome::MediaFileSystemRegistry;
using chrome::MediaFileSystemsCallback;
diff --git a/chrome/browser/extensions/api/tabs/ash_panel_contents.cc b/chrome/browser/extensions/api/tabs/ash_panel_contents.cc
index 27b7d5e..37f7a24 100644
--- a/chrome/browser/extensions/api/tabs/ash_panel_contents.cc
+++ b/chrome/browser/extensions/api/tabs/ash_panel_contents.cc
@@ -13,6 +13,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sessions/session_tab_helper.h"
#include "chrome/browser/ui/extensions/native_app_window.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_messages.h"
@@ -20,8 +21,6 @@
#include "content/public/browser/web_contents.h"
#include "ui/gfx/image/image.h"
-using apps::ShellWindow;
-
// AshPanelWindowController ----------------------------------------------------
// This class enables a ShellWindow instance to be accessed (to a limited
diff --git a/chrome/browser/extensions/api/tabs/ash_panel_contents.h b/chrome/browser/extensions/api/tabs/ash_panel_contents.h
index 4f79971..5aa0c46 100644
--- a/chrome/browser/extensions/api/tabs/ash_panel_contents.h
+++ b/chrome/browser/extensions/api/tabs/ash_panel_contents.h
@@ -7,11 +7,11 @@
#include <vector>
-#include "apps/shell_window.h"
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/extensions/extension_function_dispatcher.h"
#include "chrome/browser/ui/ash/launcher/launcher_favicon_loader.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "content/public/browser/web_contents_observer.h"
class AshPanelWindowController;
@@ -25,20 +25,20 @@ namespace extensions {
struct DraggableRegion;
}
-// apps::ShellWindowContents class specific to panel windows created by v1
+// ShellWindowContents class specific to panel windows created by v1
// extenstions. This class maintains a WebContents instance and observes it for
// the purpose of passing messages to the extensions system. It also creates
// an extensions::WindowController instance for interfacing with the v1
// extensions API.
-class AshPanelContents : public apps::ShellWindowContents,
+class AshPanelContents : public ShellWindowContents,
public content::WebContentsObserver,
public LauncherFaviconLoader::Delegate,
public ExtensionFunctionDispatcher::Delegate {
public:
- explicit AshPanelContents(apps::ShellWindow* host);
+ explicit AshPanelContents(ShellWindow* host);
virtual ~AshPanelContents();
- // apps::ShellWindowContents
+ // ShellWindowContents
virtual void Initialize(Profile* profile, const GURL& url) OVERRIDE;
virtual void LoadContents(int32 creator_process_id) OVERRIDE;
virtual void NativeWindowChanged(NativeAppWindow* native_app_window) OVERRIDE;
@@ -63,7 +63,7 @@ class AshPanelContents : public apps::ShellWindowContents,
void OnRequest(const ExtensionHostMsg_Request_Params& params);
- apps::ShellWindow* host_;
+ ShellWindow* host_;
GURL url_;
scoped_ptr<content::WebContents> web_contents_;
scoped_ptr<ExtensionFunctionDispatcher> extension_function_dispatcher_;
diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc
index 1a7027e..911ba62 100644
--- a/chrome/browser/extensions/api/tabs/tabs_api.cc
+++ b/chrome/browser/extensions/api/tabs/tabs_api.cc
@@ -8,7 +8,6 @@
#include <limits>
#include <vector>
-#include "apps/shell_window.h"
#include "base/base64.h"
#include "base/bind.h"
#include "base/command_line.h"
@@ -35,7 +34,6 @@
#include "chrome/browser/prefs/incognito_mode_prefs.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/translate/translate_tab_helper.h"
-#include "chrome/browser/ui/apps/chrome_shell_window_delegate.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_finder.h"
@@ -43,6 +41,7 @@
#include "chrome/browser/ui/browser_navigator.h"
#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/browser/ui/host_desktop.h"
#include "chrome/browser/ui/panels/panel_manager.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
@@ -98,7 +97,6 @@
#include "chrome/browser/extensions/shell_window_registry.h"
#endif
-using apps::ShellWindow;
using content::BrowserThread;
using content::NavigationController;
using content::NavigationEntry;
@@ -587,9 +585,8 @@ bool WindowsCreateFunction::RunImpl() {
create_params.window_type = ShellWindow::WINDOW_TYPE_V1_PANEL;
create_params.bounds = window_bounds;
create_params.focused = saw_focus_key && focused;
- ShellWindow* shell_window = new ShellWindow(
- window_profile, new chrome::ChromeShellWindowDelegate(),
- GetExtension());
+ ShellWindow* shell_window =
+ new ShellWindow(window_profile, GetExtension());
AshPanelContents* ash_panel_contents = new AshPanelContents(shell_window);
shell_window->Init(urls[0], ash_panel_contents, create_params);
SetResult(ash_panel_contents->GetExtensionWindowController()->
diff --git a/chrome/browser/extensions/app_window_contents.cc b/chrome/browser/extensions/app_window_contents.cc
index 5c6ff07..8a92b25 100644
--- a/chrome/browser/extensions/app_window_contents.cc
+++ b/chrome/browser/extensions/app_window_contents.cc
@@ -21,8 +21,6 @@
namespace app_window = extensions::api::app_window;
-using apps::ShellWindow;
-
AppWindowContents::AppWindowContents(ShellWindow* host)
: host_(host) {
}
diff --git a/chrome/browser/extensions/app_window_contents.h b/chrome/browser/extensions/app_window_contents.h
index bb37787..3cf2a32 100644
--- a/chrome/browser/extensions/app_window_contents.h
+++ b/chrome/browser/extensions/app_window_contents.h
@@ -7,10 +7,10 @@
#include <vector>
-#include "apps/shell_window.h"
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/extensions/extension_function_dispatcher.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/web_contents_observer.h"
@@ -24,18 +24,18 @@ namespace extensions {
struct DraggableRegion;
}
-// apps::ShellWindowContents class specific to app windows. It maintains a
+// ShellWindowContents class specific to app windows. It maintains a
// WebContents instance and observes it for the purpose of passing
// messages to the extensions system.
-class AppWindowContents : public apps::ShellWindowContents,
+class AppWindowContents : public ShellWindowContents,
public content::NotificationObserver,
public content::WebContentsObserver,
public ExtensionFunctionDispatcher::Delegate {
public:
- explicit AppWindowContents(apps::ShellWindow* host);
+ explicit AppWindowContents(ShellWindow* host);
virtual ~AppWindowContents();
- // apps::ShellWindowContents
+ // ShellWindowContents
virtual void Initialize(Profile* profile, const GURL& url) OVERRIDE;
virtual void LoadContents(int32 creator_process_id) OVERRIDE;
virtual void NativeWindowChanged(NativeAppWindow* native_app_window) OVERRIDE;
@@ -61,7 +61,7 @@ class AppWindowContents : public apps::ShellWindowContents,
const std::vector<extensions::DraggableRegion>& regions);
void SuspendRenderViewHost(content::RenderViewHost* rvh);
- apps::ShellWindow* host_; // This class is owned by |host_|
+ ShellWindow* host_; // This class is owned by |host_|
GURL url_;
content::NotificationRegistrar registrar_;
scoped_ptr<content::WebContents> web_contents_;
diff --git a/chrome/browser/extensions/extension_tab_util.cc b/chrome/browser/extensions/extension_tab_util.cc
index e8e50b0..02985e0 100644
--- a/chrome/browser/extensions/extension_tab_util.cc
+++ b/chrome/browser/extensions/extension_tab_util.cc
@@ -4,7 +4,6 @@
#include "chrome/browser/extensions/extension_tab_util.h"
-#include "apps/shell_window.h"
#include "chrome/browser/extensions/api/tabs/tabs_constants.h"
#include "chrome/browser/extensions/shell_window_registry.h"
#include "chrome/browser/extensions/tab_helper.h"
@@ -17,6 +16,7 @@
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_iterator.h"
#include "chrome/browser/ui/browser_window.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/browser/ui/tab_contents/tab_contents_iterator.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/extensions/extension.h"
@@ -33,7 +33,6 @@
namespace keys = extensions::tabs_constants;
namespace tabs = extensions::api::tabs;
-using apps::ShellWindow;
using content::NavigationEntry;
using content::WebContents;
using extensions::APIPermission;
diff --git a/chrome/browser/extensions/platform_app_browsertest.cc b/chrome/browser/extensions/platform_app_browsertest.cc
index 28168bb..03b046c 100644
--- a/chrome/browser/extensions/platform_app_browsertest.cc
+++ b/chrome/browser/extensions/platform_app_browsertest.cc
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "apps/shell_window.h"
#include "base/bind.h"
#include "base/file_util.h"
#include "base/files/scoped_temp_dir.h"
@@ -30,6 +29,7 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/extensions/application_launch.h"
#include "chrome/browser/ui/extensions/native_app_window.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
@@ -45,7 +45,6 @@
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "googleurl/src/gurl.h"
-using apps::ShellWindow;
using content::WebContents;
using web_modal::WebContentsModalDialogManager;
diff --git a/chrome/browser/extensions/platform_app_browsertest_util.cc b/chrome/browser/extensions/platform_app_browsertest_util.cc
index 2d1cdd0..4fb285f 100644
--- a/chrome/browser/extensions/platform_app_browsertest_util.cc
+++ b/chrome/browser/extensions/platform_app_browsertest_util.cc
@@ -9,7 +9,6 @@
#include "chrome/browser/extensions/api/tabs/tabs_api.h"
#include "chrome/browser/extensions/extension_function_test_utils.h"
#include "chrome/browser/extensions/shell_window_registry.h"
-#include "chrome/browser/ui/apps/chrome_shell_window_delegate.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/extensions/application_launch.h"
#include "chrome/browser/ui/extensions/native_app_window.h"
@@ -17,7 +16,6 @@
#include "content/public/browser/notification_service.h"
#include "content/public/test/test_utils.h"
-using apps::ShellWindow;
using content::WebContents;
namespace utils = extension_function_test_utils;
@@ -25,7 +23,7 @@ namespace utils = extension_function_test_utils;
namespace extensions {
PlatformAppBrowserTest::PlatformAppBrowserTest() {
- chrome::ChromeShellWindowDelegate::DisableExternalOpenForTesting();
+ ShellWindow::DisableExternalOpenForTesting();
}
void PlatformAppBrowserTest::SetUpCommandLine(CommandLine* command_line) {
@@ -148,15 +146,13 @@ ShellWindow* PlatformAppBrowserTest::CreateShellWindow(
const Extension* extension) {
ShellWindow::CreateParams params;
return ShellWindow::Create(
- browser()->profile(), new chrome::ChromeShellWindowDelegate(),
- extension, GURL(std::string()), params);
+ browser()->profile(), extension, GURL(std::string()), params);
}
ShellWindow* PlatformAppBrowserTest::CreateShellWindowFromParams(
const Extension* extension, const ShellWindow::CreateParams& params) {
return ShellWindow::Create(
- browser()->profile(), new chrome::ChromeShellWindowDelegate(),
- extension, GURL(std::string()), params);
+ browser()->profile(), extension, GURL(std::string()), params);
}
void PlatformAppBrowserTest::CloseShellWindow(ShellWindow* window) {
diff --git a/chrome/browser/extensions/platform_app_browsertest_util.h b/chrome/browser/extensions/platform_app_browsertest_util.h
index 6cc179b..d6147c74 100644
--- a/chrome/browser/extensions/platform_app_browsertest_util.h
+++ b/chrome/browser/extensions/platform_app_browsertest_util.h
@@ -6,14 +6,15 @@
#define CHROME_BROWSER_EXTENSIONS_PLATFORM_APP_BROWSERTEST_UTIL_H_
-#include "apps/shell_window.h"
#include "chrome/browser/extensions/extension_apitest.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
namespace content {
class WebContents;
}
class CommandLine;
+class ShellWindow;
namespace extensions {
class Extension;
@@ -40,7 +41,7 @@ class PlatformAppBrowserTest : public ExtensionApiTest {
// Gets the first shell window that is found (most tests only deal with one
// platform app window, so this is good enough).
- apps::ShellWindow* GetFirstShellWindow();
+ ShellWindow* GetFirstShellWindow();
// Runs chrome.windows.getAll for the given extension and returns the number
// of windows that the function returns.
@@ -63,18 +64,17 @@ class PlatformAppBrowserTest : public ExtensionApiTest {
void SetCommandLineArg(const std::string& test_file);
// Creates an empty shell window for |extension|.
- apps::ShellWindow* CreateShellWindow(const Extension* extension);
+ ShellWindow* CreateShellWindow(const Extension* extension);
- apps::ShellWindow* CreateShellWindowFromParams(
- const Extension* extension,
- const apps::ShellWindow::CreateParams& params);
+ ShellWindow* CreateShellWindowFromParams(
+ const Extension* extension, const ShellWindow::CreateParams& params);
// Closes |window| and waits until it's gone.
- void CloseShellWindow(apps::ShellWindow* window);
+ void CloseShellWindow(ShellWindow* window);
// Call AdjustBoundsToBeVisibleOnScreen of |window|.
void CallAdjustBoundsToBeVisibleOnScreenForShellWindow(
- apps::ShellWindow* window,
+ ShellWindow* window,
const gfx::Rect& cached_bounds,
const gfx::Rect& cached_screen_bounds,
const gfx::Rect& current_screen_bounds,
@@ -87,6 +87,6 @@ class ExperimentalPlatformAppBrowserTest : public PlatformAppBrowserTest {
virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE;
};
-} // namespace extensions
+} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_PLATFORM_APP_BROWSERTEST_UTIL_H_
diff --git a/chrome/browser/extensions/shell_window_registry.cc b/chrome/browser/extensions/shell_window_registry.cc
index 38a8d38..4e4c02a 100644
--- a/chrome/browser/extensions/shell_window_registry.cc
+++ b/chrome/browser/extensions/shell_window_registry.cc
@@ -2,12 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "apps/shell_window.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/shell_window_registry.h"
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/extensions/native_app_window.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/common/extensions/extension.h"
#include "components/browser_context_keyed_service/browser_context_dependency_manager.h"
#include "content/public/browser/devtools_agent_host.h"
@@ -17,8 +17,6 @@
#include "content/public/browser/site_instance.h"
#include "content/public/browser/web_contents.h"
-using apps::ShellWindow;
-
namespace {
// Create a key that identifies a ShellWindow in a RenderViewHost across App
@@ -43,7 +41,7 @@ std::string GetWindowKeyForRenderViewHost(
return key;
}
-} // namespace
+}
namespace extensions {
diff --git a/chrome/browser/extensions/shell_window_registry.h b/chrome/browser/extensions/shell_window_registry.h
index da1072c..ba3dd76 100644
--- a/chrome/browser/extensions/shell_window_registry.h
+++ b/chrome/browser/extensions/shell_window_registry.h
@@ -16,10 +16,7 @@
#include "ui/gfx/native_widget_types.h"
class Profile;
-
-namespace apps {
class ShellWindow;
-}
namespace content {
class DevToolsAgentHost;
@@ -40,17 +37,17 @@ class ShellWindowRegistry : public BrowserContextKeyedService {
class Observer {
public:
// Called just after a shell window was added.
- virtual void OnShellWindowAdded(apps::ShellWindow* shell_window) = 0;
+ virtual void OnShellWindowAdded(ShellWindow* shell_window) = 0;
// Called when the window icon changes.
- virtual void OnShellWindowIconChanged(apps::ShellWindow* shell_window) = 0;
+ virtual void OnShellWindowIconChanged(ShellWindow* shell_window) = 0;
// Called just after a shell window was removed.
- virtual void OnShellWindowRemoved(apps::ShellWindow* shell_window) = 0;
+ virtual void OnShellWindowRemoved(ShellWindow* shell_window) = 0;
protected:
virtual ~Observer() {}
};
- typedef std::list<apps::ShellWindow*> ShellWindowList;
+ typedef std::list<ShellWindow*> ShellWindowList;
typedef ShellWindowList::const_iterator const_iterator;
typedef std::set<std::string> InspectedWindowSet;
@@ -61,11 +58,11 @@ class ShellWindowRegistry : public BrowserContextKeyedService {
// a convenience wrapper around ShellWindowRegistry::Factory::GetForProfile.
static ShellWindowRegistry* Get(Profile* profile);
- void AddShellWindow(apps::ShellWindow* shell_window);
- void ShellWindowIconChanged(apps::ShellWindow* shell_window);
+ void AddShellWindow(ShellWindow* shell_window);
+ void ShellWindowIconChanged(ShellWindow* shell_window);
// Called by |shell_window| when it is activated.
- void ShellWindowActivated(apps::ShellWindow* shell_window);
- void RemoveShellWindow(apps::ShellWindow* shell_window);
+ void ShellWindowActivated(ShellWindow* shell_window);
+ void RemoveShellWindow(ShellWindow* shell_window);
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
@@ -75,22 +72,19 @@ class ShellWindowRegistry : public BrowserContextKeyedService {
const ShellWindowList& shell_windows() const { return shell_windows_; }
// Helper functions to find shell windows with particular attributes.
- apps::ShellWindow* GetShellWindowForRenderViewHost(
+ ShellWindow* GetShellWindowForRenderViewHost(
content::RenderViewHost* render_view_host) const;
- apps::ShellWindow* GetShellWindowForNativeWindow(
- gfx::NativeWindow window) const;
+ ShellWindow* GetShellWindowForNativeWindow(gfx::NativeWindow window) const;
// Returns an app window for the given app, or NULL if no shell windows are
// open. If there is a window for the given app that is active, that one will
// be returned, otherwise an arbitrary window will be returned.
- apps::ShellWindow* GetCurrentShellWindowForApp(
- const std::string& app_id) const;
+ ShellWindow* GetCurrentShellWindowForApp(const std::string& app_id) const;
// Returns an app window for the given app and window key, or NULL if no shell
// window with the key are open. If there is a window for the given app and
// key that is active, that one will be returned, otherwise an arbitrary
// window will be returned.
- apps::ShellWindow* GetShellWindowForAppAndKey(
- const std::string& app_id,
- const std::string& window_key) const;
+ ShellWindow* GetShellWindowForAppAndKey(const std::string& app_id,
+ const std::string& window_key) const;
// Returns whether a ShellWindow's ID was last known to have a DevToolsAgent
// attached to it, which should be restored during a reload of a corresponding
@@ -98,7 +92,7 @@ class ShellWindowRegistry : public BrowserContextKeyedService {
bool HadDevToolsAttached(content::RenderViewHost* render_view_host) const;
// Returns the shell window for |window|, looking in all profiles.
- static apps::ShellWindow* GetShellWindowForNativeWindowAnyProfile(
+ static ShellWindow* GetShellWindowForNativeWindowAnyProfile(
gfx::NativeWindow window);
// Returns true if the number of shell windows registered across all profiles
@@ -132,11 +126,11 @@ class ShellWindowRegistry : public BrowserContextKeyedService {
private:
// Ensures the specified |shell_window| is included in |shell_windows_|.
// Otherwise adds |shell_window| to the back of |shell_windows_|.
- void AddShellWindowToList(apps::ShellWindow* shell_window);
+ void AddShellWindowToList(ShellWindow* shell_window);
// Bring |shell_window| to the front of |shell_windows_|. If it is not in the
// list, add it first.
- void BringToFront(apps::ShellWindow* shell_window);
+ void BringToFront(ShellWindow* shell_window);
Profile* profile_;
ShellWindowList shell_windows_;
diff --git a/chrome/browser/extensions/web_view_browsertest.cc b/chrome/browser/extensions/web_view_browsertest.cc
index 0553614..91c751d 100644
--- a/chrome/browser/extensions/web_view_browsertest.cc
+++ b/chrome/browser/extensions/web_view_browsertest.cc
@@ -1084,7 +1084,7 @@ IN_PROC_BROWSER_TEST_F(WebViewTest, TearDownTest) {
const extensions::Extension* extension =
LoadAndLaunchPlatformApp("web_view/teardown");
ASSERT_TRUE(first_loaded_listener.WaitUntilSatisfied());
- apps::ShellWindow* window = NULL;
+ ShellWindow* window = NULL;
if (!GetShellWindowCount())
window = CreateShellWindow(extension);
else
diff --git a/chrome/browser/extensions/web_view_interactive_browsertest.cc b/chrome/browser/extensions/web_view_interactive_browsertest.cc
index 69b5cbc..eb696e6 100644
--- a/chrome/browser/extensions/web_view_interactive_browsertest.cc
+++ b/chrome/browser/extensions/web_view_interactive_browsertest.cc
@@ -1,13 +1,13 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright (c) 2013 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 "apps/shell_window.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/extensions/extension_test_message_listener.h"
#include "chrome/browser/extensions/platform_app_browsertest_util.h"
#include "chrome/browser/extensions/shell_window_registry.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/test/base/interactive_test_utils.h"
#include "chrome/test/base/test_launcher_utils.h"
#include "chrome/test/base/ui_test_utils.h"
@@ -22,8 +22,6 @@
#include "ui/base/keycodes/keyboard_codes.h"
#include "ui/base/test/ui_controls.h"
-using apps::ShellWindow;
-
class WebViewInteractiveTest
: public extensions::PlatformAppBrowserTest {
public:
diff --git a/chrome/browser/sessions/session_id.h b/chrome/browser/sessions/session_id.h
index dd9d02d..f4d103b 100644
--- a/chrome/browser/sessions/session_id.h
+++ b/chrome/browser/sessions/session_id.h
@@ -7,6 +7,8 @@
#include "base/basictypes.h"
+class Browser;
+
namespace content {
class WebContents;
}
diff --git a/chrome/browser/ui/apps/chrome_shell_window_delegate.cc b/chrome/browser/ui/apps/chrome_shell_window_delegate.cc
deleted file mode 100644
index 25c1ffb..0000000
--- a/chrome/browser/ui/apps/chrome_shell_window_delegate.cc
+++ /dev/null
@@ -1,156 +0,0 @@
-// Copyright 2013 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/apps/chrome_shell_window_delegate.h"
-
-#include "base/stringprintf.h"
-#include "chrome/browser/favicon/favicon_tab_helper.h"
-#include "chrome/browser/file_select_helper.h"
-#include "chrome/browser/media/media_capture_devices_dispatcher.h"
-#include "chrome/browser/platform_util.h"
-#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_dialogs.h"
-#include "chrome/browser/ui/browser_finder.h"
-#include "chrome/browser/ui/browser_tabstrip.h"
-#include "chrome/browser/ui/browser_window.h"
-#include "chrome/common/render_messages.h"
-#include "content/public/browser/render_view_host.h"
-#include "content/public/browser/web_contents.h"
-#include "content/public/browser/web_contents_view.h"
-
-#if defined(USE_ASH)
-#include "ash/launcher/launcher_types.h"
-#endif
-
-namespace chrome {
-
-namespace {
-
-bool disable_external_open_for_testing_ = false;
-
-class ShellWindowLinkDelegate : public content::WebContentsDelegate {
- public:
- ShellWindowLinkDelegate();
-
- private:
- virtual content::WebContents* OpenURLFromTab(
- content::WebContents* source,
- const content::OpenURLParams& params) OVERRIDE;
-
- DISALLOW_COPY_AND_ASSIGN(ShellWindowLinkDelegate);
-};
-
-ShellWindowLinkDelegate::ShellWindowLinkDelegate() {}
-
-// TODO(rockot): Add a test that exercises this code. See
-// http://crbug.com/254260.
-content::WebContents* ShellWindowLinkDelegate::OpenURLFromTab(
- content::WebContents* source,
- const content::OpenURLParams& params) {
- platform_util::OpenExternal(params.url);
- delete source;
- return NULL;
-}
-
-} // namespace
-
-ChromeShellWindowDelegate::ChromeShellWindowDelegate() {}
-
-ChromeShellWindowDelegate::~ChromeShellWindowDelegate() {}
-
-void ChromeShellWindowDelegate::DisableExternalOpenForTesting() {
- disable_external_open_for_testing_ = true;
-}
-
-void ChromeShellWindowDelegate::InitWebContents(
- content::WebContents* web_contents) {
- FaviconTabHelper::CreateForWebContents(web_contents);
-}
-
-content::WebContents* ChromeShellWindowDelegate::OpenURLFromTab(
- Profile* profile,
- content::WebContents* source,
- const content::OpenURLParams& params) {
- // Force all links to open in a new tab, even if they were trying to open a
- // window.
- chrome::NavigateParams new_tab_params(
- static_cast<Browser*>(NULL), params.url, params.transition);
- new_tab_params.disposition = params.disposition == NEW_BACKGROUND_TAB ?
- params.disposition : NEW_FOREGROUND_TAB;
- new_tab_params.initiating_profile = profile;
- chrome::Navigate(&new_tab_params);
-
- return new_tab_params.target_contents;
-}
-
-void ChromeShellWindowDelegate::AddNewContents(
- Profile* profile,
- content::WebContents* new_contents,
- WindowOpenDisposition disposition,
- const gfx::Rect& initial_pos,
- bool user_gesture,
- bool* was_blocked) {
-#if defined(OS_MACOSX) || defined(OS_WIN) || \
- (defined(OS_LINUX) && !defined(OS_CHROMEOS))
- if (!disable_external_open_for_testing_) {
- new_contents->SetDelegate(new ShellWindowLinkDelegate());
- return;
- }
-#endif
- Browser* browser =
- chrome::FindOrCreateTabbedBrowser(profile, chrome::GetActiveDesktop());
- // Force all links to open in a new tab, even if they were trying to open a
- // new window.
- disposition =
- disposition == NEW_BACKGROUND_TAB ? disposition : NEW_FOREGROUND_TAB;
- chrome::AddWebContents(browser, NULL, new_contents, disposition, initial_pos,
- user_gesture, was_blocked);
-}
-
-content::ColorChooser* ChromeShellWindowDelegate::ShowColorChooser(
- content::WebContents* web_contents,
- SkColor initial_color) {
- return chrome::ShowColorChooser(web_contents, initial_color);
-}
-
-void ChromeShellWindowDelegate::RunFileChooser(
- content::WebContents* tab,
- const content::FileChooserParams& params) {
- FileSelectHelper::RunFileChooser(tab, params);
-}
-
-void ChromeShellWindowDelegate::RequestMediaAccessPermission(
- content::WebContents* web_contents,
- const content::MediaStreamRequest& request,
- const content::MediaResponseCallback& callback,
- const extensions::Extension* extension) {
- MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest(
- web_contents, request, callback, extension);
-}
-
-int ChromeShellWindowDelegate::PreferredIconSize() {
-#if defined(USE_ASH)
- return ash::kLauncherPreferredSize;
-#else
- return extension_misc::EXTENSION_ICON_SMALL;
-#endif
-}
-
-void ChromeShellWindowDelegate::SetWebContentsBlocked(
- content::WebContents* web_contents,
- bool blocked) {
- // RenderViewHost may be NULL during shutdown.
- content::RenderViewHost* host = web_contents->GetRenderViewHost();
- if (host) {
- host->Send(new ChromeViewMsg_SetVisuallyDeemphasized(
- host->GetRoutingID(), blocked));
- }
-}
-
-bool ChromeShellWindowDelegate::IsWebContentsVisible(
- content::WebContents* web_contents) {
- return platform_util::IsVisible(web_contents->GetView()->GetNativeView());
-}
-
-} // namespace chrome
diff --git a/chrome/browser/ui/apps/chrome_shell_window_delegate.h b/chrome/browser/ui/apps/chrome_shell_window_delegate.h
deleted file mode 100644
index 4bad8b2..0000000
--- a/chrome/browser/ui/apps/chrome_shell_window_delegate.h
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2013 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_APPS_CHROME_SHELL_WINDOW_DELEGATE_H_
-#define CHROME_BROWSER_UI_APPS_CHROME_SHELL_WINDOW_DELEGATE_H_
-
-#include "apps/shell_window.h"
-#include "chrome/browser/profiles/profile.h"
-#include "content/public/browser/web_contents.h"
-#include "content/public/browser/web_contents_delegate.h"
-#include "ui/base/window_open_disposition.h"
-#include "ui/gfx/rect.h"
-
-namespace chrome {
-
-class ChromeShellWindowDelegate : public apps::ShellWindow::Delegate {
- public:
- ChromeShellWindowDelegate();
- virtual ~ChromeShellWindowDelegate();
-
- static void DisableExternalOpenForTesting();
-
- private:
- // apps::ShellWindow::Delegate:
- virtual void InitWebContents(content::WebContents* web_contents) OVERRIDE;
- virtual content::WebContents* OpenURLFromTab(
- Profile* profile,
- content::WebContents* source,
- const content::OpenURLParams& params) OVERRIDE;
- virtual void AddNewContents(Profile* profile,
- content::WebContents* new_contents,
- WindowOpenDisposition disposition,
- const gfx::Rect& initial_pos,
- bool user_gesture,
- bool* was_blocked) OVERRIDE;
- virtual content::ColorChooser* ShowColorChooser(
- content::WebContents* web_contents,
- SkColor initial_color) OVERRIDE;
- virtual void RunFileChooser(
- content::WebContents* tab,
- const content::FileChooserParams& params) OVERRIDE;
- virtual void RequestMediaAccessPermission(
- content::WebContents* web_contents,
- const content::MediaStreamRequest& request,
- const content::MediaResponseCallback& callback,
- const extensions::Extension* extension) OVERRIDE;
- virtual int PreferredIconSize() OVERRIDE;
- virtual void SetWebContentsBlocked(content::WebContents* web_contents,
- bool blocked) OVERRIDE;
- virtual bool IsWebContentsVisible(
- content::WebContents* web_contents) OVERRIDE;
-
- DISALLOW_COPY_AND_ASSIGN(ChromeShellWindowDelegate);
-};
-
-} // namespace chrome
-
-#endif // CHROME_BROWSER_UI_APPS_CHROME_SHELL_WINDOW_DELEGATE_H_
diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.cc b/chrome/browser/ui/ash/chrome_shell_delegate.cc
index e00338f..a0a3f3d 100644
--- a/chrome/browser/ui/ash/chrome_shell_delegate.cc
+++ b/chrome/browser/ui/ash/chrome_shell_delegate.cc
@@ -4,7 +4,6 @@
#include "chrome/browser/ui/ash/chrome_shell_delegate.h"
-#include "apps/shell_window.h"
#include "ash/ash_switches.h"
#include "ash/host/root_window_host_factory.h"
#include "ash/launcher/launcher_types.h"
@@ -37,6 +36,7 @@
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/extensions/native_app_window.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/browser/ui/host_desktop.h"
#include "chrome/browser/ui/immersive_fullscreen_configuration.h"
#include "chrome/common/chrome_notification_types.h"
@@ -188,7 +188,7 @@ void ChromeShellDelegate::ToggleFullscreen() {
}
// |window| may belong to a shell window.
- apps::ShellWindow* shell_window = extensions::ShellWindowRegistry::
+ ShellWindow* shell_window = extensions::ShellWindowRegistry::
GetShellWindowForNativeWindowAnyProfile(window);
if (shell_window) {
if (is_fullscreen)
diff --git a/chrome/browser/ui/ash/chrome_shell_delegate_browsertest.cc b/chrome/browser/ui/ash/chrome_shell_delegate_browsertest.cc
index 66a8927..e7e43e2 100644
--- a/chrome/browser/ui/ash/chrome_shell_delegate_browsertest.cc
+++ b/chrome/browser/ui/ash/chrome_shell_delegate_browsertest.cc
@@ -4,7 +4,6 @@
#include "chrome/browser/ui/ash/chrome_shell_delegate.h"
-#include "apps/shell_window.h"
#include "ash/ash_switches.h"
#include "ash/shell.h"
#include "ash/shell_delegate.h"
@@ -174,7 +173,7 @@ IN_PROC_BROWSER_TEST_F(ChromeShellDelegatePlatformAppBrowserTest,
ASSERT_TRUE(shell_delegate);
const extensions::Extension* extension = LoadAndLaunchPlatformApp("minimal");
- apps::ShellWindow* shell_window = CreateShellWindow(extension);
+ ShellWindow* shell_window = CreateShellWindow(extension);
NativeAppWindow* app_window = shell_window->GetBaseWindow();
ASSERT_TRUE(shell_window->GetBaseWindow()->IsActive());
EXPECT_FALSE(app_window->IsMaximized());
diff --git a/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc b/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc
index 09becbb..f13d629 100644
--- a/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc
+++ b/chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc
@@ -29,6 +29,7 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/extensions/application_launch.h"
#include "chrome/browser/ui/extensions/native_app_window.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/browser/ui/webui/chrome_web_contents_handler.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/chrome_switches.h"
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc
index 8bcd379..e584338 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc
@@ -4,7 +4,6 @@
#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
-#include "apps/shell_window.h"
#include "ash/ash_switches.h"
#include "ash/launcher/launcher.h"
#include "ash/launcher/launcher_model.h"
@@ -30,6 +29,7 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/extensions/application_launch.h"
#include "chrome/browser/ui/extensions/native_app_window.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/browser/ui/host_desktop.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_notification_types.h"
@@ -43,7 +43,6 @@
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window.h"
-using apps::ShellWindow;
using extensions::Extension;
using content::WebContents;
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_browsertest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_browsertest.cc
index 621d225..b31c8a7 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_browsertest.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_browsertest.cc
@@ -4,7 +4,6 @@
#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
-#include "apps/shell_window.h"
#include "ash/ash_switches.h"
#include "ash/display/display_controller.h"
#include "ash/launcher/launcher.h"
@@ -36,6 +35,7 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/extensions/application_launch.h"
#include "chrome/browser/ui/extensions/native_app_window.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/browser/ui/host_desktop.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_notification_types.h"
@@ -51,7 +51,6 @@
#include "ui/aura/window.h"
#include "ui/base/events/event.h"
-using apps::ShellWindow;
using extensions::Extension;
using content::WebContents;
diff --git a/chrome/browser/ui/ash/launcher/shell_window_launcher_controller.cc b/chrome/browser/ui/ash/launcher/shell_window_launcher_controller.cc
index 779a8f9..ffad984 100644
--- a/chrome/browser/ui/ash/launcher/shell_window_launcher_controller.cc
+++ b/chrome/browser/ui/ash/launcher/shell_window_launcher_controller.cc
@@ -4,17 +4,15 @@
#include "chrome/browser/ui/ash/launcher/shell_window_launcher_controller.h"
-#include "apps/shell_window.h"
#include "ash/shell.h"
#include "ash/wm/window_util.h"
#include "base/stl_util.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
#include "chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "ui/aura/client/activation_client.h"
-using apps::ShellWindow;
-
namespace {
std::string GetAppLauncherId(ShellWindow* shell_window) {
diff --git a/chrome/browser/ui/ash/launcher/shell_window_launcher_controller.h b/chrome/browser/ui/ash/launcher/shell_window_launcher_controller.h
index c47c357..9c279f6 100644
--- a/chrome/browser/ui/ash/launcher/shell_window_launcher_controller.h
+++ b/chrome/browser/ui/ash/launcher/shell_window_launcher_controller.h
@@ -13,10 +13,6 @@
#include "ui/aura/client/activation_change_observer.h"
#include "ui/aura/window_observer.h"
-namespace apps {
-class ShellWindow;
-}
-
namespace aura {
class Window;
@@ -28,6 +24,7 @@ class ActivationClient;
}
class ChromeLauncherController;
+class ShellWindow;
class ShellWindowLauncherItemController;
// ShellWindowLauncherController observes the Shell Window registry and the
@@ -42,10 +39,9 @@ class ShellWindowLauncherController
virtual ~ShellWindowLauncherController();
// Overridden from ShellWindowRegistry::Observer:
- virtual void OnShellWindowAdded(apps::ShellWindow* shell_window) OVERRIDE;
- virtual void OnShellWindowIconChanged(
- apps::ShellWindow* shell_window) OVERRIDE;
- virtual void OnShellWindowRemoved(apps::ShellWindow* shell_window) OVERRIDE;
+ virtual void OnShellWindowAdded(ShellWindow* shell_window) OVERRIDE;
+ virtual void OnShellWindowIconChanged(ShellWindow* shell_window) OVERRIDE;
+ virtual void OnShellWindowRemoved(ShellWindow* shell_window) OVERRIDE;
// Overriden from aura::WindowObserver:
virtual void OnWindowDestroying(aura::Window* window) OVERRIDE;
diff --git a/chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.cc
index 703a8e5..276f899 100644
--- a/chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.cc
+++ b/chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.cc
@@ -4,7 +4,6 @@
#include "chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.h"
-#include "apps/shell_window.h"
#include "ash/wm/window_properties.h"
#include "ash/wm/window_util.h"
#include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h"
@@ -13,14 +12,13 @@
#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.h"
#include "chrome/browser/ui/ash/launcher/launcher_item_controller.h"
#include "chrome/browser/ui/extensions/native_app_window.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "content/public/browser/web_contents.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window.h"
#include "ui/base/events/event.h"
#include "ui/views/corewm/window_animations.h"
-using apps::ShellWindow;
-
namespace {
// Functor for std::find_if used in AppLauncherItemController.
diff --git a/chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.h b/chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.h
index acf4308..182ca98 100644
--- a/chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.h
+++ b/chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.h
@@ -13,10 +13,6 @@
#include "chrome/browser/ui/ash/launcher/launcher_item_controller.h"
#include "ui/aura/window_observer.h"
-namespace apps {
-class ShellWindow;
-}
-
namespace aura {
class Window;
}
@@ -26,6 +22,7 @@ class Image;
}
class ChromeLauncherController;
+class ShellWindow;
// This is a ShellWindowItemLauncherController for shell windows. There is one
// instance per app, per launcher id.
@@ -45,7 +42,7 @@ class ShellWindowLauncherItemController : public LauncherItemController,
virtual ~ShellWindowLauncherItemController();
- void AddShellWindow(apps::ShellWindow* shell_window,
+ void AddShellWindow(ShellWindow* shell_window,
ash::LauncherItemStatus status);
void RemoveShellWindowForWindow(aura::Window* window);
@@ -82,19 +79,19 @@ class ShellWindowLauncherItemController : public LauncherItemController,
void ActivateIndexedApp(size_t index);
private:
- typedef std::list<apps::ShellWindow*> ShellWindowList;
+ typedef std::list<ShellWindow*> ShellWindowList;
- void ShowAndActivateOrMinimize(apps::ShellWindow* shell_window);
+ void ShowAndActivateOrMinimize(ShellWindow* shell_window);
// Activate the given |window_to_show|, or - if already selected - advance to
// the next window of similar type.
- void ActivateOrAdvanceToNextShellWindow(apps::ShellWindow* window_to_show);
+ void ActivateOrAdvanceToNextShellWindow(ShellWindow* window_to_show);
// List of associated shell windows
ShellWindowList shell_windows_;
// Pointer to the most recently active shell window
- apps::ShellWindow* last_active_shell_window_;
+ ShellWindow* last_active_shell_window_;
// The launcher id associated with this set of windows. There is one
// AppLauncherItemController for each |app_launcher_id_|.
diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
index e8f7e2e..ca9444a 100644
--- a/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
+++ b/chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc
@@ -8,7 +8,6 @@
#include <map>
#include <string>
-#include "apps/shell_window.h"
#include "base/base64.h"
#include "base/bind.h"
#include "base/i18n/rtl.h"
@@ -31,6 +30,7 @@
#include "chrome/browser/ui/browser_navigator.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/extensions/native_app_window.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/common/chrome_version_info.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
@@ -225,7 +225,7 @@ ui::BaseWindow* GetBaseWindowForWebContents(
gfx::NativeWindow native_window =
web_contents->GetView()->GetTopLevelNativeWindow();
- apps::ShellWindow* shell_window =
+ ShellWindow* shell_window =
extensions::ShellWindowRegistry::
GetShellWindowForNativeWindowAnyProfile(native_window);
return shell_window->GetBaseWindow();
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 29d6050..aeb8983 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -107,6 +107,7 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/browser/ui/chrome_select_file_policy.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/browser/ui/find_bar/find_bar.h"
#include "chrome/browser/ui/find_bar/find_bar_controller.h"
#include "chrome/browser/ui/find_bar/find_tab_helper.h"
diff --git a/chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.cc b/chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.cc
index da6396e..7155008 100644
--- a/chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.cc
+++ b/chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.cc
@@ -1,4 +1,4 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright (c) 2013 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.
diff --git a/chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.h b/chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.h
index 749debc..2263d75 100644
--- a/chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.h
+++ b/chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.h
@@ -1,4 +1,4 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright (c) 2013 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.
diff --git a/chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.h b/chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.h
index 795dd6b..e32534e 100644
--- a/chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.h
+++ b/chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.h
@@ -8,11 +8,11 @@
#import <Cocoa/Cocoa.h>
#include <vector>
-#include "apps/shell_window.h"
#include "base/mac/scoped_nsobject.h"
#include "base/memory/scoped_ptr.h"
#import "chrome/browser/ui/cocoa/browser_command_executor.h"
#include "chrome/browser/ui/extensions/native_app_window.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "content/public/browser/notification_registrar.h"
#include "extensions/common/draggable_region.h"
#include "ui/gfx/rect.h"
@@ -43,8 +43,8 @@ class SkRegion;
// Cocoa bridge to AppWindow.
class NativeAppWindowCocoa : public NativeAppWindow {
public:
- NativeAppWindowCocoa(apps::ShellWindow* shell_window,
- const apps::ShellWindow::CreateParams& params);
+ NativeAppWindowCocoa(ShellWindow* shell_window,
+ const ShellWindow::CreateParams& params);
// ui::BaseWindow implementation.
virtual bool IsActive() const OVERRIDE;
@@ -147,7 +147,7 @@ class NativeAppWindowCocoa : public NativeAppWindow {
void UpdateDraggableRegionsForCustomDrag(
const std::vector<extensions::DraggableRegion>& regions);
- apps::ShellWindow* shell_window_; // weak - ShellWindow owns NativeAppWindow.
+ ShellWindow* shell_window_; // weak - ShellWindow owns NativeAppWindow.
bool has_frame_;
diff --git a/chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm b/chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm
index d6ee237..583f7e9 100644
--- a/chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm
+++ b/chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm
@@ -20,8 +20,6 @@
#include "content/public/browser/web_contents_view.h"
#include "third_party/skia/include/core/SkRegion.h"
-using apps::ShellWindow;
-
@interface NSWindow (NSPrivateApis)
- (void)setBottomCornerRounded:(BOOL)rounded;
@end
diff --git a/chrome/browser/ui/extensions/apps_metro_handler_win.cc b/chrome/browser/ui/extensions/apps_metro_handler_win.cc
index 0f253b2..125c8bf 100644
--- a/chrome/browser/ui/extensions/apps_metro_handler_win.cc
+++ b/chrome/browser/ui/extensions/apps_metro_handler_win.cc
@@ -4,8 +4,8 @@
#include "chrome/browser/ui/extensions/apps_metro_handler_win.h"
-#include "apps/shell_window.h"
#include "chrome/browser/extensions/shell_window_registry.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/browser/ui/simple_message_box.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -15,7 +15,7 @@ namespace chrome {
bool VerifySwitchToMetroForApps(gfx::NativeWindow parent_window) {
if (!extensions::ShellWindowRegistry::IsShellWindowRegisteredInAnyProfile(
- apps::ShellWindow::WINDOW_TYPE_DEFAULT)) {
+ ShellWindow::WINDOW_TYPE_DEFAULT)) {
return true;
}
diff --git a/chrome/browser/ui/extensions/native_app_window.h b/chrome/browser/ui/extensions/native_app_window.h
index 3e030f2..868b906 100644
--- a/chrome/browser/ui/extensions/native_app_window.h
+++ b/chrome/browser/ui/extensions/native_app_window.h
@@ -5,7 +5,7 @@
#ifndef CHROME_BROWSER_UI_EXTENSIONS_NATIVE_APP_WINDOW_H_
#define CHROME_BROWSER_UI_EXTENSIONS_NATIVE_APP_WINDOW_H_
-#include "apps/shell_window.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "components/web_modal/web_contents_modal_dialog_host.h"
#include "ui/base/base_window.h"
#include "ui/gfx/insets.h"
@@ -16,10 +16,9 @@
class NativeAppWindow : public ui::BaseWindow,
public web_modal::WebContentsModalDialogHost {
public:
- // Used by apps::ShellWindow to instantiate the platform-specific
- // apps::ShellWindow code.
- static NativeAppWindow* Create(apps::ShellWindow* window,
- const apps::ShellWindow::CreateParams& params);
+ // Used by ShellWindow to instantiate the platform-specific ShellWindow code.
+ static NativeAppWindow* Create(ShellWindow* window,
+ const ShellWindow::CreateParams& params);
// Called when the draggable regions are changed.
virtual void UpdateDraggableRegions(
diff --git a/apps/shell_window.cc b/chrome/browser/ui/extensions/shell_window.cc
index d3ba855..27e55b78 100644
--- a/apps/shell_window.cc
+++ b/chrome/browser/ui/extensions/shell_window.cc
@@ -1,11 +1,10 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// 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 "apps/shell_window.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "apps/shell_window_geometry_cache.h"
-#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/extensions/app_window_contents.h"
@@ -14,8 +13,18 @@
#include "chrome/browser/extensions/image_loader.h"
#include "chrome/browser/extensions/shell_window_registry.h"
#include "chrome/browser/extensions/suggest_permission_util.h"
+#include "chrome/browser/favicon/favicon_tab_helper.h"
+#include "chrome/browser/file_select_helper.h"
#include "chrome/browser/lifetime/application_lifetime.h"
+#include "chrome/browser/media/media_capture_devices_dispatcher.h"
+#include "chrome/browser/platform_util.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/sessions/session_id.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_dialogs.h"
+#include "chrome/browser/ui/browser_finder.h"
+#include "chrome/browser/ui/browser_tabstrip.h"
+#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/extensions/native_app_window.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/extensions/extension.h"
@@ -39,6 +48,10 @@
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/screen.h"
+#if defined(USE_ASH)
+#include "ash/launcher/launcher_types.h"
+#endif
+
using content::ConsoleMessageLevel;
using content::WebContents;
using extensions::APIPermission;
@@ -49,9 +62,31 @@ namespace {
const int kDefaultWidth = 512;
const int kDefaultHeight = 384;
-} // namespace
+// The preferred icon size for displaying the app icon.
+#if defined(USE_ASH)
+const int kPreferredIconSize = ash::kLauncherPreferredSize;
+#else
+const int kPreferredIconSize = extension_misc::EXTENSION_ICON_SMALL;
+#endif
+
+static bool disable_external_open_for_testing_ = false;
+
+class ShellWindowLinkDelegate : public content::WebContentsDelegate {
+ private:
+ virtual content::WebContents* OpenURLFromTab(
+ content::WebContents* source,
+ const content::OpenURLParams& params) OVERRIDE;
+};
+
+content::WebContents* ShellWindowLinkDelegate::OpenURLFromTab(
+ content::WebContents* source,
+ const content::OpenURLParams& params) {
+ platform_util::OpenExternal(params.url);
+ delete source;
+ return NULL;
+}
-namespace apps {
+} // namespace
ShellWindow::CreateParams::CreateParams()
: window_type(ShellWindow::WINDOW_TYPE_DEFAULT),
@@ -62,32 +97,29 @@ ShellWindow::CreateParams::CreateParams()
state(ui::SHOW_STATE_DEFAULT),
hidden(false),
resizable(true),
- focused(true) {}
-
-ShellWindow::CreateParams::~CreateParams() {}
+ focused(true) {
+}
-ShellWindow::Delegate::~Delegate() {}
+ShellWindow::CreateParams::~CreateParams() {
+}
ShellWindow* ShellWindow::Create(Profile* profile,
- Delegate* delegate,
const extensions::Extension* extension,
const GURL& url,
const CreateParams& params) {
// This object will delete itself when the window is closed.
- ShellWindow* window = new ShellWindow(profile, delegate, extension);
+ ShellWindow* window = new ShellWindow(profile, extension);
window->Init(url, new AppWindowContents(window), params);
extensions::ShellWindowRegistry::Get(profile)->AddShellWindow(window);
return window;
}
ShellWindow::ShellWindow(Profile* profile,
- Delegate* delegate,
const extensions::Extension* extension)
: profile_(profile),
extension_(extension),
extension_id_(extension->id()),
window_type_(WINDOW_TYPE_DEFAULT),
- delegate_(delegate),
image_loader_ptr_factory_(this),
fullscreen_for_window_api_(false),
fullscreen_for_tab_(false) {
@@ -100,8 +132,8 @@ void ShellWindow::Init(const GURL& url,
shell_window_contents_.reset(shell_window_contents);
shell_window_contents_->Initialize(profile(), url);
WebContents* web_contents = shell_window_contents_->GetWebContents();
- delegate_->InitWebContents(web_contents);
WebContentsModalDialogManager::CreateForWebContents(web_contents);
+ FaviconTabHelper::CreateForWebContents(web_contents);
web_contents->SetDelegate(this);
WebContentsModalDialogManager::FromWebContents(web_contents)->
@@ -125,7 +157,8 @@ void ShellWindow::Init(const GURL& url,
if (!params.window_key.empty()) {
window_key_ = params.window_key;
- ShellWindowGeometryCache* cache = ShellWindowGeometryCache::Get(profile());
+ apps::ShellWindowGeometryCache* cache =
+ apps::ShellWindowGeometryCache::Get(profile());
gfx::Rect cached_bounds;
gfx::Rect cached_screen_bounds;
@@ -201,7 +234,9 @@ void ShellWindow::Init(const GURL& url,
&web_contents->GetController()));
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
content::Source<Profile>(profile_));
- // Close when the browser process is exiting.
+ // Close when the browser is exiting.
+ // TODO(mihaip): we probably don't want this in the long run (when platform
+ // apps are no longer tied to the browser process).
registrar_.Add(this, chrome::NOTIFICATION_APP_TERMINATING,
content::NotificationService::AllSources());
@@ -226,8 +261,8 @@ void ShellWindow::RequestMediaAccessPermission(
content::WebContents* web_contents,
const content::MediaStreamRequest& request,
const content::MediaResponseCallback& callback) {
- delegate_->RequestMediaAccessPermission(web_contents, request, callback,
- extension());
+ MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest(
+ web_contents, request, callback, extension());
}
WebContents* ShellWindow::OpenURLFromTab(WebContents* source,
@@ -253,9 +288,16 @@ WebContents* ShellWindow::OpenURLFromTab(WebContents* source,
return NULL;
}
- WebContents* contents = delegate_->OpenURLFromTab(profile_, source,
- params);
- if (!contents) {
+ // Force all links to open in a new tab, even if they were trying to open a
+ // window.
+ chrome::NavigateParams new_tab_params(
+ static_cast<Browser*>(NULL), params.url, params.transition);
+ new_tab_params.disposition =
+ disposition == NEW_BACKGROUND_TAB ? disposition : NEW_FOREGROUND_TAB;
+ new_tab_params.initiating_profile = profile_;
+ chrome::Navigate(&new_tab_params);
+
+ if (!new_tab_params.target_contents) {
AddMessageToDevToolsConsole(
content::CONSOLE_MESSAGE_LEVEL_ERROR,
base::StringPrintf(
@@ -263,7 +305,7 @@ WebContents* ShellWindow::OpenURLFromTab(WebContents* source,
params.url.spec().c_str()));
}
- return contents;
+ return new_tab_params.target_contents;
}
void ShellWindow::AddNewContents(WebContents* source,
@@ -274,8 +316,30 @@ void ShellWindow::AddNewContents(WebContents* source,
bool* was_blocked) {
DCHECK(Profile::FromBrowserContext(new_contents->GetBrowserContext()) ==
profile_);
- delegate_->AddNewContents(profile_, new_contents, disposition,
- initial_pos, user_gesture, was_blocked);
+#if defined(OS_MACOSX) || defined(OS_WIN) || \
+ (defined(OS_LINUX) && !defined(OS_CHROMEOS))
+ if (disable_external_open_for_testing_) {
+ Browser* browser =
+ chrome::FindOrCreateTabbedBrowser(profile_, chrome::GetActiveDesktop());
+ // Force all links to open in a new tab, even if they were trying to open a
+ // new window.
+ disposition =
+ disposition == NEW_BACKGROUND_TAB ? disposition : NEW_FOREGROUND_TAB;
+ chrome::AddWebContents(browser, NULL, new_contents, disposition,
+ initial_pos, user_gesture, was_blocked);
+ } else {
+ new_contents->SetDelegate(new ShellWindowLinkDelegate());
+ }
+#else
+ Browser* browser =
+ chrome::FindOrCreateTabbedBrowser(profile_, chrome::GetActiveDesktop());
+ // Force all links to open in a new tab, even if they were trying to open a
+ // new window.
+ disposition =
+ disposition == NEW_BACKGROUND_TAB ? disposition : NEW_FOREGROUND_TAB;
+ chrome::AddWebContents(browser, NULL, new_contents, disposition, initial_pos,
+ user_gesture, was_blocked);
+#endif
}
void ShellWindow::HandleKeyboardEvent(
@@ -350,16 +414,12 @@ string16 ShellWindow::GetTitle() const {
// WebContents::GetTitle() will return the page's URL if there's no <title>
// specified. However, we'd prefer to show the name of the extension in that
// case, so we directly inspect the NavigationEntry's title.
- string16 title;
if (!web_contents() ||
!web_contents()->GetController().GetActiveEntry() ||
- web_contents()->GetController().GetActiveEntry()->GetTitle().empty()) {
- title = UTF8ToUTF16(extension()->name());
- } else {
- title = web_contents()->GetTitle();
- }
- const char16 kBadChars[] = { '\n', 0 };
- RemoveChars(title, kBadChars, &title);
+ web_contents()->GetController().GetActiveEntry()->GetTitle().empty())
+ return UTF8ToUTF16(extension()->name());
+ string16 title = web_contents()->GetTitle();
+ Browser::FormatTitleForDisplay(&title);
return title;
}
@@ -371,7 +431,7 @@ void ShellWindow::SetAppIconUrl(const GURL& url) {
web_contents()->DownloadImage(
url,
true, // is a favicon
- delegate_->PreferredIconSize(),
+ kPreferredIconSize,
0, // no maximum size
base::Bind(&ShellWindow::DidDownloadFavicon,
image_loader_ptr_factory_.GetWeakPtr()));
@@ -432,7 +492,7 @@ void ShellWindow::DidDownloadFavicon(int id,
// whose height >= the preferred size.
int largest_index = 0;
for (size_t i = 1; i < bitmaps.size(); ++i) {
- if (bitmaps[i].height() < delegate_->PreferredIconSize())
+ if (bitmaps[i].height() < kPreferredIconSize)
break;
largest_index = i;
}
@@ -449,9 +509,9 @@ void ShellWindow::UpdateExtensionAppIcon() {
loader->LoadImageAsync(
extension(),
extensions::IconsInfo::GetIconResource(extension(),
- delegate_->PreferredIconSize(),
+ kPreferredIconSize,
ExtensionIconSet::MATCH_BIGGER),
- gfx::Size(delegate_->PreferredIconSize(), delegate_->PreferredIconSize()),
+ gfx::Size(kPreferredIconSize, kPreferredIconSize),
base::Bind(&ShellWindow::OnImageLoaded,
image_loader_ptr_factory_.GetWeakPtr()));
}
@@ -466,7 +526,7 @@ bool ShellWindow::ShouldSuppressDialogs() {
content::ColorChooser* ShellWindow::OpenColorChooser(WebContents* web_contents,
SkColor initial_color) {
- return delegate_->ShowColorChooser(web_contents, initial_color);
+ return chrome::ShowColorChooser(web_contents, initial_color);
}
void ShellWindow::RunFileChooser(WebContents* tab,
@@ -478,8 +538,7 @@ void ShellWindow::RunFileChooser(WebContents* tab,
LOG(WARNING) << "File dialog opened by panel.";
return;
}
-
- delegate_->RunFileChooser(tab, params);
+ FileSelectHelper::RunFileChooser(tab, params);
}
bool ShellWindow::IsPopupOrPanel(const WebContents* source) const {
@@ -548,15 +607,6 @@ void ShellWindow::Observe(int type,
}
}
-void ShellWindow::SetWebContentsBlocked(content::WebContents* web_contents,
- bool blocked) {
- delegate_->SetWebContentsBlocked(web_contents, blocked);
-}
-
-bool ShellWindow::IsWebContentsVisible(content::WebContents* web_contents) {
- return delegate_->IsWebContentsVisible(web_contents);
-}
-
extensions::ActiveTabPermissionGranter*
ShellWindow::GetActiveTabPermissionGranter() {
// Shell windows don't support the activeTab permission.
@@ -580,7 +630,8 @@ void ShellWindow::SaveWindowPosition() {
if (!native_app_window_)
return;
- ShellWindowGeometryCache* cache = ShellWindowGeometryCache::Get(profile());
+ apps::ShellWindowGeometryCache* cache =
+ apps::ShellWindowGeometryCache::Get(profile());
gfx::Rect bounds = native_app_window_->GetRestoredBounds();
bounds.Inset(native_app_window_->GetFrameInsets());
@@ -646,4 +697,7 @@ SkRegion* ShellWindow::RawDraggableRegionsToSkRegion(
return sk_region;
}
-} // namespace apps
+void ShellWindow::DisableExternalOpenForTesting() {
+ disable_external_open_for_testing_ = true;
+}
+
diff --git a/apps/shell_window.h b/chrome/browser/ui/extensions/shell_window.h
index f283c80..60a82d2 100644
--- a/apps/shell_window.h
+++ b/chrome/browser/ui/extensions/shell_window.h
@@ -1,4 +1,4 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// 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.
@@ -9,7 +9,7 @@
#include "base/memory/weak_ptr.h"
#include "chrome/browser/extensions/extension_keybinding_registry.h"
#include "chrome/browser/sessions/session_id.h"
-#include "components/web_modal/web_contents_modal_dialog_manager_delegate.h"
+#include "chrome/browser/ui/chrome_web_modal_dialog_manager_delegate.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_contents_delegate.h"
@@ -39,8 +39,6 @@ namespace ui {
class BaseWindow;
}
-namespace apps {
-
// Manages the web contents for Shell Windows. The implementation for this
// class should create and maintain the WebContents for the window, and handle
// any message passing between the web contents and the extension system or
@@ -72,8 +70,8 @@ class ShellWindowContents {
// have a WebContents but none of the chrome of normal browser windows.
class ShellWindow : public content::NotificationObserver,
public content::WebContentsDelegate,
- public web_modal::WebContentsModalDialogManagerDelegate,
- public extensions::ExtensionKeybindingRegistry::Delegate {
+ public extensions::ExtensionKeybindingRegistry::Delegate,
+ public ChromeWebModalDialogManagerDelegate {
public:
enum WindowType {
WINDOW_TYPE_DEFAULT = 1 << 0, // Default shell window.
@@ -122,48 +120,8 @@ class ShellWindow : public content::NotificationObserver,
bool focused;
};
- class Delegate {
- public:
- virtual ~Delegate();
-
- // General initialization.
- virtual void InitWebContents(content::WebContents* web_contents) = 0;
-
- // Link handling.
- virtual content::WebContents* OpenURLFromTab(
- Profile* profile,
- content::WebContents* source,
- const content::OpenURLParams& params) = 0;
- virtual void AddNewContents(Profile* profile,
- content::WebContents* new_contents,
- WindowOpenDisposition disposition,
- const gfx::Rect& initial_pos,
- bool user_gesture,
- bool* was_blocked) = 0;
-
- // Feature support.
- virtual content::ColorChooser* ShowColorChooser(
- content::WebContents* web_contents,
- SkColor initial_color) = 0;
- virtual void RunFileChooser(content::WebContents* tab,
- const content::FileChooserParams& params) = 0;
- virtual void RequestMediaAccessPermission(
- content::WebContents* web_contents,
- const content::MediaStreamRequest& request,
- const content::MediaResponseCallback& callback,
- const extensions::Extension* extension) = 0;
- virtual int PreferredIconSize() = 0;
-
- // Web contents modal dialog support.
- virtual void SetWebContentsBlocked(content::WebContents* web_contents,
- bool blocked) = 0;
- virtual bool IsWebContentsVisible(content::WebContents* web_contents) = 0;
- };
-
// Helper function for creating and intiailizing a v2 app window.
- // The created shell window will take ownership of |delegate|.
static ShellWindow* Create(Profile* profile,
- Delegate* delegate,
const extensions::Extension* extension,
const GURL& url,
const CreateParams& params);
@@ -176,10 +134,7 @@ class ShellWindow : public content::NotificationObserver,
// The constructor and Init methods are public for constructing a ShellWindow
// with a non-standard render interface (e.g. v1 apps using Ash Panels).
// Normally ShellWindow::Create should be used.
- // The constructed shell window takes ownership of |delegate|.
- ShellWindow(Profile* profile,
- Delegate* delegate,
- const extensions::Extension* extension);
+ ShellWindow(Profile* profile, const extensions::Extension* extension);
// Initializes the render interface, web contents, and native window.
// |shell_window_contents| will become owned by ShellWindow.
@@ -249,6 +204,8 @@ class ShellWindow : public content::NotificationObserver,
return shell_window_contents_.get();
}
+ static void DisableExternalOpenForTesting();
+
protected:
virtual ~ShellWindow();
@@ -299,12 +256,6 @@ class ShellWindow : public content::NotificationObserver,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
- // web_modal::WebContentsModalDialogManagerDelegate implementation.
- virtual void SetWebContentsBlocked(content::WebContents* web_contents,
- bool blocked) OVERRIDE;
- virtual bool IsWebContentsVisible(
- content::WebContents* web_contents) OVERRIDE;
-
// Helper method to add a message to the renderer's DevTools console.
void AddMessageToDevToolsConsole(content::ConsoleMessageLevel level,
const std::string& message);
@@ -363,7 +314,6 @@ class ShellWindow : public content::NotificationObserver,
scoped_ptr<NativeAppWindow> native_app_window_;
scoped_ptr<ShellWindowContents> shell_window_contents_;
- scoped_ptr<Delegate> delegate_;
base::WeakPtrFactory<ShellWindow> image_loader_ptr_factory_;
@@ -375,6 +325,4 @@ class ShellWindow : public content::NotificationObserver,
DISALLOW_COPY_AND_ASSIGN(ShellWindow);
};
-} // namespace apps
-
#endif // CHROME_BROWSER_UI_EXTENSIONS_SHELL_WINDOW_H_
diff --git a/chrome/browser/ui/gtk/extensions/native_app_window_gtk.cc b/chrome/browser/ui/gtk/extensions/native_app_window_gtk.cc
index 76e5b04..b715652 100644
--- a/chrome/browser/ui/gtk/extensions/native_app_window_gtk.cc
+++ b/chrome/browser/ui/gtk/extensions/native_app_window_gtk.cc
@@ -20,8 +20,6 @@
#include "ui/gfx/image/image.h"
#include "ui/gfx/rect.h"
-using apps::ShellWindow;
-
namespace {
// The timeout in milliseconds before we'll get the true window position with
diff --git a/chrome/browser/ui/gtk/extensions/native_app_window_gtk.h b/chrome/browser/ui/gtk/extensions/native_app_window_gtk.h
index 1d6ed2b..e01f9bd 100644
--- a/chrome/browser/ui/gtk/extensions/native_app_window_gtk.h
+++ b/chrome/browser/ui/gtk/extensions/native_app_window_gtk.h
@@ -7,10 +7,10 @@
#include <gtk/gtk.h>
-#include "apps/shell_window.h"
#include "base/observer_list.h"
#include "base/timer.h"
#include "chrome/browser/ui/extensions/native_app_window.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/browser/ui/gtk/extensions/extension_view_gtk.h"
#include "third_party/skia/include/core/SkRegion.h"
#include "ui/base/gtk/gtk_signal.h"
@@ -28,8 +28,8 @@ class NativeAppWindowGtk : public NativeAppWindow,
public ExtensionViewGtk::Container,
public ui::ActiveWindowWatcherXObserver {
public:
- NativeAppWindowGtk(apps::ShellWindow* shell_window,
- const apps::ShellWindow::CreateParams& params);
+ NativeAppWindowGtk(ShellWindow* shell_window,
+ const ShellWindow::CreateParams& params);
// ui::BaseWindow implementation.
virtual bool IsActive() const OVERRIDE;
@@ -105,7 +105,7 @@ class NativeAppWindowGtk : public NativeAppWindow,
void OnDebouncedBoundsChanged();
- apps::ShellWindow* shell_window_; // weak - ShellWindow owns NativeAppWindow.
+ ShellWindow* shell_window_; // weak - ShellWindow owns NativeAppWindow.
GtkWindow* window_;
GdkWindowState state_;
diff --git a/chrome/browser/ui/views/extensions/native_app_window_views.cc b/chrome/browser/ui/views/extensions/native_app_window_views.cc
index 8d5433a..3fc9b08 100644
--- a/chrome/browser/ui/views/extensions/native_app_window_views.cc
+++ b/chrome/browser/ui/views/extensions/native_app_window_views.cc
@@ -47,8 +47,6 @@
#include "ui/aura/window.h"
#endif
-using apps::ShellWindow;
-
namespace {
const int kMinPanelWidth = 100;
diff --git a/chrome/browser/ui/views/extensions/native_app_window_views.h b/chrome/browser/ui/views/extensions/native_app_window_views.h
index 138a9e0..0b66b57 100644
--- a/chrome/browser/ui/views/extensions/native_app_window_views.h
+++ b/chrome/browser/ui/views/extensions/native_app_window_views.h
@@ -5,9 +5,9 @@
#ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_NATIVE_APP_WINDOW_VIEWS_H_
#define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_NATIVE_APP_WINDOW_VIEWS_H_
-#include "apps/shell_window.h"
#include "base/observer_list.h"
#include "chrome/browser/ui/extensions/native_app_window.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "content/public/browser/web_contents_observer.h"
#include "third_party/skia/include/core/SkRegion.h"
#include "ui/gfx/image/image_skia.h"
@@ -41,18 +41,16 @@ class NativeAppWindowViews : public NativeAppWindow,
public views::WidgetObserver,
public content::WebContentsObserver {
public:
- NativeAppWindowViews(apps::ShellWindow* shell_window,
- const apps::ShellWindow::CreateParams& params);
+ NativeAppWindowViews(ShellWindow* shell_window,
+ const ShellWindow::CreateParams& params);
virtual ~NativeAppWindowViews();
bool frameless() const { return frameless_; }
SkRegion* draggable_region() { return draggable_region_.get(); }
private:
- void InitializeDefaultWindow(
- const apps::ShellWindow::CreateParams& create_params);
- void InitializePanelWindow(
- const apps::ShellWindow::CreateParams& create_params);
+ void InitializeDefaultWindow(const ShellWindow::CreateParams& create_params);
+ void InitializePanelWindow(const ShellWindow::CreateParams& create_params);
void OnViewWasResized();
bool ShouldUseChromeStyleFrame() const;
@@ -156,7 +154,7 @@ class NativeAppWindowViews : public NativeAppWindow,
return shell_window_->extension();
}
- apps::ShellWindow* shell_window_; // weak - ShellWindow owns NativeAppWindow.
+ ShellWindow* shell_window_; // weak - ShellWindow owns NativeAppWindow.
views::WebView* web_view_;
views::Widget* window_;
bool is_fullscreen_;
diff --git a/chrome/browser/ui/views/select_file_dialog_extension.cc b/chrome/browser/ui/views/select_file_dialog_extension.cc
index 09e9ee5..c5f4d4f 100644
--- a/chrome/browser/ui/views/select_file_dialog_extension.cc
+++ b/chrome/browser/ui/views/select_file_dialog_extension.cc
@@ -4,7 +4,6 @@
#include "chrome/browser/ui/views/select_file_dialog_extension.h"
-#include "apps/shell_window.h"
#include "base/bind.h"
#include "base/callback.h"
#include "base/logging.h"
@@ -25,6 +24,7 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/chrome_select_file_policy.h"
#include "chrome/browser/ui/extensions/native_app_window.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/browser/ui/host_desktop.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/views/extensions/extension_dialog.h"
@@ -33,7 +33,6 @@
#include "ui/base/base_window.h"
#include "ui/shell_dialogs/selected_file_info.h"
-using apps::ShellWindow;
using content::BrowserThread;
namespace {
diff --git a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
index 9720d60..7a370f4 100644
--- a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
+++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
@@ -7,7 +7,6 @@
#include "apps/app_load_service.h"
#include "apps/app_restore_service.h"
#include "apps/saved_files_service.h"
-#include "apps/shell_window.h"
#include "base/auto_reset.h"
#include "base/base64.h"
#include "base/bind.h"
@@ -44,6 +43,7 @@
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/chrome_select_file_policy.h"
#include "chrome/browser/ui/extensions/application_launch.h"
+#include "chrome/browser/ui/extensions/shell_window.h"
#include "chrome/browser/ui/webui/extensions/extension_basic_info.h"
#include "chrome/browser/ui/webui/extensions/extension_icon_source.h"
#include "chrome/common/chrome_notification_types.h"
diff --git a/chrome/chrome_browser_ui.gypi b/chrome/chrome_browser_ui.gypi
index 461c98f..035b29f 100644
--- a/chrome/chrome_browser_ui.gypi
+++ b/chrome/chrome_browser_ui.gypi
@@ -178,8 +178,6 @@
'browser/ui/app_modal_dialogs/javascript_dialog_manager.cc',
'browser/ui/app_modal_dialogs/javascript_dialog_manager.h',
'browser/ui/app_modal_dialogs/native_app_modal_dialog.h',
- 'browser/ui/apps/chrome_shell_window_delegate.cc',
- 'browser/ui/apps/chrome_shell_window_delegate.h',
'browser/ui/ash/ash_keyboard_controller_proxy.cc',
'browser/ui/ash/ash_keyboard_controller_proxy.h',
'browser/ui/ash/app_list/app_list_controller_ash.h',
@@ -963,6 +961,8 @@
'browser/ui/extensions/extension_enable_flow.h',
'browser/ui/extensions/extension_enable_flow_delegate.h',
'browser/ui/extensions/native_app_window.h',
+ 'browser/ui/extensions/shell_window.cc',
+ 'browser/ui/extensions/shell_window.h',
'browser/ui/external_protocol_dialog_delegate.cc',
'browser/ui/external_protocol_dialog_delegate.h',
'browser/ui/find_bar/find_bar.h',