summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-18 23:46:33 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-18 23:46:33 +0000
commit71b68126dfbd5f25a2bc01438ddc42a9ec60f5be (patch)
tree081530c9a8105bab20deab6ad5881885cc40f8ad /views
parent4e2b46857273c996b027d78353687281ffb3c9d8 (diff)
downloadchromium_src-71b68126dfbd5f25a2bc01438ddc42a9ec60f5be.zip
chromium_src-71b68126dfbd5f25a2bc01438ddc42a9ec60f5be.tar.gz
chromium_src-71b68126dfbd5f25a2bc01438ddc42a9ec60f5be.tar.bz2
views: Cleanup TabbedPane class.
BUG=None TEST=views_examples, and existing views_unittests R=sky@chromium.org Review URL: http://codereview.chromium.org/6685039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78775 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/controls/tabbed_pane/native_tabbed_pane_gtk.cc33
-rw-r--r--views/controls/tabbed_pane/native_tabbed_pane_gtk.h40
-rw-r--r--views/controls/tabbed_pane/native_tabbed_pane_win.cc1
-rw-r--r--views/controls/tabbed_pane/tabbed_pane.cc58
-rw-r--r--views/controls/tabbed_pane/tabbed_pane.h64
-rw-r--r--views/controls/tabbed_pane/tabbed_pane_listener.h21
-rw-r--r--views/examples/example_base.cc3
-rw-r--r--views/examples/examples_main.cc25
-rw-r--r--views/examples/tabbed_pane_example.cc2
-rw-r--r--views/examples/tabbed_pane_example.h30
-rw-r--r--views/focus/focus_manager_unittest.cc10
-rw-r--r--views/views.gyp9
12 files changed, 164 insertions, 132 deletions
diff --git a/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc b/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc
index 50b62c6..836d8f3 100644
--- a/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc
+++ b/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc
@@ -14,6 +14,7 @@
#include "ui/gfx/skia_utils_gtk.h"
#include "views/background.h"
#include "views/controls/tabbed_pane/tabbed_pane.h"
+#include "views/controls/tabbed_pane/tabbed_pane_listener.h"
#include "views/layout/fill_layout.h"
#include "views/widget/root_view.h"
#include "views/widget/widget_gtk.h"
@@ -33,13 +34,25 @@ NativeTabbedPaneGtk::~NativeTabbedPaneGtk() {
}
////////////////////////////////////////////////////////////////////////////////
+// NativeTabbedPaneGtk, NativeControlGtk implementation:
+
+void NativeTabbedPaneGtk::CreateNativeControl() {
+ GtkWidget* widget = gtk_notebook_new();
+ gtk_notebook_set_tab_pos(GTK_NOTEBOOK(widget), GTK_POS_TOP);
+ g_signal_connect(widget, "switch-page",
+ G_CALLBACK(CallSwitchPage), this);
+ NativeControlCreated(widget);
+}
+
+////////////////////////////////////////////////////////////////////////////////
// NativeTabbedPaneGtk, NativeTabbedPaneWrapper implementation:
void NativeTabbedPaneGtk::AddTab(const std::wstring& title, View* contents) {
AddTabAtIndex(GetTabCount(), title, contents, true);
}
-void NativeTabbedPaneGtk::AddTabAtIndex(int index, const std::wstring& title,
+void NativeTabbedPaneGtk::AddTabAtIndex(int index,
+ const std::wstring& title,
View* contents,
bool select_if_first_tab) {
DCHECK(native_view());
@@ -126,18 +139,7 @@ gfx::NativeView NativeTabbedPaneGtk::GetTestingHandle() const {
}
////////////////////////////////////////////////////////////////////////////////
-// NativeTabbedPaneGtk, NativeControlGtk override:
-
-void NativeTabbedPaneGtk::CreateNativeControl() {
- GtkWidget* widget = gtk_notebook_new();
- gtk_notebook_set_tab_pos(GTK_NOTEBOOK(widget), GTK_POS_TOP);
- g_signal_connect(widget, "switch-page",
- G_CALLBACK(CallSwitchPage), this);
- NativeControlCreated(widget);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// NativeTabbedPaneGtk, View override:
+// NativeTabbedPaneGtk, View implementation:
FocusTraversable* NativeTabbedPaneGtk::GetFocusTraversable() {
return GetWidgetAt(GetSelectedTabIndex());
@@ -145,7 +147,8 @@ FocusTraversable* NativeTabbedPaneGtk::GetFocusTraversable() {
////////////////////////////////////////////////////////////////////////////////
// NativeTabbedPaneGtk, private:
-void NativeTabbedPaneGtk::DoAddTabAtIndex(int index, const std::wstring& title,
+void NativeTabbedPaneGtk::DoAddTabAtIndex(int index,
+ const std::wstring& title,
View* contents,
bool select_if_first_tab) {
int tab_count = GetTabCount();
@@ -208,7 +211,7 @@ View* NativeTabbedPaneGtk::GetTabViewAt(int index) {
}
void NativeTabbedPaneGtk::OnSwitchPage(int selected_tab_index) {
- TabbedPane::Listener* listener = tabbed_pane_->listener();
+ TabbedPaneListener* listener = tabbed_pane_->listener();
if (listener != NULL)
listener->TabSelectedAt(selected_tab_index);
}
diff --git a/views/controls/tabbed_pane/native_tabbed_pane_gtk.h b/views/controls/tabbed_pane/native_tabbed_pane_gtk.h
index b477a62..6b25032 100644
--- a/views/controls/tabbed_pane/native_tabbed_pane_gtk.h
+++ b/views/controls/tabbed_pane/native_tabbed_pane_gtk.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -6,6 +6,8 @@
#define VIEWS_CONTROLS_TABBED_PANE_NATIVE_TABBED_PANE_GTK_H_
#pragma once
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
#include "views/controls/native_control_gtk.h"
#include "views/controls/tabbed_pane/native_tabbed_pane_wrapper.h"
@@ -19,27 +21,27 @@ class NativeTabbedPaneGtk : public NativeControlGtk,
explicit NativeTabbedPaneGtk(TabbedPane* tabbed_pane);
virtual ~NativeTabbedPaneGtk();
- // NativeTabbedPaneWrapper implementation:
- virtual void AddTab(const std::wstring& title, View* contents);
+ // NativeControlGtk:
+ virtual void CreateNativeControl() OVERRIDE;
+
+ // NativeTabbedPaneWrapper:
+ virtual void AddTab(const std::wstring& title, View* contents) OVERRIDE;
virtual void AddTabAtIndex(int index,
const std::wstring& title,
View* contents,
- bool select_if_first_tab);
- virtual View* RemoveTabAtIndex(int index);
- virtual void SelectTabAt(int index);
- virtual int GetTabCount();
- virtual int GetSelectedTabIndex();
- virtual View* GetSelectedTab();
- virtual View* GetView();
- virtual void SetFocus();
- virtual gfx::Size GetPreferredSize();
- virtual gfx::NativeView GetTestingHandle() const;
-
- // NativeControlGtk overrides.
- virtual void CreateNativeControl();
-
- // View override:
- virtual FocusTraversable* GetFocusTraversable();
+ bool select_if_first_tab) OVERRIDE;
+ virtual View* RemoveTabAtIndex(int index) OVERRIDE;
+ virtual void SelectTabAt(int index) OVERRIDE;
+ virtual int GetTabCount() OVERRIDE;
+ virtual int GetSelectedTabIndex() OVERRIDE;
+ virtual View* GetSelectedTab() OVERRIDE;
+ virtual View* GetView() OVERRIDE;
+ virtual void SetFocus() OVERRIDE;
+ virtual gfx::Size GetPreferredSize() OVERRIDE;
+ virtual gfx::NativeView GetTestingHandle() const OVERRIDE;
+
+ // View:
+ virtual FocusTraversable* GetFocusTraversable() OVERRIDE;
private:
void DoAddTabAtIndex(int index,
diff --git a/views/controls/tabbed_pane/native_tabbed_pane_win.cc b/views/controls/tabbed_pane/native_tabbed_pane_win.cc
index e694090..5176fd9 100644
--- a/views/controls/tabbed_pane/native_tabbed_pane_win.cc
+++ b/views/controls/tabbed_pane/native_tabbed_pane_win.cc
@@ -14,6 +14,7 @@
#include "ui/gfx/font.h"
#include "ui/gfx/native_theme_win.h"
#include "views/controls/tabbed_pane/tabbed_pane.h"
+#include "views/controls/tabbed_pane/tabbed_pane_listener.h"
#include "views/layout/fill_layout.h"
#include "views/widget/root_view.h"
#include "views/widget/widget_win.h"
diff --git a/views/controls/tabbed_pane/tabbed_pane.cc b/views/controls/tabbed_pane/tabbed_pane.cc
index 1091407..aba0f7b 100644
--- a/views/controls/tabbed_pane/tabbed_pane.cc
+++ b/views/controls/tabbed_pane/tabbed_pane.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -11,6 +11,7 @@
#include "ui/base/keycodes/keyboard_codes.h"
#include "views/controls/native/native_view_host.h"
#include "views/controls/tabbed_pane/native_tabbed_pane_wrapper.h"
+#include "views/controls/tabbed_pane/tabbed_pane_listener.h"
#include "views/widget/widget.h"
namespace views {
@@ -25,8 +26,16 @@ TabbedPane::TabbedPane() : native_tabbed_pane_(NULL), listener_(NULL) {
TabbedPane::~TabbedPane() {
}
-void TabbedPane::SetListener(Listener* listener) {
- listener_ = listener;
+int TabbedPane::GetTabCount() {
+ return native_tabbed_pane_->GetTabCount();
+}
+
+int TabbedPane::GetSelectedTabIndex() {
+ return native_tabbed_pane_->GetSelectedTabIndex();
+}
+
+View* TabbedPane::GetSelectedTab() {
+ return native_tabbed_pane_->GetSelectedTab();
}
void TabbedPane::AddTab(const std::wstring& title, View* contents) {
@@ -43,14 +52,6 @@ void TabbedPane::AddTabAtIndex(int index,
PreferredSizeChanged();
}
-int TabbedPane::GetSelectedTabIndex() {
- return native_tabbed_pane_->GetSelectedTabIndex();
-}
-
-View* TabbedPane::GetSelectedTab() {
- return native_tabbed_pane_->GetSelectedTab();
-}
-
View* TabbedPane::RemoveTabAtIndex(int index) {
View* tab = native_tabbed_pane_->RemoveTabAtIndex(index);
PreferredSizeChanged();
@@ -65,17 +66,25 @@ void TabbedPane::SetAccessibleName(const string16& name) {
accessible_name_ = name;
}
-int TabbedPane::GetTabCount() {
- return native_tabbed_pane_->GetTabCount();
+gfx::Size TabbedPane::GetPreferredSize() {
+ return native_tabbed_pane_ ?
+ native_tabbed_pane_->GetPreferredSize() : gfx::Size();
}
void TabbedPane::CreateWrapper() {
native_tabbed_pane_ = NativeTabbedPaneWrapper::CreateNativeWrapper(this);
}
-// View overrides:
-std::string TabbedPane::GetClassName() const {
- return kViewClassName;
+void TabbedPane::LoadAccelerators() {
+ // Ctrl+Shift+Tab
+ AddAccelerator(views::Accelerator(ui::VKEY_TAB, true, true, false));
+ // Ctrl+Tab
+ AddAccelerator(views::Accelerator(ui::VKEY_TAB, false, true, false));
+}
+
+void TabbedPane::Layout() {
+ if (native_tabbed_pane_)
+ native_tabbed_pane_->GetView()->SetBounds(0, 0, width(), height());
}
void TabbedPane::ViewHierarchyChanged(bool is_add, View* parent, View* child) {
@@ -105,16 +114,8 @@ bool TabbedPane::AcceleratorPressed(const views::Accelerator& accelerator) {
return true;
}
-void TabbedPane::LoadAccelerators() {
- // Ctrl+Shift+Tab
- AddAccelerator(views::Accelerator(ui::VKEY_TAB, true, true, false));
- // Ctrl+Tab
- AddAccelerator(views::Accelerator(ui::VKEY_TAB, false, true, false));
-}
-
-void TabbedPane::Layout() {
- if (native_tabbed_pane_)
- native_tabbed_pane_->GetView()->SetBounds(0, 0, width(), height());
+std::string TabbedPane::GetClassName() const {
+ return kViewClassName;
}
void TabbedPane::OnFocus() {
@@ -143,9 +144,4 @@ void TabbedPane::GetAccessibleState(ui::AccessibleViewState* state) {
state->name = accessible_name_;
}
-gfx::Size TabbedPane::GetPreferredSize() {
- return native_tabbed_pane_ ?
- native_tabbed_pane_->GetPreferredSize() : gfx::Size();
-}
-
} // namespace views
diff --git a/views/controls/tabbed_pane/tabbed_pane.h b/views/controls/tabbed_pane/tabbed_pane.h
index a968d36..eeef7a8 100644
--- a/views/controls/tabbed_pane/tabbed_pane.h
+++ b/views/controls/tabbed_pane/tabbed_pane.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -6,27 +6,28 @@
#define VIEWS_CONTROLS_TABBED_PANE_H_
#pragma once
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
#include "views/view.h"
namespace views {
class NativeTabbedPaneWrapper;
+class TabbedPaneListener;
-// The TabbedPane class is a view that shows tabs. When the user clicks on a
-// tab, the associated view is displayed.
+// TabbedPane is a view that shows tabs. When the user clicks on a tab, the
+// associated view is displayed.
class TabbedPane : public View {
public:
TabbedPane();
virtual ~TabbedPane();
- // An interface an object can implement to be notified about events within
- // the TabbedPane.
- class Listener {
- public:
- // Called when the tab at the specified |index| is selected by the user.
- virtual void TabSelectedAt(int index) = 0;
- };
- void SetListener(Listener* listener);
+ TabbedPaneListener* listener() const { return listener_; }
+ void set_listener(TabbedPaneListener* listener) { listener_ = listener; }
+
+ NativeTabbedPaneWrapper* native_wrapper() const {
+ return native_tabbed_pane_;
+ }
// Returns the number of tabs.
int GetTabCount();
@@ -42,7 +43,7 @@ class TabbedPane : public View {
// the TabbedPane.
void AddTab(const std::wstring& title, View* contents);
- // Adds a new tab at the specified |index| with the specified |title|.
+ // Adds a new tab at |index| with |title|.
// |contents| is the view displayed when the tab is selected and is owned by
// the TabbedPane. If |select_if_first_tab| is true and the tabbed pane is
// currently empty, the new tab is selected. If you pass in false for
@@ -53,34 +54,18 @@ class TabbedPane : public View {
View* contents,
bool select_if_first_tab);
- // Removes the tab at the specified |index| and returns the associated content
- // view. The caller becomes the owner of the returned view.
+ // Removes the tab at |index| and returns the associated content view.
+ // The caller becomes the owner of the returned view.
View* RemoveTabAtIndex(int index);
- // Selects the tab at the specified |index|, which must be valid.
+ // Selects the tab at |index|, which must be valid.
void SelectTabAt(int index);
- Listener* listener() const { return listener_; }
-
void SetAccessibleName(const string16& name);
- // View overrides:
- virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child)
- OVERRIDE;
- // Handles Ctrl+Tab and Ctrl+Shift+Tab navigation of pages.
- virtual bool AcceleratorPressed(const views::Accelerator& accelerator)
- OVERRIDE;
- virtual std::string GetClassName() const OVERRIDE;
- virtual void Layout() OVERRIDE;
- virtual void OnFocus() OVERRIDE;
- virtual void OnPaintFocusBorder(gfx::Canvas* canvas) OVERRIDE;
- virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
+ // View:
virtual gfx::Size GetPreferredSize() OVERRIDE;
- NativeTabbedPaneWrapper* native_wrapper() const {
- return native_tabbed_pane_;
- }
-
protected:
// The object that actually implements the tabbed-pane.
// Protected for tests access.
@@ -96,8 +81,21 @@ class TabbedPane : public View {
// We support Ctrl+Tab and Ctrl+Shift+Tab to navigate tabbed option pages.
void LoadAccelerators();
+ // View:
+ virtual void Layout() OVERRIDE;
+ virtual void ViewHierarchyChanged(bool is_add,
+ View* parent,
+ View* child) OVERRIDE;
+ // Handles Ctrl+Tab and Ctrl+Shift+Tab navigation of pages.
+ virtual bool AcceleratorPressed(
+ const views::Accelerator& accelerator) OVERRIDE;
+ virtual std::string GetClassName() const OVERRIDE;
+ virtual void OnFocus() OVERRIDE;
+ virtual void OnPaintFocusBorder(gfx::Canvas* canvas) OVERRIDE;
+ virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
+
// The listener we notify about tab selection changes.
- Listener* listener_;
+ TabbedPaneListener* listener_;
// The accessible name of this view.
string16 accessible_name_;
diff --git a/views/controls/tabbed_pane/tabbed_pane_listener.h b/views/controls/tabbed_pane/tabbed_pane_listener.h
new file mode 100644
index 0000000..a274b7e
--- /dev/null
+++ b/views/controls/tabbed_pane/tabbed_pane_listener.h
@@ -0,0 +1,21 @@
+// Copyright (c) 2011 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.
+
+#ifndef VIEWS_CONTROLS_TABBED_PANE_TABBED_PANE_LISTENER_H_
+#define VIEWS_CONTROLS_TABBED_PANE_TABBED_PANE_LISTENER_H_
+#pragma once
+
+namespace views {
+
+// An interface implemented by an object to let it know that a tabbed pane was
+// selected by the user at the specified index.
+class TabbedPaneListener {
+ public:
+ // Called when the tab at |index| is selected by the user.
+ virtual void TabSelectedAt(int index) = 0;
+};
+
+} // namespace views
+
+#endif // VIEWS_CONTROLS_TABBED_PANE_TABBED_PANE_LISTENER_H_
diff --git a/views/examples/example_base.cc b/views/examples/example_base.cc
index c73caf9..af1271c 100644
--- a/views/examples/example_base.cc
+++ b/views/examples/example_base.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -10,7 +10,6 @@
#include "base/string_util.h"
#include "base/stringprintf.h"
#include "views/controls/button/text_button.h"
-#include "views/controls/tabbed_pane/tabbed_pane.h"
#include "views/examples/examples_main.h"
#if defined(OS_CHROMEOS)
diff --git a/views/examples/examples_main.cc b/views/examples/examples_main.cc
index 7346abc..0ab98f6 100644
--- a/views/examples/examples_main.cc
+++ b/views/examples/examples_main.cc
@@ -11,24 +11,17 @@
#include "base/process_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
-#include "views/controls/label.h"
#include "views/controls/button/text_button.h"
+#include "views/controls/label.h"
+#include "views/controls/tabbed_pane/tabbed_pane.h"
#include "views/examples/button_example.h"
#include "views/examples/combobox_example.h"
-#include "views/examples/message_box_example.h"
#include "views/examples/menu_example.h"
+#include "views/examples/message_box_example.h"
#include "views/examples/radio_button_example.h"
#include "views/examples/scroll_view_example.h"
#include "views/examples/single_split_view_example.h"
-// Slider is not yet ported to Windows.
-#if defined(OS_LINUX)
-#include "views/examples/slider_example.h"
-#endif
#include "views/examples/tabbed_pane_example.h"
-#if defined(OS_WIN)
-// TableView is not yet ported to Linux.
-#include "views/examples/table_example.h"
-#endif
#include "views/examples/table2_example.h"
#include "views/examples/textfield_example.h"
#include "views/examples/throbber_example.h"
@@ -37,10 +30,18 @@
#include "views/layout/grid_layout.h"
#include "views/window/window.h"
+#if defined(OS_LINUX)
+// Slider is not yet ported to Windows.
+#include "views/examples/slider_example.h"
+#endif
+#if defined(OS_WIN)
+// TableView is not yet ported to Linux.
+#include "views/examples/table_example.h"
+#endif
+
namespace examples {
-ExamplesMain::ExamplesMain()
- : contents_(NULL), status_label_(NULL) {}
+ExamplesMain::ExamplesMain() : contents_(NULL), status_label_(NULL) {}
ExamplesMain::~ExamplesMain() {}
diff --git a/views/examples/tabbed_pane_example.cc b/views/examples/tabbed_pane_example.cc
index 15516a8..fd290a9 100644
--- a/views/examples/tabbed_pane_example.cc
+++ b/views/examples/tabbed_pane_example.cc
@@ -4,6 +4,7 @@
#include "views/examples/tabbed_pane_example.h"
+#include "views/controls/tabbed_pane/tabbed_pane.h"
#include "views/layout/grid_layout.h"
namespace examples {
@@ -21,6 +22,7 @@ std::wstring TabbedPaneExample::GetExampleTitle() {
void TabbedPaneExample::CreateExampleView(views::View* container) {
tabbed_pane_ = new views::TabbedPane();
+ tabbed_pane_->set_listener(this);
add_ = new views::TextButton(this, L"Add");
add_at_ = new views::TextButton(this, L"Add At 1");
remove_at_ = new views::TextButton(this, L"Remove At 1");
diff --git a/views/examples/tabbed_pane_example.h b/views/examples/tabbed_pane_example.h
index 649c2b72..aa50c48 100644
--- a/views/examples/tabbed_pane_example.h
+++ b/views/examples/tabbed_pane_example.h
@@ -6,30 +6,37 @@
#define VIEWS_EXAMPLES_TABBED_PANE_EXAMPLE_H_
#pragma once
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
#include "views/controls/button/text_button.h"
+#include "views/controls/tabbed_pane/tabbed_pane_listener.h"
#include "views/examples/example_base.h"
-#include "views/controls/tabbed_pane/tabbed_pane.h"
+
+namespace views {
+class TabbedPane;
+}
namespace examples {
// A TabbedPane example tests adding/removing/selecting tabs.
class TabbedPaneExample : public ExampleBase,
public views::ButtonListener,
- public views::TabbedPane::Listener {
+ public views::TabbedPaneListener {
public:
explicit TabbedPaneExample(ExamplesMain* main);
virtual ~TabbedPaneExample();
- // Overridden from ExampleBase:
- virtual std::wstring GetExampleTitle();
- virtual void CreateExampleView(views::View* container);
+ // ExampleBase:
+ virtual std::wstring GetExampleTitle() OVERRIDE;
+ virtual void CreateExampleView(views::View* container) OVERRIDE;
private:
- // Overridden from views::ButtonListener:
- virtual void ButtonPressed(views::Button* sender, const views::Event& event);
+ // views::ButtonListener:
+ virtual void ButtonPressed(views::Button* sender,
+ const views::Event& event) OVERRIDE;
- // Overridden from views::TabbedPane::Listener:
- virtual void TabSelectedAt(int index);
+ // views::TabbedPaneListener:
+ virtual void TabSelectedAt(int index) OVERRIDE;
// Print the status of the tab in the status area.
void PrintStatus();
@@ -40,7 +47,10 @@ class TabbedPaneExample : public ExampleBase,
views::TabbedPane* tabbed_pane_;
// Control buttons to add, remove or select tabs.
- views::Button* add_, *add_at_, *remove_at_, *select_at_;
+ views::Button* add_;
+ views::Button* add_at_;
+ views::Button* remove_at_;
+ views::Button* select_at_;
DISALLOW_COPY_AND_ASSIGN(TabbedPaneExample);
};
diff --git a/views/focus/focus_manager_unittest.cc b/views/focus/focus_manager_unittest.cc
index a90da38..53f2527 100644
--- a/views/focus/focus_manager_unittest.cc
+++ b/views/focus/focus_manager_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -22,10 +22,10 @@
#include "views/controls/label.h"
#include "views/controls/link.h"
#include "views/controls/native/native_view_host.h"
-#include "views/controls/textfield/textfield.h"
#include "views/controls/scroll_view.h"
#include "views/controls/tabbed_pane/native_tabbed_pane_wrapper.h"
#include "views/controls/tabbed_pane/tabbed_pane.h"
+#include "views/controls/textfield/textfield.h"
#include "views/focus/accelerator_handler.h"
#include "views/widget/root_view.h"
#include "views/window/non_client_view.h"
@@ -40,8 +40,6 @@
#include "views/window/window_gtk.h"
#endif
-using ui::ComboboxModel; // TODO(beng): remove
-
namespace {
const int kWindowWidth = 600;
const int kWindowHeight = 500;
@@ -322,7 +320,7 @@ class BorderView : public NativeViewHost {
DISALLOW_COPY_AND_ASSIGN(BorderView);
};
-class DummyComboboxModel : public ComboboxModel {
+class DummyComboboxModel : public ui::ComboboxModel {
public:
virtual int GetItemCount() { return 10; }
@@ -902,7 +900,7 @@ class TestTextfield : public Textfield {
}
};
-class TestCombobox : public Combobox, public ComboboxModel {
+class TestCombobox : public Combobox, public ui::ComboboxModel {
public:
TestCombobox() : Combobox(this) { }
virtual gfx::NativeView TestGetNativeControlView() {
diff --git a/views/views.gyp b/views/views.gyp
index 9570d91..4321af2 100644
--- a/views/views.gyp
+++ b/views/views.gyp
@@ -208,18 +208,19 @@
'controls/separator.h',
'controls/single_split_view.cc',
'controls/single_split_view.h',
- 'controls/slider/slider.cc',
- 'controls/slider/slider.h',
'controls/slider/native_slider_gtk.cc',
'controls/slider/native_slider_gtk.h',
'controls/slider/native_slider_wrapper.h',
- 'controls/tabbed_pane/tabbed_pane.cc',
- 'controls/tabbed_pane/tabbed_pane.h',
+ 'controls/slider/slider.cc',
+ 'controls/slider/slider.h',
'controls/tabbed_pane/native_tabbed_pane_gtk.cc',
'controls/tabbed_pane/native_tabbed_pane_gtk.h',
'controls/tabbed_pane/native_tabbed_pane_win.cc',
'controls/tabbed_pane/native_tabbed_pane_win.h',
'controls/tabbed_pane/native_tabbed_pane_wrapper.h',
+ 'controls/tabbed_pane/tabbed_pane.cc',
+ 'controls/tabbed_pane/tabbed_pane.h',
+ 'controls/tabbed_pane/tabbed_pane_listener.h',
'controls/table/native_table_wrapper.h',
'controls/table/native_table_gtk.cc',
'controls/table/native_table_gtk.h',