summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorandresantoso@chromium.org <andresantoso@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-15 01:32:51 +0000
committerandresantoso@chromium.org <andresantoso@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-15 01:32:51 +0000
commit3361fae917cb64494369410e94674e551b8882c3 (patch)
treed788cfef24e3f0bf4efb1d7b3e55c7c260a3a5d4 /ui
parent82c15e474dcfc05a1105e86f9276de9f35dec16b (diff)
downloadchromium_src-3361fae917cb64494369410e94674e551b8882c3.zip
chromium_src-3361fae917cb64494369410e94674e551b8882c3.tar.gz
chromium_src-3361fae917cb64494369410e94674e551b8882c3.tar.bz2
Change the type of InitParams.context from gfx::NativeView to
gfx::NativeWindow. With aura, gfx::NativeView and gfx::NativeWindow both map to aura::Window. But on Mac they map to different types (NSWindow and NSView), so they can't be used interchangeably. |context| is used to determine the desktop type, and most of the call sites are looking to pass a window instead of a view. By changing context's type to gfx::NativeWindow, we get these call sites to compile with MacViews while maintaining previous behavior with aura. BUG= 390755 Review URL: https://codereview.chromium.org/387993004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283126 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/views/examples/examples_window.cc2
-rw-r--r--ui/views/examples/examples_window.h2
-rw-r--r--ui/views/examples/examples_window_with_content.cc2
-rw-r--r--ui/views/examples/examples_window_with_content.h2
-rw-r--r--ui/views/examples/examples_with_content_main_exe.cc2
-rw-r--r--ui/views/test/views_test_base.cc2
-rw-r--r--ui/views/test/views_test_base.h2
-rw-r--r--ui/views/test/views_test_helper.cc2
-rw-r--r--ui/views/test/views_test_helper.h2
-rw-r--r--ui/views/test/views_test_helper_aura.cc2
-rw-r--r--ui/views/test/views_test_helper_aura.h2
-rw-r--r--ui/views/widget/widget.cc4
-rw-r--r--ui/views/widget/widget.h6
-rw-r--r--ui/views/widget/widget_unittest.cc2
-rw-r--r--ui/views/window/dialog_delegate.cc2
-rw-r--r--ui/views/window/dialog_delegate.h2
-rw-r--r--ui/views_content_client/views_content_client.h4
17 files changed, 21 insertions, 21 deletions
diff --git a/ui/views/examples/examples_window.cc b/ui/views/examples/examples_window.cc
index 3aa9802..2b63699 100644
--- a/ui/views/examples/examples_window.cc
+++ b/ui/views/examples/examples_window.cc
@@ -210,7 +210,7 @@ class ExamplesWindowContents : public WidgetDelegateView,
ExamplesWindowContents* ExamplesWindowContents::instance_ = NULL;
void ShowExamplesWindow(Operation operation,
- gfx::NativeView window_context,
+ gfx::NativeWindow window_context,
ScopedExamples extra_examples) {
if (ExamplesWindowContents::instance()) {
ExamplesWindowContents::instance()->GetWidget()->Activate();
diff --git a/ui/views/examples/examples_window.h b/ui/views/examples/examples_window.h
index 89222ef..3393895 100644
--- a/ui/views/examples/examples_window.h
+++ b/ui/views/examples/examples_window.h
@@ -29,7 +29,7 @@ enum Operation {
// window should be created (see |Widget::InitParams::context| for details).
VIEWS_EXAMPLES_EXPORT void ShowExamplesWindow(
Operation operation,
- gfx::NativeView window_context,
+ gfx::NativeWindow window_context,
scoped_ptr<ScopedVector<ExampleBase> > extra_examples);
} // namespace examples
diff --git a/ui/views/examples/examples_window_with_content.cc b/ui/views/examples/examples_window_with_content.cc
index 66342ca..bbc88b2 100644
--- a/ui/views/examples/examples_window_with_content.cc
+++ b/ui/views/examples/examples_window_with_content.cc
@@ -12,7 +12,7 @@ namespace examples {
void ShowExamplesWindowWithContent(Operation operation,
content::BrowserContext* browser_context,
- gfx::NativeView window_context) {
+ gfx::NativeWindow window_context) {
scoped_ptr<ScopedVector<ExampleBase> > extra_examples(
new ScopedVector<ExampleBase>);
extra_examples->push_back(new WebViewExample(browser_context));
diff --git a/ui/views/examples/examples_window_with_content.h b/ui/views/examples/examples_window_with_content.h
index 407fd2e..945201b 100644
--- a/ui/views/examples/examples_window_with_content.h
+++ b/ui/views/examples/examples_window_with_content.h
@@ -20,7 +20,7 @@ namespace examples {
VIEWS_EXAMPLES_WITH_CONTENT_EXPORT void ShowExamplesWindowWithContent(
Operation operation,
content::BrowserContext* browser_context,
- gfx::NativeView window_context);
+ gfx::NativeWindow window_context);
} // namespace examples
} // namespace views
diff --git a/ui/views/examples/examples_with_content_main_exe.cc b/ui/views/examples/examples_with_content_main_exe.cc
index 8df1dec..6d5613e 100644
--- a/ui/views/examples/examples_with_content_main_exe.cc
+++ b/ui/views/examples/examples_with_content_main_exe.cc
@@ -15,7 +15,7 @@
namespace {
void ShowContentExampleWindow(content::BrowserContext* browser_context,
- gfx::NativeView window_context) {
+ gfx::NativeWindow window_context) {
views::examples::ShowExamplesWindowWithContent(views::examples::QUIT_ON_CLOSE,
browser_context,
window_context);
diff --git a/ui/views/test/views_test_base.cc b/ui/views/test/views_test_base.cc
index eba69ac..ade40e8 100644
--- a/ui/views/test/views_test_base.cc
+++ b/ui/views/test/views_test_base.cc
@@ -65,7 +65,7 @@ Widget::InitParams ViewsTestBase::CreateParams(
return params;
}
-gfx::NativeView ViewsTestBase::GetContext() {
+gfx::NativeWindow ViewsTestBase::GetContext() {
return test_helper_->GetContext();
}
diff --git a/ui/views/test/views_test_base.h b/ui/views/test/views_test_base.h
index 814ee11..6664cba 100644
--- a/ui/views/test/views_test_base.h
+++ b/ui/views/test/views_test_base.h
@@ -47,7 +47,7 @@ class ViewsTestBase : public PlatformTest {
// Returns a context view. In aura builds, this will be the
// RootWindow. Everywhere else, NULL.
- gfx::NativeView GetContext();
+ gfx::NativeWindow GetContext();
private:
base::MessageLoopForUI message_loop_;
diff --git a/ui/views/test/views_test_helper.cc b/ui/views/test/views_test_helper.cc
index e8dfdd1..75588a6 100644
--- a/ui/views/test/views_test_helper.cc
+++ b/ui/views/test/views_test_helper.cc
@@ -18,7 +18,7 @@ void ViewsTestHelper::SetUp() {
void ViewsTestHelper::TearDown() {
}
-gfx::NativeView ViewsTestHelper::GetContext() {
+gfx::NativeWindow ViewsTestHelper::GetContext() {
return NULL;
}
diff --git a/ui/views/test/views_test_helper.h b/ui/views/test/views_test_helper.h
index 53bac2f6..8d73333 100644
--- a/ui/views/test/views_test_helper.h
+++ b/ui/views/test/views_test_helper.h
@@ -36,7 +36,7 @@ class ViewsTestHelper {
// Returns a context view. In aura builds, this will be the
// RootWindow. Everywhere else, NULL.
- virtual gfx::NativeView GetContext();
+ virtual gfx::NativeWindow GetContext();
private:
DISALLOW_COPY_AND_ASSIGN(ViewsTestHelper);
diff --git a/ui/views/test/views_test_helper_aura.cc b/ui/views/test/views_test_helper_aura.cc
index 2f50b86..5bc83d3 100644
--- a/ui/views/test/views_test_helper_aura.cc
+++ b/ui/views/test/views_test_helper_aura.cc
@@ -38,7 +38,7 @@ void ViewsTestHelperAura::TearDown() {
CHECK(!wm::ScopedCaptureClient::IsActive());
}
-gfx::NativeView ViewsTestHelperAura::GetContext() {
+gfx::NativeWindow ViewsTestHelperAura::GetContext() {
return aura_test_helper_->root_window();
}
diff --git a/ui/views/test/views_test_helper_aura.h b/ui/views/test/views_test_helper_aura.h
index b94bc36..77733bb 100644
--- a/ui/views/test/views_test_helper_aura.h
+++ b/ui/views/test/views_test_helper_aura.h
@@ -35,7 +35,7 @@ class ViewsTestHelperAura : public ViewsTestHelper {
// Overridden from ViewsTestHelper:
virtual void SetUp() OVERRIDE;
virtual void TearDown() OVERRIDE;
- virtual gfx::NativeView GetContext() OVERRIDE;
+ virtual gfx::NativeWindow GetContext() OVERRIDE;
private:
ui::ContextFactory* context_factory_;
diff --git a/ui/views/widget/widget.cc b/ui/views/widget/widget.cc
index 282b004..d8b2030 100644
--- a/ui/views/widget/widget.cc
+++ b/ui/views/widget/widget.cc
@@ -225,13 +225,13 @@ Widget* Widget::CreateWindowWithParentAndBounds(WidgetDelegate* delegate,
// static
Widget* Widget::CreateWindowWithContext(WidgetDelegate* delegate,
- gfx::NativeView context) {
+ gfx::NativeWindow context) {
return CreateWindowWithContextAndBounds(delegate, context, gfx::Rect());
}
// static
Widget* Widget::CreateWindowWithContextAndBounds(WidgetDelegate* delegate,
- gfx::NativeView context,
+ gfx::NativeWindow context,
const gfx::Rect& bounds) {
Widget* widget = new Widget;
Widget::InitParams params;
diff --git a/ui/views/widget/widget.h b/ui/views/widget/widget.h
index 02911b9..bf9ce09 100644
--- a/ui/views/widget/widget.h
+++ b/ui/views/widget/widget.h
@@ -245,7 +245,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
// |parent|. If you pass a RootWindow to |context|, we ask that RootWindow
// where it wants your window placed.) NULL is not allowed if you are using
// aura.
- gfx::NativeView context;
+ gfx::NativeWindow context;
// If true, forces the window to be shown in the taskbar, even for window
// types that do not appear in the taskbar by default (popup and bubble).
bool force_show_in_taskbar;
@@ -280,9 +280,9 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
// Creates a decorated window Widget in the same desktop context as |context|.
static Widget* CreateWindowWithContext(WidgetDelegate* delegate,
- gfx::NativeView context);
+ gfx::NativeWindow context);
static Widget* CreateWindowWithContextAndBounds(WidgetDelegate* delegate,
- gfx::NativeView context,
+ gfx::NativeWindow context,
const gfx::Rect& bounds);
// Closes all Widgets that aren't identified as "secondary widgets". Called
diff --git a/ui/views/widget/widget_unittest.cc b/ui/views/widget/widget_unittest.cc
index a00787f..fbc814d 100644
--- a/ui/views/widget/widget_unittest.cc
+++ b/ui/views/widget/widget_unittest.cc
@@ -2490,7 +2490,7 @@ TEST_F(WidgetTest, IsActiveFromDestroy) {
Widget::InitParams child_params =
CreateParams(Widget::InitParams::TYPE_POPUP);
child_params.ownership = Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
- child_params.context = parent_widget.GetNativeView();
+ child_params.context = parent_widget.GetNativeWindow();
child_widget.Init(child_params);
child_widget.AddObserver(&observer);
child_widget.Show();
diff --git a/ui/views/window/dialog_delegate.cc b/ui/views/window/dialog_delegate.cc
index 5ec29a2..1d52acc 100644
--- a/ui/views/window/dialog_delegate.cc
+++ b/ui/views/window/dialog_delegate.cc
@@ -31,7 +31,7 @@ DialogDelegate::~DialogDelegate() {
// static
Widget* DialogDelegate::CreateDialogWidget(WidgetDelegate* delegate,
- gfx::NativeView context,
+ gfx::NativeWindow context,
gfx::NativeView parent) {
views::Widget* widget = new views::Widget;
views::Widget::InitParams params;
diff --git a/ui/views/window/dialog_delegate.h b/ui/views/window/dialog_delegate.h
index 91fff1e..f627a48 100644
--- a/ui/views/window/dialog_delegate.h
+++ b/ui/views/window/dialog_delegate.h
@@ -34,7 +34,7 @@ class VIEWS_EXPORT DialogDelegate : public ui::DialogModel,
// Create a dialog widget with the specified |context| or |parent|.
static Widget* CreateDialogWidget(WidgetDelegate* delegate,
- gfx::NativeView context,
+ gfx::NativeWindow context,
gfx::NativeView parent);
// Override this function to display an extra view adjacent to the buttons.
diff --git a/ui/views_content_client/views_content_client.h b/ui/views_content_client/views_content_client.h
index 0428946..b11cf63 100644
--- a/ui/views_content_client/views_content_client.h
+++ b/ui/views_content_client/views_content_client.h
@@ -25,7 +25,7 @@ namespace ui {
// Sample usage:
//
// void InitMyApp(content::BrowserContext* browser_context,
-// gfx::NativeView window_context) {
+// gfx::NativeWindow window_context) {
// // Create desired windows and views here. Runs on the UI thread.
// }
//
@@ -46,7 +46,7 @@ class VIEWS_CONTENT_CLIENT_EXPORT ViewsContentClient {
public:
typedef base::Callback<
void(content::BrowserContext* browser_context,
- gfx::NativeView window_context)> Task;
+ gfx::NativeWindow window_context)> Task;
#if defined(OS_WIN)
ViewsContentClient(HINSTANCE instance,