summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-18 21:00:32 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-18 21:00:32 +0000
commit91846402ed527c2c947dc476a7b36c992ea1c144 (patch)
treee0fe1a6510a51f0c296602b7732258001269de7d /chrome
parentbdab1c04ca6f6bd94ca86d6caa810ca58edc7713 (diff)
downloadchromium_src-91846402ed527c2c947dc476a7b36c992ea1c144.zip
chromium_src-91846402ed527c2c947dc476a7b36c992ea1c144.tar.gz
chromium_src-91846402ed527c2c947dc476a7b36c992ea1c144.tar.bz2
Revert 132856 - Aura/ash split: Remove hacks and get chrome linking without ash.
views_unittests failure on Linux Chromeos. For the first time now, you can do: > build/gyp_chromium -Duse_aura=1 -Duse_ash=0 And get a running chrome. It has lots of issues, especially related to window placement, tab handling, etc, but it pops up and renders web content. Also consolidates most of the desktop behavior into its own class. Also makes views_examples_exe work again. Several of the hacks are no longer needed after Ben's refactoring to support WebView. BUG=116458,119759 TEST=none Review URL: http://codereview.chromium.org/10081022 TBR=erg@chromium.org Review URL: https://chromiumcodereview.appspot.com/10083057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132864 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/chrome_browser_main_extra_parts_aura.cc15
-rw-r--r--chrome/browser/chrome_browser_main_extra_parts_aura.h13
-rw-r--r--chrome/browser/fullscreen_ash.cc37
-rw-r--r--chrome/browser/fullscreen_aura.cc32
-rw-r--r--chrome/browser/ui/tabs/dock_info_ash.cc70
-rw-r--r--chrome/browser/ui/tabs/dock_info_aura.cc42
-rw-r--r--chrome/browser/ui/views/accessibility_event_router_views_unittest.cc7
-rw-r--r--chrome/browser/ui/views/ash/color_chooser_aura.cc (renamed from chrome/browser/ui/views/color_chooser_aura.cc)0
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc7
-rw-r--r--chrome/browser/ui/views/chrome_views_delegate.cc13
-rw-r--r--chrome/browser/ui/views/chrome_views_delegate.h5
-rw-r--r--chrome/browser/ui/views/menu_model_adapter_test.cc7
-rw-r--r--chrome/chrome_browser.gypi5
13 files changed, 63 insertions, 190 deletions
diff --git a/chrome/browser/chrome_browser_main_extra_parts_aura.cc b/chrome/browser/chrome_browser_main_extra_parts_aura.cc
index 693b5f3..97e9dc6 100644
--- a/chrome/browser/chrome_browser_main_extra_parts_aura.cc
+++ b/chrome/browser/chrome_browser_main_extra_parts_aura.cc
@@ -6,26 +6,11 @@
#include "ui/aura/env.h"
-#if !defined(USE_ASH)
-#include "ui/aura/desktop/desktop_stacking_client.h"
-#include "ui/views/widget/native_widget_aura.h"
-#endif // !USE_ASH
-
ChromeBrowserMainExtraPartsAura::ChromeBrowserMainExtraPartsAura()
: ChromeBrowserMainExtraParts() {
}
-void ChromeBrowserMainExtraPartsAura::PreProfileInit() {
-#if !defined(USE_ASH)
- stacking_client_.reset(new aura::DesktopStackingClient);
-#endif // !USE_ASH
-}
-
void ChromeBrowserMainExtraPartsAura::PostMainMessageLoopRun() {
-#if !defined(USE_ASH)
- stacking_client_.reset();
-#endif
-
// aura::Env instance is deleted in BrowserProcessImpl::StartTearDown
// after the metrics service is deleted.
}
diff --git a/chrome/browser/chrome_browser_main_extra_parts_aura.h b/chrome/browser/chrome_browser_main_extra_parts_aura.h
index 4fe4e7e..e92a679 100644
--- a/chrome/browser/chrome_browser_main_extra_parts_aura.h
+++ b/chrome/browser/chrome_browser_main_extra_parts_aura.h
@@ -9,26 +9,13 @@
#include "base/compiler_specific.h"
#include "chrome/browser/chrome_browser_main_extra_parts.h"
-#if !defined(USE_ASH)
-#include "base/memory/scoped_ptr.h"
-#endif
-
-namespace aura {
-class DesktopStackingClient;
-}
-
class ChromeBrowserMainExtraPartsAura : public ChromeBrowserMainExtraParts {
public:
ChromeBrowserMainExtraPartsAura();
- virtual void PreProfileInit() OVERRIDE;
virtual void PostMainMessageLoopRun() OVERRIDE;
private:
-#if !defined(USE_ASH)
- scoped_ptr<aura::DesktopStackingClient> stacking_client_;
-#endif
-
DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainExtraPartsAura);
};
diff --git a/chrome/browser/fullscreen_ash.cc b/chrome/browser/fullscreen_ash.cc
deleted file mode 100644
index 08b1419..0000000
--- a/chrome/browser/fullscreen_ash.cc
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/fullscreen.h"
-
-#include "ash/shell.h"
-#include "base/logging.h"
-#include "ui/aura/client/aura_constants.h"
-#include "ui/aura/root_window.h"
-#include "ui/aura/window.h"
-#include "ui/base/ui_base_types.h"
-
-namespace {
-
-bool CheckIfFullscreenWindowExists(aura::Window* window) {
- if (window->GetProperty(aura::client::kShowStateKey) ==
- ui::SHOW_STATE_FULLSCREEN)
- return true;
- aura::Window::Windows children = window->children();
- for (aura::Window::Windows::const_iterator i = children.begin();
- i != children.end();
- ++i) {
- if (CheckIfFullscreenWindowExists(*i))
- return true;
- }
- return false;
-}
-
-} // namespace
-
-bool IsFullScreenMode() {
- // This is used only by notification_ui_manager.cc. On aura, notification
- // will be managed in panel. This is temporary to get certain feature running
- // until we implement it for aura.
- return CheckIfFullscreenWindowExists(ash::Shell::GetRootWindow());
-}
diff --git a/chrome/browser/fullscreen_aura.cc b/chrome/browser/fullscreen_aura.cc
index db768be..08b1419 100644
--- a/chrome/browser/fullscreen_aura.cc
+++ b/chrome/browser/fullscreen_aura.cc
@@ -4,16 +4,34 @@
#include "chrome/browser/fullscreen.h"
+#include "ash/shell.h"
#include "base/logging.h"
+#include "ui/aura/client/aura_constants.h"
+#include "ui/aura/root_window.h"
+#include "ui/aura/window.h"
+#include "ui/base/ui_base_types.h"
-#if !defined(USE_ASH)
+namespace {
-bool IsFullScreenMode() {
- // TODO(erg): An implementation here would have to check all existing
- // RootWindows instead of just recursively walking the Shell's RootWindow as
- // in the ash implementaiton.
- NOTIMPLEMENTED();
+bool CheckIfFullscreenWindowExists(aura::Window* window) {
+ if (window->GetProperty(aura::client::kShowStateKey) ==
+ ui::SHOW_STATE_FULLSCREEN)
+ return true;
+ aura::Window::Windows children = window->children();
+ for (aura::Window::Windows::const_iterator i = children.begin();
+ i != children.end();
+ ++i) {
+ if (CheckIfFullscreenWindowExists(*i))
+ return true;
+ }
return false;
}
-#endif
+} // namespace
+
+bool IsFullScreenMode() {
+ // This is used only by notification_ui_manager.cc. On aura, notification
+ // will be managed in panel. This is temporary to get certain feature running
+ // until we implement it for aura.
+ return CheckIfFullscreenWindowExists(ash::Shell::GetRootWindow());
+}
diff --git a/chrome/browser/ui/tabs/dock_info_ash.cc b/chrome/browser/ui/tabs/dock_info_ash.cc
deleted file mode 100644
index f058680..0000000
--- a/chrome/browser/ui/tabs/dock_info_ash.cc
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/tabs/dock_info.h"
-
-#include "ash/shell.h"
-#include "ui/aura/root_window.h"
-#include "ui/aura/window.h"
-#include "ui/gfx/compositor/layer.h"
-
-// DockInfo -------------------------------------------------------------------
-
-namespace {
-
-aura::Window* GetLocalProcessWindowAtPointImpl(
- const gfx::Point& screen_point,
- const std::set<gfx::NativeView>& ignore,
- aura::Window* window) {
- if (ignore.find(window) != ignore.end())
- return NULL;
-
- if (!window->IsVisible())
- return NULL;
-
- if (window->layer()->type() == ui::LAYER_TEXTURED) {
- gfx::Point window_point(screen_point);
- aura::Window::ConvertPointToWindow(ash::Shell::GetRootWindow(), window,
- &window_point);
- return gfx::Rect(window->bounds().size()).Contains(window_point) ?
- window : NULL;
- }
- for (aura::Window::Windows::const_reverse_iterator i =
- window->children().rbegin(); i != window->children().rend(); ++i) {
- aura::Window* result =
- GetLocalProcessWindowAtPointImpl(screen_point, ignore, *i);
- if (result)
- return result;
- }
- return NULL;
-}
-
-} // namespace
-
-// static
-DockInfo DockInfo::GetDockInfoAtPoint(const gfx::Point& screen_point,
- const std::set<gfx::NativeView>& ignore) {
- // TODO(beng):
- NOTIMPLEMENTED();
- return DockInfo();
-}
-
-// static
-gfx::NativeView DockInfo::GetLocalProcessWindowAtPoint(
- const gfx::Point& screen_point,
- const std::set<gfx::NativeView>& ignore) {
- return GetLocalProcessWindowAtPointImpl(
- screen_point, ignore, ash::Shell::GetRootWindow());
-}
-
-bool DockInfo::GetWindowBounds(gfx::Rect* bounds) const {
- if (!window())
- return false;
- *bounds = window_->bounds();
- return true;
-}
-
-void DockInfo::SizeOtherWindowTo(const gfx::Rect& bounds) const {
- window_->SetBounds(bounds);
-}
diff --git a/chrome/browser/ui/tabs/dock_info_aura.cc b/chrome/browser/ui/tabs/dock_info_aura.cc
index bf500de..f058680 100644
--- a/chrome/browser/ui/tabs/dock_info_aura.cc
+++ b/chrome/browser/ui/tabs/dock_info_aura.cc
@@ -4,9 +4,43 @@
#include "chrome/browser/ui/tabs/dock_info.h"
+#include "ash/shell.h"
+#include "ui/aura/root_window.h"
#include "ui/aura/window.h"
+#include "ui/gfx/compositor/layer.h"
-#if !defined(USE_ASH)
+// DockInfo -------------------------------------------------------------------
+
+namespace {
+
+aura::Window* GetLocalProcessWindowAtPointImpl(
+ const gfx::Point& screen_point,
+ const std::set<gfx::NativeView>& ignore,
+ aura::Window* window) {
+ if (ignore.find(window) != ignore.end())
+ return NULL;
+
+ if (!window->IsVisible())
+ return NULL;
+
+ if (window->layer()->type() == ui::LAYER_TEXTURED) {
+ gfx::Point window_point(screen_point);
+ aura::Window::ConvertPointToWindow(ash::Shell::GetRootWindow(), window,
+ &window_point);
+ return gfx::Rect(window->bounds().size()).Contains(window_point) ?
+ window : NULL;
+ }
+ for (aura::Window::Windows::const_reverse_iterator i =
+ window->children().rbegin(); i != window->children().rend(); ++i) {
+ aura::Window* result =
+ GetLocalProcessWindowAtPointImpl(screen_point, ignore, *i);
+ if (result)
+ return result;
+ }
+ return NULL;
+}
+
+} // namespace
// static
DockInfo DockInfo::GetDockInfoAtPoint(const gfx::Point& screen_point,
@@ -20,8 +54,8 @@ DockInfo DockInfo::GetDockInfoAtPoint(const gfx::Point& screen_point,
gfx::NativeView DockInfo::GetLocalProcessWindowAtPoint(
const gfx::Point& screen_point,
const std::set<gfx::NativeView>& ignore) {
- NOTIMPLEMENTED();
- return NULL;
+ return GetLocalProcessWindowAtPointImpl(
+ screen_point, ignore, ash::Shell::GetRootWindow());
}
bool DockInfo::GetWindowBounds(gfx::Rect* bounds) const {
@@ -34,5 +68,3 @@ bool DockInfo::GetWindowBounds(gfx::Rect* bounds) const {
void DockInfo::SizeOtherWindowTo(const gfx::Rect& bounds) const {
window_->SetBounds(bounds);
}
-
-#endif
diff --git a/chrome/browser/ui/views/accessibility_event_router_views_unittest.cc b/chrome/browser/ui/views/accessibility_event_router_views_unittest.cc
index 9b01b46..6a1121e 100644
--- a/chrome/browser/ui/views/accessibility_event_router_views_unittest.cc
+++ b/chrome/browser/ui/views/accessibility_event_router_views_unittest.cc
@@ -82,13 +82,6 @@ class AccessibilityViewsDelegate : public views::ViewsDelegate {
return 0;
}
-#if defined(USE_AURA)
- virtual views::NativeWidgetHelperAura* CreateNativeWidgetHelper(
- views::NativeWidgetAura* native_widget) OVERRIDE {
- return NULL;
- }
-#endif
-
DISALLOW_COPY_AND_ASSIGN(AccessibilityViewsDelegate);
};
diff --git a/chrome/browser/ui/views/color_chooser_aura.cc b/chrome/browser/ui/views/ash/color_chooser_aura.cc
index b108796..b108796 100644
--- a/chrome/browser/ui/views/color_chooser_aura.cc
+++ b/chrome/browser/ui/views/ash/color_chooser_aura.cc
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
index 7944ede..f331a6e 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
@@ -120,13 +120,6 @@ class ViewsDelegateImpl : public views::ViewsDelegate {
return 0;
}
-#if defined(USE_AURA)
- virtual views::NativeWidgetHelperAura* CreateNativeWidgetHelper(
- views::NativeWidgetAura* native_widget) OVERRIDE {
- return NULL;
- }
-#endif
-
private:
DISALLOW_COPY_AND_ASSIGN(ViewsDelegateImpl);
};
diff --git a/chrome/browser/ui/views/chrome_views_delegate.cc b/chrome/browser/ui/views/chrome_views_delegate.cc
index 8813ef0..bf99c47 100644
--- a/chrome/browser/ui/views/chrome_views_delegate.cc
+++ b/chrome/browser/ui/views/chrome_views_delegate.cc
@@ -26,8 +26,6 @@
#if defined(USE_ASH)
#include "ash/shell.h"
-#elif defined(USE_AURA)
-#include "ui/views/widget/desktop_native_widget_helper_aura.h"
#endif
namespace {
@@ -159,14 +157,3 @@ void ChromeViewsDelegate::ReleaseRef() {
int ChromeViewsDelegate::GetDispositionForEvent(int event_flags) {
return event_utils::DispositionFromEventFlags(event_flags);
}
-
-#if defined(USE_AURA)
-views::NativeWidgetHelperAura* ChromeViewsDelegate::CreateNativeWidgetHelper(
- views::NativeWidgetAura* native_widget) {
-#if !defined(USE_ASH)
- return new views::DesktopNativeWidgetHelperAura(native_widget);
-#else
- return NULL;
-#endif
-}
-#endif
diff --git a/chrome/browser/ui/views/chrome_views_delegate.h b/chrome/browser/ui/views/chrome_views_delegate.h
index c7e4b7c..315f7ab 100644
--- a/chrome/browser/ui/views/chrome_views_delegate.h
+++ b/chrome/browser/ui/views/chrome_views_delegate.h
@@ -46,11 +46,6 @@ class ChromeViewsDelegate : public views::ViewsDelegate {
virtual int GetDispositionForEvent(int event_flags) OVERRIDE;
-#if defined(USE_AURA)
- virtual views::NativeWidgetHelperAura* CreateNativeWidgetHelper(
- views::NativeWidgetAura* native_widget) OVERRIDE;
-#endif
-
private:
DISALLOW_COPY_AND_ASSIGN(ChromeViewsDelegate);
};
diff --git a/chrome/browser/ui/views/menu_model_adapter_test.cc b/chrome/browser/ui/views/menu_model_adapter_test.cc
index 740ec42..d98966a 100644
--- a/chrome/browser/ui/views/menu_model_adapter_test.cc
+++ b/chrome/browser/ui/views/menu_model_adapter_test.cc
@@ -88,13 +88,6 @@ class TestViewsDelegate : public views::ViewsDelegate {
return 0;
}
-#if defined(USE_AURA)
- virtual views::NativeWidgetHelperAura* CreateNativeWidgetHelper(
- views::NativeWidgetAura* native_widget) OVERRIDE {
- return NULL;
- }
-#endif
-
private:
DISALLOW_COPY_AND_ASSIGN(TestViewsDelegate);
};
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index a0cbbb8..f03e8d3 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -1010,7 +1010,6 @@
'browser/first_run/upgrade_util_win.cc',
'browser/first_run/upgrade_util_win.h',
'browser/fullscreen.h',
- 'browser/fullscreen_ash.cc',
'browser/fullscreen_aura.cc',
'browser/fullscreen_gtk.cc',
'browser/fullscreen_mac.mm',
@@ -3154,7 +3153,6 @@
'browser/ui/tab_modal_confirm_dialog_delegate.h',
'browser/ui/tabs/dock_info.cc',
'browser/ui/tabs/dock_info.h',
- 'browser/ui/tabs/dock_info_ash.cc',
'browser/ui/tabs/dock_info_aura.cc',
'browser/ui/tabs/dock_info_gtk.cc',
'browser/ui/tabs/dock_info_mac.cc',
@@ -3484,7 +3482,7 @@
'browser/ui/views/select_file_dialog_extension.cc',
'browser/ui/views/select_file_dialog_extension.h',
'browser/ui/views/select_file_dialog_win.cc',
- 'browser/ui/views/color_chooser_aura.cc',
+ 'browser/ui/views/ash/color_chooser_aura.cc',
'browser/ui/views/color_chooser_win.cc',
'browser/ui/views/color_chooser_dialog.cc',
'browser/ui/views/color_chooser_dialog.h',
@@ -4818,7 +4816,6 @@
['include', '^browser/ui/views/chrome_views_delegate.cc'],
['include', '^browser/ui/views/collected_cookies_views.cc'],
['include', '^browser/ui/views/collected_cookies_views.h'],
- ['include', '^browser/ui/views/color_chooser_aura.cc'],
['include', '^browser/ui/views/confirm_bubble_view.cc'],
['include', '^browser/ui/views/confirm_bubble_view.h'],
['include', '^browser/ui/views/constrained_html_delegate_views.cc'],