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

Unified Diff: ui/views/controls/tabbed_pane/tabbed_pane.cc

Issue 10797046: (Views only): Allow choosing between NativeTabbedPaneView and NativeTabbedPaneWin on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: "Fix file header *sigh*" Created 8 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 | « ui/views/controls/tabbed_pane/tabbed_pane.h ('k') | ui/views/controls/tabbed_pane/tabbed_pane_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/tabbed_pane/tabbed_pane.cc
diff --git a/ui/views/controls/tabbed_pane/tabbed_pane.cc b/ui/views/controls/tabbed_pane/tabbed_pane.cc
index b5dc08d965690596c543fe5a93e1d6f319309d87..1bbac8e7177af36671152271a97ed2067a353688 100644
--- a/ui/views/controls/tabbed_pane/tabbed_pane.cc
+++ b/ui/views/controls/tabbed_pane/tabbed_pane.cc
@@ -8,16 +8,41 @@
#include "ui/base/accessibility/accessible_view_state.h"
#include "ui/base/keycodes/keyboard_codes.h"
#include "ui/views/controls/native/native_view_host.h"
+#include "ui/views/controls/tabbed_pane/native_tabbed_pane_views.h"
#include "ui/views/controls/tabbed_pane/native_tabbed_pane_wrapper.h"
#include "ui/views/controls/tabbed_pane/tabbed_pane_listener.h"
#include "ui/views/widget/widget.h"
+// TODO(markusheintz): This should be removed once the native Windows tabbed
+// pane is not used anymore (http://crbug.com/138059).
+#if defined(OS_WIN) && !defined(USE_AURA)
+#include "ui/views/controls/tabbed_pane/native_tabbed_pane_win.h"
+#endif
+
+namespace {
+
+views::NativeTabbedPaneWrapper* CreateNativeWrapper(
+ views::TabbedPane* tabbed_pane) {
+#if defined(OS_WIN) && !defined(USE_AURA)
+ if (tabbed_pane->use_native_win_control())
+ return new views::NativeTabbedPaneWin(tabbed_pane);
+#endif
+ return new views::NativeTabbedPaneViews(tabbed_pane);
+}
+
+} // namespace
+
namespace views {
// static
const char TabbedPane::kViewClassName[] = "views/TabbedPane";
-TabbedPane::TabbedPane() : native_tabbed_pane_(NULL), listener_(NULL) {
+TabbedPane::TabbedPane()
+ : native_tabbed_pane_(NULL),
+#if defined(OS_WIN) && !defined(USE_AURA)
+ use_native_win_control_(false),
+#endif
+ listener_(NULL) {
set_focusable(true);
}
@@ -86,7 +111,7 @@ void TabbedPane::ViewHierarchyChanged(bool is_add, View* parent, View* child) {
if (is_add && !native_tabbed_pane_) {
// The native wrapper's lifetime will be managed by the view hierarchy after
// we call AddChildView.
- native_tabbed_pane_ = NativeTabbedPaneWrapper::CreateNativeWrapper(this);
+ native_tabbed_pane_ = CreateNativeWrapper(this);
AddChildView(native_tabbed_pane_->GetView());
LoadAccelerators();
}
« no previous file with comments | « ui/views/controls/tabbed_pane/tabbed_pane.h ('k') | ui/views/controls/tabbed_pane/tabbed_pane_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698