diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-28 06:32:33 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-28 06:32:33 +0000 |
commit | 6827766b1fcc5885b7a8bc8c707e283f71f46f09 (patch) | |
tree | 11dc18b19363119d8ab06faf6521b8d6d4d94d52 /views | |
parent | ce681a8b14c05752f9279e7ed945943506f7d628 (diff) | |
download | chromium_src-6827766b1fcc5885b7a8bc8c707e283f71f46f09.zip chromium_src-6827766b1fcc5885b7a8bc8c707e283f71f46f09.tar.gz chromium_src-6827766b1fcc5885b7a8bc8c707e283f71f46f09.tar.bz2 |
Create views.dll / libviews.so
R=sky@chromium.org,rvargas@chromium.org
Review URL: http://codereview.chromium.org/7493017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94428 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
105 files changed, 309 insertions, 239 deletions
diff --git a/views/accelerator.h b/views/accelerator.h index a6cbaf4..20638b3 100644 --- a/views/accelerator.h +++ b/views/accelerator.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. @@ -17,10 +17,11 @@ #include "base/string16.h" #include "ui/base/models/accelerator.h" #include "views/events/event.h" +#include "views/views_api.h" namespace views { -class Accelerator : public ui::Accelerator { +class VIEWS_API Accelerator : public ui::Accelerator { public: Accelerator() : ui::Accelerator() {} @@ -59,7 +60,7 @@ class Accelerator : public ui::Accelerator { // An interface that classes that want to register for keyboard accelerators // should implement. -class AcceleratorTarget { +class VIEWS_API AcceleratorTarget { public: // This method should return true if the accelerator was processed. virtual bool AcceleratorPressed(const Accelerator& accelerator) = 0; diff --git a/views/animation/bounds_animator.h b/views/animation/bounds_animator.h index 6785e43..a044ede 100644 --- a/views/animation/bounds_animator.h +++ b/views/animation/bounds_animator.h @@ -12,6 +12,7 @@ #include "ui/base/animation/animation_container_observer.h" #include "ui/base/animation/animation_delegate.h" #include "ui/gfx/rect.h" +#include "views/views_api.h" namespace ui { class SlideAnimation; @@ -38,8 +39,8 @@ class BoundsAnimatorObserver { // You can attach an AnimationDelegate to the individual animation for a view // by way of SetAnimationDelegate. Additionally you can attach an observer to // the BoundsAnimator that is notified when all animations are complete. -class BoundsAnimator : public ui::AnimationDelegate, - public ui::AnimationContainerObserver { +class VIEWS_API BoundsAnimator : public ui::AnimationDelegate, + public ui::AnimationContainerObserver { public: // If |delete_when_done| is set to true in |SetAnimationDelegate| the // |AnimationDelegate| must subclass this class. diff --git a/views/background.h b/views/background.h index abed279..615b358 100644 --- a/views/background.h +++ b/views/background.h @@ -14,6 +14,7 @@ #include "base/basictypes.h" #include "third_party/skia/include/core/SkColor.h" +#include "views/views_api.h" namespace gfx { class Canvas; @@ -36,7 +37,7 @@ class View; // View::OnPaintBackground() // ///////////////////////////////////////////////////////////////////////////// -class Background { +class VIEWS_API Background { public: Background(); virtual ~Background(); diff --git a/views/border.h b/views/border.h index 15d94b0..3d57c5d 100644 --- a/views/border.h +++ b/views/border.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 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. @@ -34,7 +34,7 @@ class View; // //////////////////////////////////////////////////////////////////////////////// -class Border { +class VIEWS_API Border { public: Border(); virtual ~Border(); diff --git a/views/context_menu_controller.h b/views/context_menu_controller.h index d65bb1a..123400d 100644 --- a/views/context_menu_controller.h +++ b/views/context_menu_controller.h @@ -6,6 +6,8 @@ #define VIEWS_CONTEXT_MENU_CONTROLLER_H_ #pragma once +#include "views/views_api.h" + namespace gfx { class Point; } @@ -24,7 +26,7 @@ class View; // It is up to subclasses that do their own mouse processing to invoke // the appropriate ContextMenuController method, typically by invoking super's // implementation for mouse processing. -class ContextMenuController { +class VIEWS_API ContextMenuController { public: // Invoked to show the context menu for the source view. If |is_mouse_gesture| // is true, |p| is the location of the mouse. If |is_mouse_gesture| is false, diff --git a/views/controls/button/button.h b/views/controls/button/button.h index 0c9c6c7..c58433f 100644 --- a/views/controls/button/button.h +++ b/views/controls/button/button.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. @@ -15,7 +15,7 @@ class Event; // An interface implemented by an object to let it know that a button was // pressed. -class ButtonListener { +class VIEWS_API ButtonListener { public: virtual void ButtonPressed(Button* sender, const views::Event& event) = 0; @@ -25,7 +25,7 @@ class ButtonListener { // A View representing a button. Depending on the specific type, the button // could be implemented by a native control or custom rendered. -class Button : public View { +class VIEWS_API Button : public View { public: virtual ~Button(); diff --git a/views/controls/button/button_dropdown.h b/views/controls/button/button_dropdown.h index c94f657..950aec8 100644 --- a/views/controls/button/button_dropdown.h +++ b/views/controls/button/button_dropdown.h @@ -23,7 +23,7 @@ namespace views { // display a menu // //////////////////////////////////////////////////////////////////////////////// -class ButtonDropDown : public ImageButton { +class VIEWS_API ButtonDropDown : public ImageButton { public: // The button's class name. static const char kViewClassName[]; diff --git a/views/controls/button/checkbox.h b/views/controls/button/checkbox.h index 648087d..583dc5d 100644 --- a/views/controls/button/checkbox.h +++ b/views/controls/button/checkbox.h @@ -14,7 +14,7 @@ namespace views { // A native themed class representing a checkbox. This class does not use // platform specific objects to replicate the native platforms looks and feel. -class Checkbox : public TextButtonBase { +class VIEWS_API Checkbox : public TextButtonBase { public: // The button's class name. static const char kViewClassName[]; diff --git a/views/controls/button/custom_button.h b/views/controls/button/custom_button.h index 4c414de..ce45405 100644 --- a/views/controls/button/custom_button.h +++ b/views/controls/button/custom_button.h @@ -20,8 +20,8 @@ namespace views { // Note that this type of button is not focusable by default and will not be // part of the focus chain. Call set_focusable(true) to make it part of the // focus chain. -class CustomButton : public Button, - public ui::AnimationDelegate { +class VIEWS_API CustomButton : public Button, + public ui::AnimationDelegate { public: // The menu button's class name. static const char kViewClassName[]; diff --git a/views/controls/button/image_button.h b/views/controls/button/image_button.h index daac44c..5e11244 100644 --- a/views/controls/button/image_button.h +++ b/views/controls/button/image_button.h @@ -17,7 +17,7 @@ namespace views { // part of the focus chain. Call set_focusable(true) to make it part of the // focus chain. -class ImageButton : public CustomButton { +class VIEWS_API ImageButton : public CustomButton { public: explicit ImageButton(ButtonListener* listener); virtual ~ImageButton(); @@ -79,7 +79,7 @@ class ImageButton : public CustomButton { // A toggle-able ImageButton. It swaps out its graphics when toggled. // //////////////////////////////////////////////////////////////////////////////// -class ToggleImageButton : public ImageButton { +class VIEWS_API ToggleImageButton : public ImageButton { public: explicit ToggleImageButton(ButtonListener* listener); virtual ~ToggleImageButton(); diff --git a/views/controls/button/menu_button.h b/views/controls/button/menu_button.h index edab18b..2cc88bf 100644 --- a/views/controls/button/menu_button.h +++ b/views/controls/button/menu_button.h @@ -26,7 +26,7 @@ class ViewMenuDelegate; // A button that shows a menu when the left mouse button is pushed // //////////////////////////////////////////////////////////////////////////////// -class MenuButton : public TextButton { +class VIEWS_API MenuButton : public TextButton { public: // The menu button's class name. static const char kViewClassName[]; diff --git a/views/controls/button/radio_button.h b/views/controls/button/radio_button.h index 330b213..a56b256 100644 --- a/views/controls/button/radio_button.h +++ b/views/controls/button/radio_button.h @@ -12,7 +12,7 @@ namespace views { // A native themed class representing a radio button. This class does not use // platform specific objects to replicate the native platforms looks and feel. -class RadioButton : public Checkbox { +class VIEWS_API RadioButton : public Checkbox { public: // The button's class name. static const char kViewClassName[]; diff --git a/views/controls/button/text_button.h b/views/controls/button/text_button.h index 6df95da..ced8f58 100644 --- a/views/controls/button/text_button.h +++ b/views/controls/button/text_button.h @@ -31,7 +31,7 @@ namespace views { // focus chain. // //////////////////////////////////////////////////////////////////////////////// -class TextButtonBorder : public Border { +class VIEWS_API TextButtonBorder : public Border { public: TextButtonBorder(); virtual ~TextButtonBorder(); @@ -90,7 +90,7 @@ class TextButtonBorder : public Border { // states, with possible animation between states. // //////////////////////////////////////////////////////////////////////////////// -class TextButtonNativeThemeBorder : public Border { +class VIEWS_API TextButtonNativeThemeBorder : public Border { public: TextButtonNativeThemeBorder(NativeThemeDelegate* delegate); virtual ~TextButtonNativeThemeBorder(); @@ -117,7 +117,8 @@ class TextButtonNativeThemeBorder : public Border { // passed to SetText. To reset the cached max size invoke ClearMaxTextSize. // //////////////////////////////////////////////////////////////////////////////// -class TextButtonBase : public CustomButton, public NativeThemeDelegate { +class VIEWS_API TextButtonBase : public CustomButton, + public NativeThemeDelegate { public: // The menu button's class name. static const char kViewClassName[]; @@ -313,7 +314,7 @@ class TextButtonBase : public CustomButton, public NativeThemeDelegate { // passed to SetText. To reset the cached max size invoke ClearMaxTextSize. // //////////////////////////////////////////////////////////////////////////////// -class TextButton : public TextButtonBase { +class VIEWS_API TextButton : public TextButtonBase { public: // The button's class name. static const char kViewClassName[]; @@ -398,7 +399,7 @@ class TextButton : public TextButtonBase { // like ignore-minimize-size and text alignment minimum size. // //////////////////////////////////////////////////////////////////////////////// -class NativeTextButton : public TextButton { +class VIEWS_API NativeTextButton : public TextButton { public: // The button's class name. static const char kViewClassName[]; diff --git a/views/controls/combobox/combobox.h b/views/controls/combobox/combobox.h index 483238d..6a472b5 100644 --- a/views/controls/combobox/combobox.h +++ b/views/controls/combobox/combobox.h @@ -8,12 +8,9 @@ #include <string> -#include "views/view.h" - -#ifdef UNIT_TEST #include "ui/gfx/native_widget_types.h" #include "views/controls/combobox/native_combobox_wrapper.h" -#endif +#include "views/view.h" namespace ui { class ComboboxModel; @@ -22,10 +19,8 @@ using ui::ComboboxModel; namespace views { -class NativeComboboxWrapper; - // A non-editable combo-box (aka a drop-down list) -class Combobox : public View { +class VIEWS_API Combobox : public View { public: // The combobox's class name. static const char kViewClassName[]; @@ -66,14 +61,13 @@ class Combobox : public View { // Set the accessible name of the combo box. void SetAccessibleName(const string16& name); -#ifdef UNIT_TEST + // Provided only for testing: gfx::NativeView GetTestingHandle() const { return native_wrapper_ ? native_wrapper_->GetTestingHandle() : NULL; } - NativeComboboxWrapper* native_wrapper() const { + NativeComboboxWrapper* GetNativeWrapperForTesting() const { return native_wrapper_; } -#endif // Overridden from View: virtual gfx::Size GetPreferredSize() OVERRIDE; diff --git a/views/controls/combobox/native_combobox_views_unittest.cc b/views/controls/combobox/native_combobox_views_unittest.cc index 31aa194..4ebf021 100644 --- a/views/controls/combobox/native_combobox_views_unittest.cc +++ b/views/controls/combobox/native_combobox_views_unittest.cc @@ -109,8 +109,8 @@ class NativeComboboxViewsTest : public ViewsTestBase { widget_->SetContentsView(container); container->AddChildView(combobox_); - combobox_view_ - = static_cast<NativeComboboxViews*>(combobox_->native_wrapper()); + combobox_view_ = static_cast<NativeComboboxViews*>( + combobox_->GetNativeWrapperForTesting()); ASSERT_TRUE(combobox_view_); input_method_ = new MockInputMethod(); diff --git a/views/controls/combobox/native_combobox_wrapper.h b/views/controls/combobox/native_combobox_wrapper.h index 7d88563a..f84225a 100644 --- a/views/controls/combobox/native_combobox_wrapper.h +++ b/views/controls/combobox/native_combobox_wrapper.h @@ -7,6 +7,7 @@ #pragma once #include "ui/gfx/native_widget_types.h" +#include "views/views_api.h" namespace gfx{ class Size; @@ -18,7 +19,7 @@ class Combobox; class KeyEvent; class View; -class NativeComboboxWrapper { +class VIEWS_API NativeComboboxWrapper { public: // Updates the combobox's content from its model. virtual void UpdateFromModel() = 0; diff --git a/views/controls/image_view.h b/views/controls/image_view.h index c88cca4..7096c29 100644 --- a/views/controls/image_view.h +++ b/views/controls/image_view.h @@ -25,7 +25,7 @@ namespace views { // provided image size. // ///////////////////////////////////////////////////////////////////////////// -class ImageView : public View { +class VIEWS_API ImageView : public View { public: enum Alignment { LEADING = 0, diff --git a/views/controls/label.cc b/views/controls/label.cc index 83dd8d6..fe32884 100644 --- a/views/controls/label.cc +++ b/views/controls/label.cc @@ -23,9 +23,12 @@ namespace views { +// The colors to use for enabled and disabled labels. +static SkColor kEnabledColor; +static SkColor kDisabledColor; + // static const char Label::kViewClassName[] = "views/Label"; -SkColor Label::kEnabledColor, Label::kDisabledColor; const int Label::kFocusBorderPadding = 1; diff --git a/views/controls/label.h b/views/controls/label.h index a053e44..8615a9d 100644 --- a/views/controls/label.h +++ b/views/controls/label.h @@ -23,7 +23,7 @@ namespace views { // A label is a view subclass that can display a string. // ///////////////////////////////////////////////////////////////////////////// -class Label : public View { +class VIEWS_API Label : public View { public: enum Alignment { ALIGN_LEFT = 0, ALIGN_CENTER, @@ -231,9 +231,6 @@ class Label : public View { gfx::Rect* text_bounds, int* flags) const; - // The colors to use for enabled and disabled labels. - static SkColor kEnabledColor, kDisabledColor; - string16 text_; GURL url_; gfx::Font font_; diff --git a/views/controls/link.h b/views/controls/link.h index 548df6b..0ba6a38 100644 --- a/views/controls/link.h +++ b/views/controls/link.h @@ -22,7 +22,7 @@ class LinkListener; // controller which is notified when a click occurs. // //////////////////////////////////////////////////////////////////////////////// -class Link : public Label { +class VIEWS_API Link : public Label { public: Link(); explicit Link(const std::wstring& title); diff --git a/views/controls/menu/menu.h b/views/controls/menu/menu.h index 6699461..ee3f018f 100644 --- a/views/controls/menu/menu.h +++ b/views/controls/menu/menu.h @@ -10,6 +10,7 @@ #include "base/basictypes.h" #include "ui/gfx/native_widget_types.h" +#include "views/views_api.h" class SkBitmap; @@ -21,7 +22,7 @@ namespace views { class Accelerator; -class Menu { +class VIEWS_API Menu { public: ///////////////////////////////////////////////////////////////////////////// // @@ -31,7 +32,7 @@ class Menu { // item as it is created. // ///////////////////////////////////////////////////////////////////////////// - class Delegate { + class VIEWS_API Delegate { public: virtual ~Delegate() {} diff --git a/views/controls/menu/menu_2.h b/views/controls/menu/menu_2.h index 01cb51b..9357290 100644 --- a/views/controls/menu/menu_2.h +++ b/views/controls/menu/menu_2.h @@ -9,6 +9,7 @@ #include "base/memory/scoped_ptr.h" #include "ui/base/models/menu_model.h" #include "views/controls/menu/menu_wrapper.h" +#include "views/views_api.h" namespace gfx { class Point; @@ -24,7 +25,7 @@ class View; // WARNING: do NOT create and use Menu2 on the stack. Menu2 notifies the model // of selection AFTER a delay. This means that if use a Menu2 on the stack // ActivatedAt is never invoked. -class Menu2 { +class VIEWS_API Menu2 { public: // Creates a new menu populated with the contents of |model|. // WARNING: this populates the menu on construction by invoking methods on diff --git a/views/controls/menu/menu_config.h b/views/controls/menu/menu_config.h index 06a31f1..dc2b7a3 100644 --- a/views/controls/menu/menu_config.h +++ b/views/controls/menu/menu_config.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. @@ -8,12 +8,13 @@ #include "third_party/skia/include/core/SkColor.h" #include "ui/gfx/font.h" +#include "views/views_api.h" namespace views { // Layout type information for menu items. Use the instance() method to obtain // the MenuConfig for the current platform. -struct MenuConfig { +struct VIEWS_API MenuConfig { MenuConfig(); ~MenuConfig(); diff --git a/views/controls/menu/menu_controller.h b/views/controls/menu/menu_controller.h index 53887e4..2b62e60 100644 --- a/views/controls/menu/menu_controller.h +++ b/views/controls/menu/menu_controller.h @@ -37,7 +37,7 @@ class View; // MenuController is used internally by the various menu classes to manage // showing, selecting and drag/drop for menus. All relevant events are // forwarded to the MenuController from SubmenuView and MenuHost. -class MenuController : public MessageLoopForUI::Dispatcher { +class VIEWS_API MenuController : public MessageLoop::Dispatcher { public: friend class MenuHostRootView; friend class MenuItemView; diff --git a/views/controls/menu/menu_delegate.h b/views/controls/menu/menu_delegate.h index 2d44121..13b457d 100644 --- a/views/controls/menu/menu_delegate.h +++ b/views/controls/menu/menu_delegate.h @@ -33,7 +33,7 @@ class MenuButton; // Delegate for a menu. This class is used as part of MenuItemView, see it // for details. // TODO(sky): merge this with ui::MenuModel. -class MenuDelegate { +class VIEWS_API MenuDelegate { public: // Used during drag and drop to indicate where the drop indicator should // be rendered. diff --git a/views/controls/menu/menu_item_view.h b/views/controls/menu/menu_item_view.h index 1403729e..cc0a91f 100644 --- a/views/controls/menu/menu_item_view.h +++ b/views/controls/menu/menu_item_view.h @@ -66,7 +66,7 @@ struct MenuConfig; // and does NOT block the caller. Instead the delegate is notified when the // menu closes via the DropMenuClosed method. -class MenuItemView : public View { +class VIEWS_API MenuItemView : public View { public: friend class MenuController; diff --git a/views/controls/menu/menu_model_adapter.h b/views/controls/menu/menu_model_adapter.h index 2fbbf4b..18a61a5 100644 --- a/views/controls/menu/menu_model_adapter.h +++ b/views/controls/menu/menu_model_adapter.h @@ -19,7 +19,7 @@ class MenuItemView; // This class wraps an instance of ui::MenuModel with the // views::MenuDelegate interface required by views::MenuItemView. -class MenuModelAdapter : public MenuDelegate { +class VIEWS_API MenuModelAdapter : public MenuDelegate { public: // The caller retains ownership of the ui::MenuModel instance and // must ensure it exists for the lifetime of the adapter. The diff --git a/views/controls/menu/menu_runner.h b/views/controls/menu/menu_runner.h index 3dfece5..873a201 100644 --- a/views/controls/menu/menu_runner.h +++ b/views/controls/menu/menu_runner.h @@ -25,7 +25,7 @@ class Widget; // // TODO: this is a work around for 57890. If we fix it this class shouldn't be // needed. -class MenuRunner { +class VIEWS_API MenuRunner { public: explicit MenuRunner(MenuItemView* menu); ~MenuRunner(); diff --git a/views/controls/menu/menu_wrapper.h b/views/controls/menu/menu_wrapper.h index 0816fc0..a6e67d0 100644 --- a/views/controls/menu/menu_wrapper.h +++ b/views/controls/menu/menu_wrapper.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. @@ -7,6 +7,7 @@ #pragma once #include "ui/gfx/native_widget_types.h" +#include "views/views_api.h" namespace gfx { class Point; @@ -24,7 +25,7 @@ class MenuListener { }; // An interface that wraps an object that implements a menu. -class MenuWrapper { +class VIEWS_API MenuWrapper { public: // All of the possible actions that can result from RunMenuAt. enum MenuAction { diff --git a/views/controls/menu/native_menu_win.h b/views/controls/menu/native_menu_win.h index 3d1ea7d..8eff891 100644 --- a/views/controls/menu/native_menu_win.h +++ b/views/controls/menu/native_menu_win.h @@ -12,12 +12,13 @@ #include "base/task.h" #include "ui/base/models/simple_menu_model.h" #include "views/controls/menu/menu_wrapper.h" +#include "views/views_api.h" namespace views { // A Windows implementation of MenuWrapper. // TODO(beng): rename to MenuWin once the old class is dead. -class NativeMenuWin : public MenuWrapper { +class VIEWS_API NativeMenuWin : public MenuWrapper { public: // Construct a NativeMenuWin, with a model and delegate. If |system_menu_for| // is non-NULL, the NativeMenuWin wraps the system menu for that window. @@ -159,7 +160,7 @@ class NativeMenuWin : public MenuWrapper { // A SimpleMenuModel subclass that allows the system menu for a window to be // wrapped. -class SystemMenuModel : public ui::SimpleMenuModel { +class VIEWS_API SystemMenuModel : public ui::SimpleMenuModel { public: explicit SystemMenuModel(Delegate* delegate); virtual ~SystemMenuModel(); diff --git a/views/controls/menu/submenu_view.h b/views/controls/menu/submenu_view.h index 1ec627b..e9d4227 100644 --- a/views/controls/menu/submenu_view.h +++ b/views/controls/menu/submenu_view.h @@ -32,7 +32,7 @@ class MenuScrollViewContainer; // MenuScrollViewContainer handles showing as much of the SubmenuView as the // screen allows. If the SubmenuView is taller than the screen, scroll buttons // are provided that allow the user to see all the menu items. -class SubmenuView : public View { +class VIEWS_API SubmenuView : public View { public: // The submenu's class name. static const char kViewClassName[]; diff --git a/views/controls/message_box_view.h b/views/controls/message_box_view.h index a3f1355..a9ede6f 100644 --- a/views/controls/message_box_view.h +++ b/views/controls/message_box_view.h @@ -21,7 +21,7 @@ class Textfield; // This class displays the contents of a message box. It is intended for use // within a constrained window, and has options for a message, prompt, OK // and Cancel buttons. -class MessageBoxView : public View { +class VIEWS_API MessageBoxView : public View { public: MessageBoxView(int dialog_flags, const std::wstring& message, diff --git a/views/controls/native/native_view_host.h b/views/controls/native/native_view_host.h index cb711cd..a9c606b 100644 --- a/views/controls/native/native_view_host.h +++ b/views/controls/native/native_view_host.h @@ -19,7 +19,7 @@ class NativeViewHostWrapper; // kept in sync with the bounds of this view as it is moved and sized. // Under the hood, a platform-specific NativeViewHostWrapper implementation does // the platform-specific work of manipulating the underlying OS widget type. -class NativeViewHost : public View { +class VIEWS_API NativeViewHost : public View { public: // The NativeViewHost's class name. static const char kViewClassName[]; diff --git a/views/controls/native_control.h b/views/controls/native_control.h index 9cf604e..395811f 100644 --- a/views/controls/native_control.h +++ b/views/controls/native_control.h @@ -23,7 +23,7 @@ class NativeControlContainer; // wrap a new kind of control // //////////////////////////////////////////////////////////////////////////////// -class NativeControl : public View { +class VIEWS_API NativeControl : public View { public: enum Alignment { LEADING = 0, diff --git a/views/controls/progress_bar.h b/views/controls/progress_bar.h index 601186d..0de768b 100644 --- a/views/controls/progress_bar.h +++ b/views/controls/progress_bar.h @@ -26,7 +26,7 @@ namespace views { // ///////////////////////////////////////////////////////////////////////////// -class ProgressBar : public View { +class VIEWS_API ProgressBar : public View { public: ProgressBar(); virtual ~ProgressBar(); diff --git a/views/controls/resize_area.h b/views/controls/resize_area.h index 1ac9f82..c6abf15 100644 --- a/views/controls/resize_area.h +++ b/views/controls/resize_area.h @@ -17,7 +17,7 @@ namespace views { // An invisible area that acts like a horizontal resizer. // //////////////////////////////////////////////////////////////////////////////// -class ResizeArea : public View { +class VIEWS_API ResizeArea : public View { public: ////////////////////////////////////////////////////////////////////////////// // diff --git a/views/controls/scroll_view.h b/views/controls/scroll_view.h index d8ffd15..1a25d68 100644 --- a/views/controls/scroll_view.h +++ b/views/controls/scroll_view.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. @@ -26,8 +26,7 @@ namespace views { // ///////////////////////////////////////////////////////////////////////////// -class ScrollView : public View, - public ScrollBarController { +class VIEWS_API ScrollView : public View, public ScrollBarController { public: static const char* const kViewClassName; diff --git a/views/controls/scrollbar/native_scroll_bar.h b/views/controls/scrollbar/native_scroll_bar.h index 32a1286..5bcb0a2 100644 --- a/views/controls/scrollbar/native_scroll_bar.h +++ b/views/controls/scrollbar/native_scroll_bar.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2009 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. @@ -17,7 +17,7 @@ class NativeScrollBarWrapper; // The NativeScrollBar class is a scrollbar that uses platform's // native control. -class NativeScrollBar : public ScrollBar { +class VIEWS_API NativeScrollBar : public ScrollBar { public: // The scroll-bar's class name. static const char kViewClassName[]; diff --git a/views/controls/scrollbar/scroll_bar.h b/views/controls/scrollbar/scroll_bar.h index d7f187b..bbc0d21 100644 --- a/views/controls/scrollbar/scroll_bar.h +++ b/views/controls/scrollbar/scroll_bar.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. @@ -21,7 +21,7 @@ class ScrollBar; // receive notification from a scrollbar // ///////////////////////////////////////////////////////////////////////////// -class ScrollBarController { +class VIEWS_API ScrollBarController { public: // Invoked by the scrollbar when the scrolling position changes @@ -55,7 +55,7 @@ class ScrollBarController { // A scrollbar is either horizontal or vertical // ///////////////////////////////////////////////////////////////////////////// -class ScrollBar : public View { +class VIEWS_API ScrollBar : public View { public: virtual ~ScrollBar(); diff --git a/views/controls/separator.h b/views/controls/separator.h index 405efc3..50f2918 100644 --- a/views/controls/separator.h +++ b/views/controls/separator.h @@ -15,7 +15,7 @@ namespace views { // The Separator class is a view that shows a line used to visually separate // other views. The current implementation is only horizontal. -class Separator : public View { +class VIEWS_API Separator : public View { public: // The separator's class name. static const char kViewClassName[]; diff --git a/views/controls/single_split_view.h b/views/controls/single_split_view.h index d325fd0..a77ae62 100644 --- a/views/controls/single_split_view.h +++ b/views/controls/single_split_view.h @@ -16,7 +16,7 @@ namespace views { // drag around to resize the views. // Observer's SplitHandleMoved notification helps to monitor user initiated // layout changes. -class SingleSplitView : public views::View { +class VIEWS_API SingleSplitView : public View { public: enum Orientation { HORIZONTAL_SPLIT, diff --git a/views/controls/tabbed_pane/tabbed_pane.h b/views/controls/tabbed_pane/tabbed_pane.h index eeef7a8..96b10ad3 100644 --- a/views/controls/tabbed_pane/tabbed_pane.h +++ b/views/controls/tabbed_pane/tabbed_pane.h @@ -17,7 +17,7 @@ class TabbedPaneListener; // TabbedPane is a view that shows tabs. When the user clicks on a tab, the // associated view is displayed. -class TabbedPane : public View { +class VIEWS_API TabbedPane : public View { public: TabbedPane(); virtual ~TabbedPane(); diff --git a/views/controls/table/group_table_view.h b/views/controls/table/group_table_view.h index cbf0822..9de687d 100644 --- a/views/controls/table/group_table_view.h +++ b/views/controls/table/group_table_view.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 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. @@ -29,7 +29,7 @@ class GroupTableModel : public TableModel { virtual void GetGroupRangeForItem(int item, GroupRange* range) = 0; }; -class GroupTableView : public TableView { +class VIEWS_API GroupTableView : public TableView { public: // The view class name. static const char kViewClassName[]; diff --git a/views/controls/table/table_view.h b/views/controls/table/table_view.h index a0181c9..8594a61 100644 --- a/views/controls/table/table_view.h +++ b/views/controls/table/table_view.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. @@ -20,6 +20,7 @@ typedef struct tagNMLVCUSTOMDRAW NMLVCUSTOMDRAW; #include "third_party/skia/include/core/SkColor.h" #include "ui/base/keycodes/keyboard_codes.h" #include "ui/base/models/table_model_observer.h" +#include "views/views_api.h" #if defined(OS_WIN) // TODO(port): remove the ifdef when native_control.h is ported. @@ -80,7 +81,7 @@ enum TableTypes { }; // Returned from SelectionBegin/SelectionEnd -class TableSelectionIterator { +class VIEWS_API TableSelectionIterator { public: TableSelectionIterator(TableView* view, int view_index); TableSelectionIterator& operator=(const TableSelectionIterator& other); @@ -102,8 +103,8 @@ class TableSelectionIterator { #if defined(OS_WIN) // TODO(port): Port TableView. -class TableView : public NativeControl, - public TableModelObserver { +class VIEWS_API TableView : public NativeControl, + public TableModelObserver { public: typedef TableSelectionIterator iterator; diff --git a/views/controls/table/table_view2.h b/views/controls/table/table_view2.h index f7b3772..eeeaf7b 100644 --- a/views/controls/table/table_view2.h +++ b/views/controls/table/table_view2.h @@ -53,7 +53,7 @@ class TableView; class TableViewObserver; class View; -class TableView2 : public View, public TableModelObserver { +class VIEWS_API TableView2 : public View, public TableModelObserver { public: typedef TableSelectionIterator iterator; diff --git a/views/controls/textfield/native_textfield_views.h b/views/controls/textfield/native_textfield_views.h index ea6fec8..4521504 100644 --- a/views/controls/textfield/native_textfield_views.h +++ b/views/controls/textfield/native_textfield_views.h @@ -41,13 +41,13 @@ class MenuModelAdapter; // * X selection (only if we want to support). // Once completed, this will replace Textfield, NativeTextfieldWin and // NativeTextfieldGtk. -class NativeTextfieldViews : public View, - public ContextMenuController, - public DragController, - public NativeTextfieldWrapper, - public ui::SimpleMenuModel::Delegate, - public TextInputClient, - public TextfieldViewsModel::Delegate { +class VIEWS_API NativeTextfieldViews : public View, + public ContextMenuController, + public DragController, + public NativeTextfieldWrapper, + public ui::SimpleMenuModel::Delegate, + public TextInputClient, + public TextfieldViewsModel::Delegate { public: explicit NativeTextfieldViews(Textfield* parent); virtual ~NativeTextfieldViews(); diff --git a/views/controls/textfield/native_textfield_views_unittest.cc b/views/controls/textfield/native_textfield_views_unittest.cc index 0c8ec2e..55e19cc 100644 --- a/views/controls/textfield/native_textfield_views_unittest.cc +++ b/views/controls/textfield/native_textfield_views_unittest.cc @@ -165,8 +165,8 @@ class NativeTextfieldViewsTest : public ViewsTestBase, widget_->SetContentsView(container); container->AddChildView(textfield_); - textfield_view_ - = static_cast<NativeTextfieldViews*>(textfield_->native_wrapper()); + textfield_view_ = static_cast<NativeTextfieldViews*>( + textfield_->GetNativeWrapperForTesting()); textfield_view_->SetBoundsRect(params.bounds); textfield_->set_id(1); diff --git a/views/controls/textfield/native_textfield_win.h b/views/controls/textfield/native_textfield_win.h index ceabb34..53c2327 100644 --- a/views/controls/textfield/native_textfield_win.h +++ b/views/controls/textfield/native_textfield_win.h @@ -44,15 +44,15 @@ class NativeTextfieldWin // Returns true if the current point is close enough to the origin point in // space and time that it would be considered a double click. - static bool IsDoubleClick(const POINT& origin, - const POINT& current, - DWORD elapsed_time); + VIEWS_API static bool IsDoubleClick(const POINT& origin, + const POINT& current, + DWORD elapsed_time); // Returns true if the virtual key code is a digit coming from the numeric // keypad (with or without NumLock on). |extended_key| should be set to the // extended key flag specified in the WM_KEYDOWN/UP where the |key_code| // originated. - static bool IsNumPadDigit(int key_code, bool extended_key); + VIEWS_API static bool IsNumPadDigit(int key_code, bool extended_key); // See the code in textfield.cc that calls this for why this is here. void AttachHack(); diff --git a/views/controls/textfield/native_textfield_wrapper.h b/views/controls/textfield/native_textfield_wrapper.h index 6cef09f..1a1e589 100644 --- a/views/controls/textfield/native_textfield_wrapper.h +++ b/views/controls/textfield/native_textfield_wrapper.h @@ -8,6 +8,7 @@ #include "base/string16.h" #include "ui/gfx/native_widget_types.h" +#include "views/views_api.h" namespace gfx { class Insets; @@ -27,7 +28,7 @@ class View; // An interface implemented by an object that provides a platform-native // text field. -class NativeTextfieldWrapper { +class VIEWS_API NativeTextfieldWrapper { public: // The Textfield calls this when it is destroyed to clean up the wrapper // object. diff --git a/views/controls/textfield/textfield.h b/views/controls/textfield/textfield.h index 66675d5..0cbb101 100644 --- a/views/controls/textfield/textfield.h +++ b/views/controls/textfield/textfield.h @@ -20,15 +20,13 @@ #include "third_party/skia/include/core/SkColor.h" #include "ui/base/keycodes/keyboard_codes.h" #include "ui/gfx/font.h" +#include "ui/gfx/native_widget_types.h" +#include "views/controls/textfield/native_textfield_wrapper.h" #include "views/view.h" #if !defined(OS_LINUX) #include "base/logging.h" #endif -#ifdef UNIT_TEST -#include "ui/gfx/native_widget_types.h" -#include "views/controls/textfield/native_textfield_wrapper.h" -#endif namespace gfx { struct StyleRange; @@ -41,11 +39,10 @@ class Range; namespace views { class KeyEvent; -class NativeTextfieldWrapper; class TextfieldController; // This class implements a View that wraps a native text (edit) field. -class Textfield : public View { +class VIEWS_API Textfield : public View { public: // The button's class name. static const char kViewClassName[]; @@ -204,14 +201,13 @@ class Textfield : public View { // Set the accessible name of the text field. void SetAccessibleName(const string16& name); -#ifdef UNIT_TEST + // Provided only for testing: gfx::NativeView GetTestingHandle() const { return native_wrapper_ ? native_wrapper_->GetTestingHandle() : NULL; } - NativeTextfieldWrapper* native_wrapper() const { + NativeTextfieldWrapper* GetNativeWrapperForTesting() const { return native_wrapper_; } -#endif // Overridden from View: virtual void Layout() OVERRIDE; diff --git a/views/controls/textfield/textfield_views_model.h b/views/controls/textfield/textfield_views_model.h index 3f63fe4..0c49267 100644 --- a/views/controls/textfield/textfield_views_model.h +++ b/views/controls/textfield/textfield_views_model.h @@ -16,6 +16,7 @@ #include "ui/base/ime/composition_text.h" #include "ui/gfx/rect.h" #include "ui/gfx/render_text.h" +#include "views/views_api.h" namespace gfx { class Canvas; @@ -51,12 +52,12 @@ enum MergeType { // A model that represents a text content for TextfieldViews. // It supports editing, selection and cursor manipulation. -class TextfieldViewsModel { +class VIEWS_API TextfieldViewsModel { public: // Delegate interface implemented by the textfield view class to provided // additional functionalities required by the model. - class Delegate { + class VIEWS_API Delegate { public: // Called when the current composition text is confirmed or cleared. virtual void OnCompositionTextConfirmedOrCleared() = 0; diff --git a/views/controls/throbber.h b/views/controls/throbber.h index afc2537..4da93b3 100644 --- a/views/controls/throbber.h +++ b/views/controls/throbber.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 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. @@ -17,7 +17,7 @@ class SkBitmap; namespace views { -class Throbber : public View { +class VIEWS_API Throbber : public View { public: // |frame_time_ms| is the amount of time that should elapse between frames // (in milliseconds) @@ -97,7 +97,7 @@ class SmoothedThrobber : public Throbber { // 2. working (which paints the throbber animation) // 3. completed (which paints a checkmark) // -class CheckmarkThrobber : public Throbber { +class VIEWS_API CheckmarkThrobber : public Throbber { public: CheckmarkThrobber(); diff --git a/views/controls/tree/tree_view.h b/views/controls/tree/tree_view.h index c43502b..28f6ddc 100644 --- a/views/controls/tree/tree_view.h +++ b/views/controls/tree/tree_view.h @@ -45,7 +45,7 @@ class TreeViewController { // TreeView displays hierarchical data as returned from a TreeModel. The user // can expand, collapse and edit the items. A Controller may be attached to // receive notification of selection changes and restrict editing. -class TreeView : public NativeControl, ui::TreeModelObserver { +class VIEWS_API TreeView : public NativeControl, ui::TreeModelObserver { public: TreeView(); virtual ~TreeView(); diff --git a/views/drag_controller.h b/views/drag_controller.h index c7012d8..5166556 100644 --- a/views/drag_controller.h +++ b/views/drag_controller.h @@ -6,6 +6,8 @@ #define VIEWS_EVENTS_DRAG_CONTROLLER_H_ #pragma once +#include "views/views_api.h" + namespace gfx { class Point; } @@ -20,7 +22,7 @@ class View; // DragController is responsible for writing drag data for a view, as well as // supplying the supported drag operations. Use DragController if you don't // want to subclass. -class DragController { +class VIEWS_API DragController { public: // Writes the data for the drag. virtual void WriteDragDataForView(View* sender, diff --git a/views/drag_utils.h b/views/drag_utils.h index ad17ce9..b7d743f 100644 --- a/views/drag_utils.h +++ b/views/drag_utils.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. @@ -9,6 +9,7 @@ #include <string> #include "base/file_path.h" +#include "views/views_api.h" class GURL; class SkBitmap; @@ -28,34 +29,35 @@ namespace drag_utils { // Sets url and title on data as well as setting a suitable image for dragging. // The image looks like that of the bookmark buttons. -void SetURLAndDragImage(const GURL& url, - const std::wstring& title, - const SkBitmap& icon, - OSExchangeData* data); +VIEWS_API void SetURLAndDragImage(const GURL& url, + const std::wstring& title, + const SkBitmap& icon, + OSExchangeData* data); // Creates a dragging image to be displayed when the user drags a file from // Chrome (via the download manager, for example). The drag image is set into // the supplied data_object. 'file_name' can be a full path, but the directory // portion will be truncated in the drag image. -void CreateDragImageForFile(const FilePath& file_name, - const SkBitmap* icon, - OSExchangeData* data_object); +VIEWS_API void CreateDragImageForFile(const FilePath& file_name, + const SkBitmap* icon, + OSExchangeData* data_object); // Sets the drag image on data_object from the supplied canvas. width/height // are the size of the image to use, and the offsets give the location of // the hotspot for the drag image. -void SetDragImageOnDataObject(const gfx::Canvas& canvas, - const gfx::Size& size, - const gfx::Point& cursor_offset, - OSExchangeData* data_object); -// +VIEWS_API void SetDragImageOnDataObject(const gfx::Canvas& canvas, + const gfx::Size& size, + const gfx::Point& cursor_offset, + OSExchangeData* data_object); + // Sets the drag image on data_object from the supplied bitmap. width/height // are the size of the image to use, and the offsets give the location of // the hotspot for the drag image. -void SetDragImageOnDataObject(const SkBitmap& bitmap, - const gfx::Size& size, - const gfx::Point& cursor_offset, - OSExchangeData* data_object); +VIEWS_API void SetDragImageOnDataObject(const SkBitmap& bitmap, + const gfx::Size& size, + const gfx::Point& cursor_offset, + OSExchangeData* data_object); + } // namespace drag_utils #endif // #ifndef VIEWS_DRAG_UTILS_H_ diff --git a/views/events/event.h b/views/events/event.h index 7c42537..07a86b0 100644 --- a/views/events/event.h +++ b/views/events/event.h @@ -12,6 +12,7 @@ #include "ui/base/keycodes/keyboard_codes.h" #include "ui/gfx/point.h" #include "views/native_types.h" +#include "views/views_api.h" #if defined(USE_X11) typedef union _XEvent XEvent; @@ -32,8 +33,8 @@ class RootView; } #if defined(OS_WIN) -bool IsClientMouseEvent(const views::NativeEvent& native_event); -bool IsNonClientMouseEvent(const views::NativeEvent& native_event); +VIEWS_API bool IsClientMouseEvent(const views::NativeEvent& native_event); +VIEWS_API bool IsNonClientMouseEvent(const views::NativeEvent& native_event); #endif //////////////////////////////////////////////////////////////////////////////// @@ -48,7 +49,7 @@ bool IsNonClientMouseEvent(const views::NativeEvent& native_event); // Events are immutable but support copy // //////////////////////////////////////////////////////////////////////////////// -class Event { +class VIEWS_API Event { public: // This type exists to distinguish between the NativeEvent and NativeEvent2 // constructors. @@ -137,7 +138,7 @@ class Event { // position in the screen. // //////////////////////////////////////////////////////////////////////////////// -class LocatedEvent : public Event { +class VIEWS_API LocatedEvent : public Event { public: int x() const { return location_.x(); } int y() const { return location_.y(); } @@ -172,7 +173,7 @@ class TouchEvent; // A mouse event is used for any input event related to the mouse. // //////////////////////////////////////////////////////////////////////////////// -class MouseEvent : public LocatedEvent { +class VIEWS_API MouseEvent : public LocatedEvent { public: explicit MouseEvent(NativeEvent native_event); MouseEvent(NativeEvent2 native_event_2, FromNativeEvent2 from_native); @@ -244,7 +245,7 @@ class MouseEvent : public LocatedEvent { // TouchEvent and PlatformTouchPoint. // //////////////////////////////////////////////////////////////////////////////// -class TouchEvent : public LocatedEvent { +class VIEWS_API TouchEvent : public LocatedEvent { public: TouchEvent(NativeEvent2 native_event_2, FromNativeEvent2 from_native); @@ -301,7 +302,7 @@ class TouchEvent : public LocatedEvent { // KeyEvent encapsulates keyboard input events - key press and release. // //////////////////////////////////////////////////////////////////////////////// -class KeyEvent : public Event { +class VIEWS_API KeyEvent : public Event { public: explicit KeyEvent(NativeEvent native_event); KeyEvent(NativeEvent2 native_event_2, FromNativeEvent2 from_native); @@ -374,7 +375,7 @@ class KeyEvent : public Event { // Note: e.GetOffset() > 0 means scroll up / left. // //////////////////////////////////////////////////////////////////////////////// -class MouseWheelEvent : public MouseEvent { +class VIEWS_API MouseWheelEvent : public MouseEvent { public: // See |offset| for details. static const int kWheelDelta; @@ -407,7 +408,7 @@ class MouseWheelEvent : public MouseEvent { // drop operation. // //////////////////////////////////////////////////////////////////////////////// -class DropTargetEvent : public LocatedEvent { +class VIEWS_API DropTargetEvent : public LocatedEvent { public: DropTargetEvent(const OSExchangeData& data, int x, diff --git a/views/events/event_utils_win.h b/views/events/event_utils_win.h index 9133864..258fa61 100644 --- a/views/events/event_utils_win.h +++ b/views/events/event_utils_win.h @@ -7,6 +7,7 @@ #pragma once #include "ui/gfx/native_widget_types.h" +#include "views/views_api.h" // Windows-specific Event utilities. Add functionality here rather than adding // #ifdefs to event.h @@ -23,7 +24,7 @@ int GetRepeatCount(const KeyEvent& event); // Returns true if the affected key is a Windows extended key. See documentation // for WM_KEYDOWN for explanation. // Valid only for KeyEvents constructed from a MSG. -bool IsExtendedKey(const KeyEvent& event); +VIEWS_API bool IsExtendedKey(const KeyEvent& event); // Return a mask of windows key/button state flags for the event object. int GetWindowsFlags(const Event& event); diff --git a/views/focus/accelerator_handler.h b/views/focus/accelerator_handler.h index 630c011..a2ef532 100644 --- a/views/focus/accelerator_handler.h +++ b/views/focus/accelerator_handler.h @@ -16,6 +16,7 @@ #include <vector> #include "base/message_loop.h" +#include "views/views_api.h" namespace views { @@ -31,7 +32,7 @@ void SetTouchDeviceList(std::vector<unsigned int>& devices); // This class delegates the key messages to the associated FocusManager class // for the window that is receiving these messages for accelerator processing. -class AcceleratorHandler : public MessageLoopForUI::Dispatcher { +class VIEWS_API AcceleratorHandler : public MessageLoop::Dispatcher { public: AcceleratorHandler(); diff --git a/views/focus/external_focus_tracker.h b/views/focus/external_focus_tracker.h index 8080f39..a4a12cf 100644 --- a/views/focus/external_focus_tracker.h +++ b/views/focus/external_focus_tracker.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 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. @@ -26,7 +26,7 @@ class ViewStorage; // when that view wants to return focus to the last focused view which is not // itself and not a descandant of itself, (usually when it is being closed) // it calls FocusLastFocusedExternalView. -class ExternalFocusTracker : public FocusChangeListener { +class VIEWS_API ExternalFocusTracker : public FocusChangeListener { public: ExternalFocusTracker(View* parent_view, FocusManager* focus_manager); diff --git a/views/focus/focus_manager.h b/views/focus/focus_manager.h index a75f79a..018a4f2 100644 --- a/views/focus/focus_manager.h +++ b/views/focus/focus_manager.h @@ -79,7 +79,7 @@ class Widget; // The FocusTraversable interface is used by components that want to process // focus traversal events (due to Tab/Shift-Tab key events). -class FocusTraversable { +class VIEWS_API FocusTraversable { public: // Return a FocusSearch object that implements the algorithm to find // the next or previous focusable view. @@ -101,7 +101,7 @@ class FocusTraversable { // This interface should be implemented by classes that want to be notified when // the focus is about to change. See the Add/RemoveFocusChangeListener methods. // No change to focus state has occurred yet when this function is called. -class FocusChangeListener { +class VIEWS_API FocusChangeListener { public: virtual void FocusWillChange(View* focused_before, View* focused_now) = 0; @@ -123,9 +123,9 @@ class WidgetFocusChangeListener { virtual ~WidgetFocusChangeListener() {} }; -class FocusManager { +class VIEWS_API FocusManager { public: - class WidgetFocusManager { + class VIEWS_API WidgetFocusManager { public: // Returns the singleton instance. static WidgetFocusManager* GetInstance(); diff --git a/views/focus/focus_search.h b/views/focus/focus_search.h index 5fcffe2..571982a 100644 --- a/views/focus/focus_search.h +++ b/views/focus/focus_search.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. @@ -14,7 +14,7 @@ class FocusTraversable; // FocusSearch is an object that implements the algorithm to find the // next view to focus. -class FocusSearch { +class VIEWS_API FocusSearch { public: // The direction in which the focus traversal is going. // TODO (jcampan): add support for lateral (left, right) focus traversal. The diff --git a/views/focus/focus_util_win.h b/views/focus/focus_util_win.h index 3bfeec4..38f4626 100644 --- a/views/focus/focus_util_win.h +++ b/views/focus/focus_util_win.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 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. @@ -8,6 +8,8 @@ #include <windows.h> +#include "views/views_api.h" + namespace ui { class ViewProp; } @@ -18,7 +20,7 @@ namespace views { // We reroute the mouse wheel messages to such HWND when they are under the // mouse pointer (but are not the active window). Callers own the returned // object. -ui::ViewProp* SetWindowSupportsRerouteMouseWheel(HWND hwnd); +VIEWS_API ui::ViewProp* SetWindowSupportsRerouteMouseWheel(HWND hwnd); // Forwards mouse wheel messages to the window under it. // Windows sends mouse wheel messages to the currently active window. @@ -27,7 +29,7 @@ ui::ViewProp* SetWindowSupportsRerouteMouseWheel(HWND hwnd); // mouse wheel in order to scroll that window. This is arguably a better user // experience. The returns value says whether the mouse wheel message was // successfully redirected. -bool RerouteMouseWheel(HWND window, WPARAM w_param, LPARAM l_param); +VIEWS_API bool RerouteMouseWheel(HWND window, WPARAM w_param, LPARAM l_param); } // namespace views diff --git a/views/focus/view_storage.h b/views/focus/view_storage.h index 129b90e..68ab960 100644 --- a/views/focus/view_storage.h +++ b/views/focus/view_storage.h @@ -20,7 +20,7 @@ namespace views { -class ViewStorage { +class VIEWS_API ViewStorage { public: // Returns the global ViewStorage instance. // It is guaranted to be non NULL. @@ -41,9 +41,7 @@ class ViewStorage { // Notifies the ViewStorage that a view was removed from its parent somewhere. void ViewRemoved(View* removed); -#ifdef UNIT_TEST size_t view_count() const { return view_to_ids_.size(); } -#endif private: friend struct DefaultSingletonTraits<ViewStorage>; diff --git a/views/ime/input_method.h b/views/ime/input_method.h index 918d78c..80924e0 100644 --- a/views/ime/input_method.h +++ b/views/ime/input_method.h @@ -11,6 +11,7 @@ #include "base/basictypes.h" #include "base/i18n/rtl.h" #include "ui/base/ime/text_input_type.h" +#include "views/views_api.h" namespace views { @@ -30,7 +31,7 @@ class Widget; // And in Views control system, only the top-level NativeWidget has a native // window that can get keyboard focus. So this API is designed to be bound to // the top-level NativeWidget. -class InputMethod { +class VIEWS_API InputMethod { public: virtual ~InputMethod() {} diff --git a/views/ime/input_method_base.h b/views/ime/input_method_base.h index 1bea526..c835a03 100644 --- a/views/ime/input_method_base.h +++ b/views/ime/input_method_base.h @@ -19,8 +19,8 @@ class View; // A helper class providing functionalities shared among InputMethod // implementations. -class InputMethodBase : public InputMethod, - public FocusChangeListener { +class VIEWS_API InputMethodBase : public InputMethod, + public FocusChangeListener { public: InputMethodBase(); virtual ~InputMethodBase(); diff --git a/views/ime/input_method_delegate.h b/views/ime/input_method_delegate.h index 70d2ac3..c683c65 100644 --- a/views/ime/input_method_delegate.h +++ b/views/ime/input_method_delegate.h @@ -6,6 +6,8 @@ #define VIEWS_IME_INPUT_METHOD_DELEGATE_H_ #pragma once +#include "views/views_api.h" + namespace views { class KeyEvent; @@ -14,7 +16,7 @@ namespace internal { // An interface implemented by the object that handles events sent back from an // InputMethod implementation. -class InputMethodDelegate { +class VIEWS_API InputMethodDelegate { public: virtual ~InputMethodDelegate() {} diff --git a/views/ime/mock_input_method.h b/views/ime/mock_input_method.h index 2691761..a364636 100644 --- a/views/ime/mock_input_method.h +++ b/views/ime/mock_input_method.h @@ -14,7 +14,7 @@ namespace views { // A mock InputMethod implementation for testing purpose. -class MockInputMethod : public InputMethodBase { +class VIEWS_API MockInputMethod : public InputMethodBase { public: MockInputMethod(); explicit MockInputMethod(internal::InputMethodDelegate* delegate); diff --git a/views/ime/text_input_client.h b/views/ime/text_input_client.h index 2f2d1fc..b626479 100644 --- a/views/ime/text_input_client.h +++ b/views/ime/text_input_client.h @@ -14,6 +14,7 @@ #include "ui/base/ime/composition_text.h" #include "ui/base/ime/text_input_type.h" #include "ui/base/range/range.h" +#include "views/views_api.h" namespace gfx { class Rect; @@ -24,7 +25,7 @@ namespace views { class View; // An interface implemented by a View that needs text input support. -class TextInputClient { +class VIEWS_API TextInputClient { public: virtual ~TextInputClient() {} diff --git a/views/layer_property_setter.h b/views/layer_property_setter.h index c4080f9..da34c6c 100644 --- a/views/layer_property_setter.h +++ b/views/layer_property_setter.h @@ -6,6 +6,8 @@ #define UI_GFX_COMPOSITOR_LAYER_PROPERTY_SETTER_H_ #pragma once +#include "views/views_api.h" + namespace gfx { class Rect; } @@ -20,7 +22,7 @@ namespace views { // When a property of layer needs to be changed it is set by way of // LayerPropertySetter. This enables LayerPropertySetter to animate property // changes. -class LayerPropertySetter { +class VIEWS_API LayerPropertySetter { public: // Creates a LayerPropertySetter that immediately sets the values on the // layer. Ownership returns to caller. diff --git a/views/layout/box_layout.h b/views/layout/box_layout.h index e2910b4..e8798f7 100644 --- a/views/layout/box_layout.h +++ b/views/layout/box_layout.h @@ -23,7 +23,7 @@ class View; // child views are always sized according to their preferred size. If the // host's bounds provide insufficient space, child views will be clamped. // Excess space will not be distributed. -class BoxLayout : public LayoutManager { +class VIEWS_API BoxLayout : public LayoutManager { public: enum Orientation { kHorizontal, diff --git a/views/layout/fill_layout.h b/views/layout/fill_layout.h index b8974d9..b9451a3 100644 --- a/views/layout/fill_layout.h +++ b/views/layout/fill_layout.h @@ -18,7 +18,7 @@ namespace views { // sized to match the bounds of its parent. // /////////////////////////////////////////////////////////////////////////////// -class FillLayout : public LayoutManager { +class VIEWS_API FillLayout : public LayoutManager { public: FillLayout(); virtual ~FillLayout(); diff --git a/views/layout/grid_layout.h b/views/layout/grid_layout.h index f2a0174..062ce8d 100644 --- a/views/layout/grid_layout.h +++ b/views/layout/grid_layout.h @@ -70,7 +70,7 @@ class View; struct ViewState; -class GridLayout : public LayoutManager { +class VIEWS_API GridLayout : public LayoutManager { public: // An enumeration of the possible alignments supported by GridLayout. enum Alignment { @@ -262,7 +262,7 @@ class GridLayout : public LayoutManager { // ColumnSet is used to define a set of columns. GridLayout may have any // number of ColumnSets. You don't create a ColumnSet directly, instead // use the AddColumnSet method of GridLayout. -class ColumnSet { +class VIEWS_API ColumnSet { public: ~ColumnSet(); diff --git a/views/layout/layout_manager.h b/views/layout/layout_manager.h index 3fb99c1..0fb395a 100644 --- a/views/layout/layout_manager.h +++ b/views/layout/layout_manager.h @@ -6,6 +6,8 @@ #define VIEWS_LAYOUT_MANAGER_H_ #pragma once +#include "views/views_api.h" + namespace gfx { class Size; } @@ -22,7 +24,7 @@ class View; // the children of a View according to implementation-specific heuristics. // ///////////////////////////////////////////////////////////////////////////// -class LayoutManager { +class VIEWS_API LayoutManager { public: virtual ~LayoutManager(); diff --git a/views/metrics.h b/views/metrics.h index 88b8fd4..3558a09 100644 --- a/views/metrics.h +++ b/views/metrics.h @@ -6,6 +6,8 @@ #define VIEWS_METRICS_H_ #pragma once +#include "views/views_api.h" + namespace views { // NOTE: All times in this file are/should be expressed in milliseconds. @@ -15,11 +17,11 @@ namespace views { extern const int kDefaultMenuShowDelay; // Returns the amount of time between double clicks. -int GetDoubleClickInterval(); +VIEWS_API int GetDoubleClickInterval(); // Returns the amount of time to wait from hovering over a menu button until // showing the menu. -int GetMenuShowDelay(); +VIEWS_API int GetMenuShowDelay(); } // namespace views diff --git a/views/mouse_watcher.h b/views/mouse_watcher.h index 0294a71..c7a270c 100644 --- a/views/mouse_watcher.h +++ b/views/mouse_watcher.h @@ -9,13 +9,14 @@ #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" #include "ui/gfx/insets.h" +#include "views/views_api.h" namespace views { class View; // MouseWatcherListener is notified when the mouse moves outside the view. -class MouseWatcherListener { +class VIEWS_API MouseWatcherListener { public: virtual void MouseMovedOutOfView() = 0; @@ -25,7 +26,7 @@ class MouseWatcherListener { // MouseWatcher is used to watch mouse movement and notify its listener when the // mouse moves outside the bounds of a view. -class MouseWatcher { +class VIEWS_API MouseWatcher { public: // Creates a new MouseWatcher. |hot_zone_insets| is added to the bounds of // the view to determine the active zone. For example, if diff --git a/views/native_theme_delegate.h b/views/native_theme_delegate.h index d94a514..9ae390f 100644 --- a/views/native_theme_delegate.h +++ b/views/native_theme_delegate.h @@ -8,6 +8,7 @@ #include "ui/gfx/native_theme.h" #include "ui/gfx/rect.h" +#include "views/views_api.h" namespace views { @@ -18,7 +19,7 @@ namespace views { // If animation is onging, the native theme border or painter will // composite the foreground state over the backgroud state using an alpha // between 0 and 255 based on the current value of the animation. -class NativeThemeDelegate { +class VIEWS_API NativeThemeDelegate { public: virtual ~NativeThemeDelegate() {} diff --git a/views/native_theme_painter.h b/views/native_theme_painter.h index a2c45bc..c1d6c23 100644 --- a/views/native_theme_painter.h +++ b/views/native_theme_painter.h @@ -25,7 +25,7 @@ class NativeThemeDelegate; // A Painter that uses NativeTheme to implement painting and sizing. A // theme delegate must be given at construction time so that the appropriate // painting and sizing can be done. -class NativeThemePainter : public Painter { +class VIEWS_API NativeThemePainter : public Painter { public: explicit NativeThemePainter(NativeThemeDelegate* delegate); diff --git a/views/painter.h b/views/painter.h index 6cfb7dc..45cab2b2 100644 --- a/views/painter.h +++ b/views/painter.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 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. @@ -8,6 +8,7 @@ #include "base/basictypes.h" #include "third_party/skia/include/core/SkColor.h" +#include "views/views_api.h" namespace gfx { class Canvas; @@ -20,7 +21,7 @@ namespace views { // Painter, as the name implies, is responsible for painting in a particular // region. Think of Painter as a Border or Background that can be painted // in any region of a View. -class Painter { +class VIEWS_API Painter { public: // A convenience method for painting a Painter in a particular region. // This translates the canvas to x/y and paints the painter. @@ -51,7 +52,7 @@ class Painter { // left and right images are drawn to size at the left/right edges of the // region. The center is tiled in the remaining space. All images must have the // same height. -class HorizontalPainter : public Painter { +class VIEWS_API HorizontalPainter : public Painter { public: // Constructs a new HorizontalPainter loading the specified image names. // The images must be in the order left, right and center. diff --git a/views/touchui/gesture_manager.h b/views/touchui/gesture_manager.h index 40d487f..22693f7 100644 --- a/views/touchui/gesture_manager.h +++ b/views/touchui/gesture_manager.h @@ -22,7 +22,7 @@ class TouchEvent; // updates its internal state and optionally dispatches synthetic // events to the invoking view. // -class GestureManager { +class VIEWS_API GestureManager { public: virtual ~GestureManager(); diff --git a/views/view.h b/views/view.h index 00c664b..66da529 100644 --- a/views/view.h +++ b/views/view.h @@ -91,7 +91,7 @@ class RootView; // accessed from the main thread. // ///////////////////////////////////////////////////////////////////////////// -class View : public AcceleratorTarget { +class VIEWS_API View : public AcceleratorTarget { public: typedef std::vector<View*> Views; diff --git a/views/view_constants.h b/views/view_constants.h index 6dbc1de..ffdf7a0 100644 --- a/views/view_constants.h +++ b/views/view_constants.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 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_VIEW_CONSTANTS_H_ #pragma once +#include "views/views_api.h" + namespace views { // Size (width or height) within which the user can hold the mouse and the @@ -19,7 +21,7 @@ extern const int kAutoscrollRowTimerMS; // Used to determine whether a drop is on an item or before/after it. If a drop // occurs kDropBetweenPixels from the top/bottom it is considered before/after // the item, otherwise it is on the item. -extern const int kDropBetweenPixels; +VIEWS_API extern const int kDropBetweenPixels; } // namespace views diff --git a/views/view_text_utils.h b/views/view_text_utils.h index 933d265..cc30220 100644 --- a/views/view_text_utils.h +++ b/views/view_text_utils.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. // @@ -12,6 +12,7 @@ #include "ui/gfx/font.h" #include "ui/gfx/rect.h" +#include "views/views_api.h" namespace gfx { class Canvas; @@ -39,15 +40,15 @@ namespace view_text_utils { // NOTE: The reason why we need this function is because while Skia knows how // to wrap text appropriately, it doesn't tell us where it drew the last // character, which we need to position the URLs within the text. -void DrawTextAndPositionUrl(gfx::Canvas* canvas, - views::Label* label, - const std::wstring& text, - views::Link* link, - gfx::Rect* rect, - gfx::Size* position, - bool text_direction_is_rtl, - const gfx::Rect& bounds, - const gfx::Font& font); +VIEWS_API void DrawTextAndPositionUrl(gfx::Canvas* canvas, + views::Label* label, + const std::wstring& text, + views::Link* link, + gfx::Rect* rect, + gfx::Size* position, + bool text_direction_is_rtl, + const gfx::Rect& bounds, + const gfx::Font& font); // A helper function for DrawTextAndPositionUrl, which simply draws the text // from a certain starting point |position| and wraps within bounds. diff --git a/views/view_unittest.cc b/views/view_unittest.cc index 8e7cc6a..0309ada 100644 --- a/views/view_unittest.cc +++ b/views/view_unittest.cc @@ -295,7 +295,7 @@ TEST_F(ViewTest, TouchEvent) { View* root = widget->GetRootView(); root->AddChildView(v1); - static_cast<internal::RootView*>(root)->SetGestureManager(&gm); + static_cast<internal::RootView*>(root)->SetGestureManagerForTesting(&gm); v1->AddChildView(v2); v2->AddChildView(v3); diff --git a/views/views.gyp b/views/views.gyp index c1fab8c..08399a2 100644 --- a/views/views.gyp +++ b/views/views.gyp @@ -26,7 +26,7 @@ 'targets': [ { 'target_name': 'views', - 'type': 'static_library', + 'type': '<(component)', 'dependencies': [ '../base/base.gyp:base', '../base/base.gyp:base_i18n', @@ -41,6 +41,9 @@ '../ui/ui.gyp:ui', '../ui/ui.gyp:ui_resources', ], + 'defines': [ + 'VIEWS_IMPLEMENTATION', + ], 'sources': [ # All .cc, .h under views, except unittests 'accelerator.cc', @@ -298,6 +301,7 @@ 'view_text_utils.cc', 'view_text_utils.h', 'view_win.cc', + 'views_api.h', 'views_delegate.h', 'widget/aero_tooltip_manager.cc', 'widget/aero_tooltip_manager.h', @@ -422,12 +426,14 @@ 'dependencies': [ '../base/base.gyp:base', '../base/base.gyp:test_support_base', + '../build/temp_gyp/googleurl.gyp:googleurl', '../skia/skia.gyp:skia', '../testing/gmock.gyp:gmock', '../testing/gtest.gyp:gtest', '../third_party/icu/icu.gyp:icui18n', '../third_party/icu/icu.gyp:icuuc', '../ui/base/strings/ui_strings.gyp:ui_strings', + '../ui/ui.gyp:ui', '../ui/ui.gyp:ui_resources', 'views', ], @@ -513,6 +519,7 @@ 'type': 'executable', 'dependencies': [ '../base/base.gyp:base', + '../base/base.gyp:base_i18n', '../skia/skia.gyp:skia', '../third_party/icu/icu.gyp:icui18n', '../third_party/icu/icu.gyp:icuuc', @@ -655,6 +662,7 @@ 'type': 'executable', 'dependencies': [ '../base/base.gyp:base', + '../base/base.gyp:base_i18n', '../skia/skia.gyp:skia', '../third_party/icu/icu.gyp:icui18n', '../third_party/icu/icu.gyp:icuuc', diff --git a/views/views_api.h b/views/views_api.h new file mode 100644 index 0000000..7d6278d --- /dev/null +++ b/views/views_api.h @@ -0,0 +1,29 @@ +// 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_VIEWS_API_H_ +#define VIEWS_VIEWS_API_H_ +#pragma once + +// Defines VIEWS_API so that funtionality implemented by the UI module can be +// exported to consumers. + +#if defined(COMPONENT_BUILD) +#if defined(WIN32) + +#if defined(VIEWS_IMPLEMENTATION) +#define VIEWS_API __declspec(dllexport) +#else +#define VIEWS_API __declspec(dllimport) +#endif // defined(VIEWS_IMPLEMENTATION) + +#else // defined(WIN32) +#define VIEWS_API __attribute__((visibility("default"))) +#endif + +#else /// defined(COMPONENT_BUILD) +#define VIEWS_API +#endif + +#endif // UI_UI_API_H_ diff --git a/views/views_delegate.h b/views/views_delegate.h index 41ed17f..e162389 100644 --- a/views/views_delegate.h +++ b/views/views_delegate.h @@ -12,6 +12,7 @@ #endif #include "ui/base/accessibility/accessibility_types.h" +#include "views/views_api.h" namespace gfx { class Rect; @@ -32,7 +33,7 @@ class Widget; // // The embedding app must set views_delegate to assign its ViewsDelegate // implementation. -class ViewsDelegate { +class VIEWS_API ViewsDelegate { public: virtual ~ViewsDelegate() {} diff --git a/views/widget/default_theme_provider.h b/views/widget/default_theme_provider.h index 9d0ec52..3b96e32 100644 --- a/views/widget/default_theme_provider.h +++ b/views/widget/default_theme_provider.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 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,6 +10,7 @@ #include "base/basictypes.h" #include "ui/base/theme_provider.h" +#include "views/views_api.h" class Profile; @@ -20,7 +21,7 @@ using ui::ResourceBundle; namespace views { -class DefaultThemeProvider : public ui::ThemeProvider { +class VIEWS_API DefaultThemeProvider : public ui::ThemeProvider { public: DefaultThemeProvider(); virtual ~DefaultThemeProvider(); diff --git a/views/widget/monitor_win.h b/views/widget/monitor_win.h index b1cdf24..e50ab89 100644 --- a/views/widget/monitor_win.h +++ b/views/widget/monitor_win.h @@ -6,6 +6,8 @@ #define VIEWS_WIDGET_MONITOR_WIN_H_ #pragma once +#include "views/views_api.h" + namespace gfx { class Rect; } @@ -14,7 +16,7 @@ namespace views { // Returns the bounds for the monitor that contains the largest area of // intersection with the specified rectangle. -gfx::Rect GetMonitorBoundsForRect(const gfx::Rect& rect); +VIEWS_API gfx::Rect GetMonitorBoundsForRect(const gfx::Rect& rect); } // namespace views diff --git a/views/widget/native_widget.h b/views/widget/native_widget.h index 9ed37e7..866598e 100644 --- a/views/widget/native_widget.h +++ b/views/widget/native_widget.h @@ -23,7 +23,7 @@ class NativeWidgetPrivate; // Widget's native_widget() accessor, which code occasionally static_casts to // a known implementation in platform-specific code. // -class NativeWidget { +class VIEWS_API NativeWidget { public: virtual ~NativeWidget() {} diff --git a/views/widget/native_widget_delegate.h b/views/widget/native_widget_delegate.h index 20456fb..7da3cc7 100644 --- a/views/widget/native_widget_delegate.h +++ b/views/widget/native_widget_delegate.h @@ -6,6 +6,8 @@ #define VIEWS_WIDGET_NATIVE_WIDGET_DELEGATE_H_ #pragma once +#include "views/views_api.h" + namespace gfx { class Canvas; class Size; @@ -26,7 +28,7 @@ namespace internal { // An interface implemented by the object that handles events sent by a // NativeWidget implementation. // -class NativeWidgetDelegate { +class VIEWS_API NativeWidgetDelegate { public: virtual ~NativeWidgetDelegate() {} diff --git a/views/widget/native_widget_gtk.h b/views/widget/native_widget_gtk.h index 6d94f12..a6df8a9 100644 --- a/views/widget/native_widget_gtk.h +++ b/views/widget/native_widget_gtk.h @@ -41,9 +41,9 @@ class NativeWidgetDelegate; } // Widget implementation for GTK. -class NativeWidgetGtk : public internal::NativeWidgetPrivate, - public ui::ActiveWindowWatcherX::Observer, - public internal::InputMethodDelegate { +class VIEWS_API NativeWidgetGtk : public internal::NativeWidgetPrivate, + public ui::ActiveWindowWatcherX::Observer, + public internal::InputMethodDelegate { public: explicit NativeWidgetGtk(internal::NativeWidgetDelegate* delegate); virtual ~NativeWidgetGtk(); diff --git a/views/widget/native_widget_private.h b/views/widget/native_widget_private.h index baf85a4..0c40fbf 100644 --- a/views/widget/native_widget_private.h +++ b/views/widget/native_widget_private.h @@ -36,7 +36,7 @@ namespace internal { // NativeWidget implementations. This file should not be included // in code that does not fall into one of these use cases. // -class NativeWidgetPrivate : public NativeWidget { +class VIEWS_API NativeWidgetPrivate : public NativeWidget { public: virtual ~NativeWidgetPrivate() {} diff --git a/views/widget/native_widget_view.h b/views/widget/native_widget_view.h index 61fa8a7..2f86edc 100644 --- a/views/widget/native_widget_view.h +++ b/views/widget/native_widget_view.h @@ -27,7 +27,7 @@ namespace internal { // View hierarchy. It is responsible for receiving relevant events from that // hierarchy and forwarding them to its NativeWidgetViews' delegate's hierarchy. // -class NativeWidgetView : public View { +class VIEWS_API NativeWidgetView : public View { public: static const char kViewClassName[]; diff --git a/views/widget/native_widget_views.h b/views/widget/native_widget_views.h index 4d421a1..ed46fb2 100644 --- a/views/widget/native_widget_views.h +++ b/views/widget/native_widget_views.h @@ -23,8 +23,8 @@ class NativeWidgetView; // // A NativeWidget implementation that uses another View as its native widget. // -class NativeWidgetViews : public internal::NativeWidgetPrivate, - public internal::InputMethodDelegate { +class VIEWS_API NativeWidgetViews : public internal::NativeWidgetPrivate, + public internal::InputMethodDelegate { public: explicit NativeWidgetViews(internal::NativeWidgetDelegate* delegate); virtual ~NativeWidgetViews(); diff --git a/views/widget/native_widget_win.h b/views/widget/native_widget_win.h index 930536b..c4b5916 100644 --- a/views/widget/native_widget_win.h +++ b/views/widget/native_widget_win.h @@ -48,9 +48,9 @@ class NativeWidgetDelegate; // This is exposed only for testing // Adjusts the value of |child_rect| if necessary to ensure that it is // completely visible within |parent_rect|. -void EnsureRectIsVisibleInRect(const gfx::Rect& parent_rect, - gfx::Rect* child_rect, - int padding); +VIEWS_API void EnsureRectIsVisibleInRect(const gfx::Rect& parent_rect, + gfx::Rect* child_rect, + int padding); } // namespace internal // A Windows message reflected from other windows. This message is sent @@ -85,10 +85,10 @@ const int WM_NCUAHDRAWFRAME = 0xAF; // then responsible for cleaning up after it. // /////////////////////////////////////////////////////////////////////////////// -class NativeWidgetWin : public ui::WindowImpl, - public internal::NativeWidgetPrivate, - public MessageLoopForUI::Observer, - public internal::InputMethodDelegate { +class VIEWS_API NativeWidgetWin : public ui::WindowImpl, + public internal::NativeWidgetPrivate, + public MessageLoopForUI::Observer, + public internal::InputMethodDelegate { public: explicit NativeWidgetWin(internal::NativeWidgetDelegate* delegate); virtual ~NativeWidgetWin(); diff --git a/views/widget/root_view.h b/views/widget/root_view.h index 2b7935b..0dde54c 100644 --- a/views/widget/root_view.h +++ b/views/widget/root_view.h @@ -41,9 +41,9 @@ namespace internal { // TODO(beng): Enforce no other callers to AddChildView/tree functions by // overriding those methods as private here. // TODO(beng): Clean up API further, make Widget a friend. +// TODO(sky): We don't really want to export this class. // -class RootView : public View, - public FocusTraversable { +class VIEWS_API RootView : public View, public FocusTraversable { public: static const char kViewClassName[]; @@ -74,11 +74,8 @@ class RootView : public View, // it. Returns whether anyone consumed the event. bool OnKeyEvent(const KeyEvent& event); -#if defined(UNIT_TEST) - // For unit testing purposes, we use this method to set a mock - // GestureManager - void SetGestureManager(GestureManager* g) { gesture_manager_ = g; } -#endif + // Provided only for testing: + void SetGestureManagerForTesting(GestureManager* g) { gesture_manager_ = g; } // Focus --------------------------------------------------------------------- diff --git a/views/widget/tooltip_manager.h b/views/widget/tooltip_manager.h index 4931557..28ca52d 100644 --- a/views/widget/tooltip_manager.h +++ b/views/widget/tooltip_manager.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 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. @@ -9,6 +9,7 @@ #include <string> #include "base/basictypes.h" +#include "views/views_api.h" namespace gfx { class Font; @@ -21,7 +22,7 @@ class View; // TooltipManager takes care of the wiring to support tooltips for Views. You // almost never need to interact directly with TooltipManager, rather look to // the various tooltip methods on View. -class TooltipManager { +class VIEWS_API TooltipManager { public: // Returns the height of tooltips. This should only be invoked from within // GetTooltipTextOrigin. diff --git a/views/widget/widget.h b/views/widget/widget.h index 883d86c..372b5a8 100644 --- a/views/widget/widget.h +++ b/views/widget/widget.h @@ -87,8 +87,8 @@ class RootView; // the Widget it is responsible for destroying the NativeWidget (from its // destructor). // -class Widget : public internal::NativeWidgetDelegate, - public FocusTraversable { +class VIEWS_API Widget : public internal::NativeWidgetDelegate, + public FocusTraversable { public: // Observers can listen to various events on the Widgets. class Observer { @@ -106,7 +106,7 @@ class Widget : public internal::NativeWidgetDelegate, FRAME_TYPE_FORCE_NATIVE // Force the native frame. }; - struct InitParams { + struct VIEWS_API InitParams { enum Type { TYPE_WINDOW, // A decorated Window, like a frame window. // Widgets of TYPE_WINDOW will have a NonClientView. diff --git a/views/widget/widget_delegate.h b/views/widget/widget_delegate.h index 8dc21bc..450aba7 100644 --- a/views/widget/widget_delegate.h +++ b/views/widget/widget_delegate.h @@ -27,7 +27,7 @@ class Widget; // WidgetDelegate interface // Handles events on Widgets in context-specific ways. -class WidgetDelegate { +class VIEWS_API WidgetDelegate { public: WidgetDelegate(); @@ -159,8 +159,7 @@ class WidgetDelegate { // A WidgetDelegate implementation that is-a View. Used to override GetWidget() // to call View's GetWidget() for the common case where a WidgetDelegate // implementation is-a View. -class WidgetDelegateView : public WidgetDelegate, - public View { +class VIEWS_API WidgetDelegateView : public WidgetDelegate, public View { public: WidgetDelegateView(); virtual ~WidgetDelegateView(); diff --git a/views/window/client_view.h b/views/window/client_view.h index 0af791e..9e85cba 100644 --- a/views/window/client_view.h +++ b/views/window/client_view.h @@ -21,7 +21,7 @@ class Widget; // such as non-client hit testing information, sizing etc. Sub-classes of // ClientView are used to create more elaborate contents, e.g. // "DialogClientView". -class ClientView : public View { +class VIEWS_API ClientView : public View { public: // Internal class name static const char kViewClassName[]; diff --git a/views/window/dialog_client_view.h b/views/window/dialog_client_view.h index 615cd50..4be8460 100644 --- a/views/window/dialog_client_view.h +++ b/views/window/dialog_client_view.h @@ -32,9 +32,9 @@ class RootView; // DialogClientView also provides the ability to set an arbitrary view that is // positioned beneath the buttons. // -class DialogClientView : public ClientView, - public ButtonListener, - public FocusChangeListener { +class VIEWS_API DialogClientView : public ClientView, + public ButtonListener, + public FocusChangeListener { public: DialogClientView(Widget* widget, View* contents_view); virtual ~DialogClientView(); diff --git a/views/window/dialog_delegate.h b/views/window/dialog_delegate.h index bfcec75..0363cbb 100644 --- a/views/window/dialog_delegate.h +++ b/views/window/dialog_delegate.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. @@ -27,7 +27,7 @@ class View; // certain events. // /////////////////////////////////////////////////////////////////////////////// -class DialogDelegate : public WidgetDelegate { +class VIEWS_API DialogDelegate : public WidgetDelegate { public: virtual DialogDelegate* AsDialogDelegate(); @@ -115,8 +115,8 @@ class DialogDelegate : public WidgetDelegate { // A DialogDelegate implementation that is-a View. Used to override GetWidget() // to call View's GetWidget() for the common case where a DialogDelegate // implementation is-a View. -class DialogDelegateView : public DialogDelegate, - public View { +class VIEWS_API DialogDelegateView : public DialogDelegate, + public View { public: DialogDelegateView(); virtual ~DialogDelegateView(); diff --git a/views/window/native_frame_view.h b/views/window/native_frame_view.h index 4a05d1b..4743681 100644 --- a/views/window/native_frame_view.h +++ b/views/window/native_frame_view.h @@ -12,7 +12,7 @@ namespace views { class Widget; -class NativeFrameView : public NonClientFrameView { +class VIEWS_API NativeFrameView : public NonClientFrameView { public: explicit NativeFrameView(Widget* frame); virtual ~NativeFrameView(); diff --git a/views/window/non_client_view.h b/views/window/non_client_view.h index 2f5b5509..27fa9e7 100644 --- a/views/window/non_client_view.h +++ b/views/window/non_client_view.h @@ -23,7 +23,7 @@ namespace views { // responds to events within the frame portions of the non-client area of a // window. This view does _not_ contain the ClientView, but rather is a sibling // of it. -class NonClientFrameView : public View { +class VIEWS_API NonClientFrameView : public View { public: // Internal class name. static const char kViewClassName[]; @@ -131,7 +131,7 @@ class NonClientFrameView : public View { // implementations (e.g. during the switch from DWM/Aero-Glass to Vista Basic/ // Classic rendering). // -class NonClientView : public View { +class VIEWS_API NonClientView : public View { public: // Internal class name. static const char kViewClassName[]; diff --git a/views/window/window_shape.h b/views/window/window_shape.h index e65bc2b..0238b71 100644 --- a/views/window/window_shape.h +++ b/views/window/window_shape.h @@ -6,6 +6,8 @@ #define VIEWS_WINDOW_WINDOW_SHAPE_H_ #pragma once +#include "views/views_api.h" + namespace gfx { class Size; class Path; @@ -15,7 +17,8 @@ namespace views { // Sets the window mask to a style that most likely matches // ui/resources/window_* -void GetDefaultWindowMask(const gfx::Size& size, gfx::Path* window_mask); +VIEWS_API void GetDefaultWindowMask(const gfx::Size& size, + gfx::Path* window_mask); } // namespace views |