| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/oak/oak_window.h" | 5 #include "ui/oak/oak_window.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "grit/ui_resources.h" | 8 #include "grit/ui_resources.h" |
| 9 #include "ui/aura/root_window.h" | 9 #include "ui/aura/root_window.h" |
| 10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 details_->set_owned_by_client(); | 139 details_->set_owned_by_client(); |
| 140 details_container_ = details_->CreateParentIfNecessary(); | 140 details_container_ = details_->CreateParentIfNecessary(); |
| 141 details_->SetModel(details_model_.get()); | 141 details_->SetModel(details_model_.get()); |
| 142 AddChildView(details_container_); | 142 AddChildView(details_container_); |
| 143 | 143 |
| 144 OnTreeViewSelectionChanged(tree_.get()); | 144 OnTreeViewSelectionChanged(tree_.get()); |
| 145 } | 145 } |
| 146 | 146 |
| 147 } // namespace internal | 147 } // namespace internal |
| 148 | 148 |
| 149 void ShowOakWindow() { | 149 void ShowOakWindowWithContext(gfx::NativeView context) { |
| 150 if (!internal::OakWindow::instance) { | 150 if (!internal::OakWindow::instance) { |
| 151 // TODO(erg): Do we want to reuse this window in times with a different |
| 152 // context? For now, this is OK, but if we ever use Oak outside of the ash |
| 153 // shell, we run into crbug.com/165759. |
| 151 internal::OakWindow::instance = | 154 internal::OakWindow::instance = |
| 152 views::Widget::CreateWindowWithBounds(new internal::OakWindow, | 155 views::Widget::CreateWindowWithContextAndBounds( |
| 153 gfx::Rect(10, 10, 500, 500)); | 156 new internal::OakWindow, context, gfx::Rect(10, 10, 500, 500)); |
| 154 } | 157 } |
| 155 internal::OakWindow::instance->Show(); | 158 internal::OakWindow::instance->Show(); |
| 156 } | 159 } |
| 157 | 160 |
| 158 } // namespace oak | 161 } // namespace oak |
| OLD | NEW |