Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(929)

Unified Diff: ui/app_list/demo/app_list_demo_views.cc

Issue 436513002: MacViews: Fix app list demo, for Widget InitParams "context" type change (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix CrOS Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/demo/app_list_demo_views.cc
diff --git a/ui/app_list/demo/app_list_demo_views.cc b/ui/app_list/demo/app_list_demo_views.cc
index 8c06045515e65c830f3ed3db74cf304dd470655e..ec1ce50a3fa817e3b315aa232058f5cdbe22cefb 100644
--- a/ui/app_list/demo/app_list_demo_views.cc
+++ b/ui/app_list/demo/app_list_demo_views.cc
@@ -36,7 +36,7 @@ class DemoAppListViewDelegate : public app_list::test::AppListTestViewDelegate {
: view_(NULL), browser_context_(browser_context) {}
virtual ~DemoAppListViewDelegate() {}
- app_list::AppListView* InitView(gfx::NativeView window_context);
+ app_list::AppListView* InitView(gfx::NativeWindow window_context);
// Overridden from AppListViewDelegate:
virtual void Dismiss() OVERRIDE;
@@ -52,10 +52,18 @@ class DemoAppListViewDelegate : public app_list::test::AppListTestViewDelegate {
};
app_list::AppListView* DemoAppListViewDelegate::InitView(
- gfx::NativeView window_context) {
+ gfx::NativeWindow window_context) {
+ gfx::NativeView container = NULL;
+ // On Ash, the app list is placed into an aura::Window container. For the demo
+ // use the root window context as the parent. This only works on Aura since an
+ // aura::Window is also a NativeView.
+#if defined(USE_AURA)
+ container = window_context;
+#endif
+
// Note AppListView takes ownership of |this| on the next line.
view_ = new app_list::AppListView(this);
- view_->InitAsBubbleAtFixedLocation(window_context,
+ view_->InitAsBubbleAtFixedLocation(container,
0,
gfx::Point(300, 300),
views::BubbleBorder::FLOAT,
@@ -100,7 +108,7 @@ views::View* DemoAppListViewDelegate::CreateStartPageWebView(
}
void ShowAppList(content::BrowserContext* browser_context,
- gfx::NativeView window_context) {
+ gfx::NativeWindow window_context) {
DemoAppListViewDelegate* delegate =
new DemoAppListViewDelegate(browser_context);
app_list::AppListView* view = delegate->InitView(window_context);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698