From 6827766b1fcc5885b7a8bc8c707e283f71f46f09 Mon Sep 17 00:00:00 2001 From: "darin@chromium.org" Date: Thu, 28 Jul 2011 06:32:33 +0000 Subject: [PATCH] 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 --- base/message_pump_win.h | 4 +-- chrome/browser/aeropeek_manager.cc | 2 ++ .../ui/views/frame/browser_frame_win.cc | 2 ++ .../animation/animation_container_observer.h | 4 ++- ui/base/animation/animation_delegate.h | 4 ++- ui/base/models/accelerator.h | 3 +- ui/base/models/table_model_observer.h | 4 ++- ui/base/models/tree_model.h | 2 +- ui/base/ui_base_exports.cc | 11 ++++++ ui/ui.gyp | 2 ++ ui/ui_api.h | 2 +- views/accelerator.h | 7 ++-- views/animation/bounds_animator.h | 5 +-- views/background.h | 3 +- views/border.h | 4 +-- views/context_menu_controller.h | 4 ++- views/controls/button/button.h | 6 ++-- views/controls/button/button_dropdown.h | 2 +- views/controls/button/checkbox.h | 2 +- views/controls/button/custom_button.h | 4 +-- views/controls/button/image_button.h | 4 +-- views/controls/button/menu_button.h | 2 +- views/controls/button/radio_button.h | 2 +- views/controls/button/text_button.h | 11 +++--- views/controls/combobox/combobox.h | 14 +++----- .../native_combobox_views_unittest.cc | 4 +-- .../combobox/native_combobox_wrapper.h | 3 +- views/controls/image_view.h | 2 +- views/controls/label.cc | 5 ++- views/controls/label.h | 5 +-- views/controls/link.h | 2 +- views/controls/menu/menu.h | 5 +-- views/controls/menu/menu_2.h | 3 +- views/controls/menu/menu_config.h | 5 +-- views/controls/menu/menu_controller.h | 2 +- views/controls/menu/menu_delegate.h | 2 +- views/controls/menu/menu_item_view.h | 2 +- views/controls/menu/menu_model_adapter.h | 2 +- views/controls/menu/menu_runner.h | 2 +- views/controls/menu/menu_wrapper.h | 5 +-- views/controls/menu/native_menu_win.h | 5 +-- views/controls/menu/submenu_view.h | 2 +- views/controls/message_box_view.h | 2 +- views/controls/native/native_view_host.h | 2 +- views/controls/native_control.h | 2 +- views/controls/progress_bar.h | 2 +- views/controls/resize_area.h | 2 +- views/controls/scroll_view.h | 5 ++- views/controls/scrollbar/native_scroll_bar.h | 4 +-- views/controls/scrollbar/scroll_bar.h | 6 ++-- views/controls/separator.h | 2 +- views/controls/single_split_view.h | 2 +- views/controls/tabbed_pane/tabbed_pane.h | 2 +- views/controls/table/group_table_view.h | 4 +-- views/controls/table/table_view.h | 9 ++--- views/controls/table/table_view2.h | 2 +- .../textfield/native_textfield_views.h | 14 ++++---- .../native_textfield_views_unittest.cc | 4 +-- .../controls/textfield/native_textfield_win.h | 8 ++--- .../textfield/native_textfield_wrapper.h | 3 +- views/controls/textfield/textfield.h | 14 +++----- .../textfield/textfield_views_model.h | 5 +-- views/controls/throbber.h | 6 ++-- views/controls/tree/tree_view.h | 2 +- views/drag_controller.h | 4 ++- views/drag_utils.h | 36 ++++++++++--------- views/events/event.h | 19 +++++----- views/events/event_utils_win.h | 3 +- views/focus/accelerator_handler.h | 3 +- views/focus/external_focus_tracker.h | 4 +-- views/focus/focus_manager.h | 8 ++--- views/focus/focus_search.h | 4 +-- views/focus/focus_util_win.h | 8 +++-- views/focus/view_storage.h | 4 +-- views/ime/input_method.h | 3 +- views/ime/input_method_base.h | 4 +-- views/ime/input_method_delegate.h | 4 ++- views/ime/mock_input_method.h | 2 +- views/ime/text_input_client.h | 3 +- views/layer_property_setter.h | 4 ++- views/layout/box_layout.h | 2 +- views/layout/fill_layout.h | 2 +- views/layout/grid_layout.h | 4 +-- views/layout/layout_manager.h | 4 ++- views/metrics.h | 6 ++-- views/mouse_watcher.h | 5 +-- views/native_theme_delegate.h | 3 +- views/native_theme_painter.h | 2 +- views/painter.h | 7 ++-- views/touchui/gesture_manager.h | 2 +- views/view.h | 2 +- views/view_constants.h | 6 ++-- views/view_text_utils.h | 21 +++++------ views/view_unittest.cc | 2 +- views/views.gyp | 10 +++++- views/views_api.h | 29 +++++++++++++++ views/views_delegate.h | 3 +- views/widget/default_theme_provider.h | 5 +-- views/widget/monitor_win.h | 4 ++- views/widget/native_widget.h | 2 +- views/widget/native_widget_delegate.h | 4 ++- views/widget/native_widget_gtk.h | 6 ++-- views/widget/native_widget_private.h | 2 +- views/widget/native_widget_view.h | 2 +- views/widget/native_widget_views.h | 4 +-- views/widget/native_widget_win.h | 14 ++++---- views/widget/root_view.h | 11 +++--- views/widget/tooltip_manager.h | 5 +-- views/widget/widget.h | 6 ++-- views/widget/widget_delegate.h | 5 ++- views/window/client_view.h | 2 +- views/window/dialog_client_view.h | 6 ++-- views/window/dialog_delegate.h | 8 ++--- views/window/native_frame_view.h | 2 +- views/window/non_client_view.h | 4 +-- views/window/window_shape.h | 5 ++- 116 files changed, 341 insertions(+), 247 deletions(-) create mode 100644 ui/base/ui_base_exports.cc create mode 100644 views/views_api.h diff --git a/base/message_pump_win.h b/base/message_pump_win.h index 5642220ad6c7c7..721074f1e18345 100644 --- a/base/message_pump_win.h +++ b/base/message_pump_win.h @@ -29,7 +29,7 @@ class BASE_API MessagePumpWin : public MessagePump { // // NOTE: An Observer implementation should be extremely fast! // - class Observer { + class BASE_API Observer { public: virtual ~Observer() {} @@ -50,7 +50,7 @@ class BASE_API MessagePumpWin : public MessagePump { // // The nested loop is exited by either posting a quit, or returning false // from Dispatch. - class Dispatcher { + class BASE_API Dispatcher { public: virtual ~Dispatcher() {} // Dispatches the event. If true is returned processing continues as diff --git a/chrome/browser/aeropeek_manager.cc b/chrome/browser/aeropeek_manager.cc index a704712f91ae43..91e94377270330 100644 --- a/chrome/browser/aeropeek_manager.cc +++ b/chrome/browser/aeropeek_manager.cc @@ -40,6 +40,8 @@ #include "ui/gfx/icon_util.h" #include "views/widget/native_widget_win.h" +#pragma comment(lib, "dwmapi.lib") + namespace { // Macros and COM interfaces used in this file. diff --git a/chrome/browser/ui/views/frame/browser_frame_win.cc b/chrome/browser/ui/views/frame/browser_frame_win.cc index 8d170a4780d7cb..8fca006757a631 100644 --- a/chrome/browser/ui/views/frame/browser_frame_win.cc +++ b/chrome/browser/ui/views/frame/browser_frame_win.cc @@ -21,6 +21,8 @@ #include "views/widget/widget.h" #include "views/window/non_client_view.h" +#pragma comment(lib, "dwmapi.lib") + // static static const int kClientEdgeThickness = 3; static const int kTabDragWindowAlpha = 200; diff --git a/ui/base/animation/animation_container_observer.h b/ui/base/animation/animation_container_observer.h index b01a47610a088f..17fee92bd44120 100644 --- a/ui/base/animation/animation_container_observer.h +++ b/ui/base/animation/animation_container_observer.h @@ -6,13 +6,15 @@ #define UI_BASE_ANIMATION_ANIMATION_CONTAINER_OBSERVER_H_ #pragma once +#include "ui/ui_api.h" + namespace ui { class AnimationContainer; // The observer is notified after every update of the animations managed by // the container. -class AnimationContainerObserver { +class UI_API AnimationContainerObserver { public: // Invoked on every tick of the timer managed by the container and after // all the animations have updated. diff --git a/ui/base/animation/animation_delegate.h b/ui/base/animation/animation_delegate.h index 958aa89c45fa8c..8c65d8f00c8378 100644 --- a/ui/base/animation/animation_delegate.h +++ b/ui/base/animation/animation_delegate.h @@ -6,6 +6,8 @@ #define UI_BASE_ANIMATION_ANIMATION_DELEGATE_H_ #pragma once +#include "ui/ui_api.h" + namespace ui { class Animation; @@ -14,7 +16,7 @@ class Animation; // // Implement this interface when you want to receive notifications about the // state of an animation. -class AnimationDelegate { +class UI_API AnimationDelegate { public: // Called when an animation has completed. virtual void AnimationEnded(const Animation* animation) {} diff --git a/ui/base/models/accelerator.h b/ui/base/models/accelerator.h index 6ea1311bafd45c..8d8921b781f9f2 100644 --- a/ui/base/models/accelerator.h +++ b/ui/base/models/accelerator.h @@ -7,12 +7,13 @@ #pragma once #include "ui/base/keycodes/keyboard_codes.h" +#include "ui/ui_api.h" namespace ui { // This is a cross-platform base class for accelerator keys used in menus. It is // meant to be subclassed for concrete toolkit implementations. -class Accelerator { +class UI_API Accelerator { public: Accelerator() : key_code_(ui::VKEY_UNKNOWN), modifiers_(0) {} diff --git a/ui/base/models/table_model_observer.h b/ui/base/models/table_model_observer.h index c70e89bb99c40c..15e9851c9688a6 100644 --- a/ui/base/models/table_model_observer.h +++ b/ui/base/models/table_model_observer.h @@ -6,11 +6,13 @@ #define UI_BASE_MODELS_TABLE_MODEL_OBSERVER_H_ #pragma once +#include "ui/ui_api.h" + namespace ui { // Observer for a TableModel. Anytime the model changes, it must notify its // observer. -class TableModelObserver { +class UI_API TableModelObserver { public: // Invoked when the model has been completely changed. virtual void OnModelChanged() = 0; diff --git a/ui/base/models/tree_model.h b/ui/base/models/tree_model.h index 56b1bffc586225..77cb07a99256a4 100644 --- a/ui/base/models/tree_model.h +++ b/ui/base/models/tree_model.h @@ -30,7 +30,7 @@ class TreeModelNode { }; // Observer for the TreeModel. Notified of significant events to the model. -class TreeModelObserver { +class UI_API TreeModelObserver { public: // Notification that nodes were added to the specified parent. virtual void TreeNodesAdded(TreeModel* model, diff --git a/ui/base/ui_base_exports.cc b/ui/base/ui_base_exports.cc new file mode 100644 index 00000000000000..fccbcb6a0d2601 --- /dev/null +++ b/ui/base/ui_base_exports.cc @@ -0,0 +1,11 @@ +// 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. + +// This file is for including headers that are not included in any other .cc +// files contained with the ui module. We need to include these here so that +// linker will know to include the symbols, defined by these headers, in the +// resulting dynamic library (ui.dll). + +#include "ui/base/models/accelerator.h" +#include "ui/base/models/table_model_observer.h" diff --git a/ui/ui.gyp b/ui/ui.gyp index a8d9439ef71813..86a81f6ba3b265 100644 --- a/ui/ui.gyp +++ b/ui/ui.gyp @@ -176,6 +176,7 @@ 'base/text/text_elider.h', 'base/theme_provider.cc', 'base/theme_provider.h', + 'base/ui_base_exports.cc', 'base/ui_base_paths.cc', 'base/ui_base_paths.h', 'base/ui_base_switches.cc', @@ -273,6 +274,7 @@ 'gfx/skia_utils_gtk.h', 'gfx/transform.h', 'gfx/transform.cc', + 'ui_api.h', ], 'conditions': [ ['toolkit_uses_gtk == 1', { diff --git a/ui/ui_api.h b/ui/ui_api.h index a9872f852d8c45..549447295eb42d 100644 --- a/ui/ui_api.h +++ b/ui/ui_api.h @@ -16,7 +16,7 @@ #define UI_API __declspec(dllexport) #else #define UI_API __declspec(dllimport) -#endif // defined(UI_BASE_IMPLEMENTATION) +#endif // defined(UI_IMPLEMENTATION) #else // defined(WIN32) #define UI_API __attribute__((visibility("default"))) diff --git a/views/accelerator.h b/views/accelerator.h index a6cbaf438e64f5..20638b3ed52c50 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 6785e430b0d4da..a044ede13e0333 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 abed279ddc8b11..615b3585e7aa36 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 15d94b037ebd9a..3d57c5d6c0a765 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 d65bb1a024da3d..123400de2459be 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 0c9c6c76b917ab..c58433fb7f9bc7 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 c94f657b89bd70..950aec83e35226 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 648087dd83af4b..583dc5d0558969 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 4c414debae7008..ce45405e37ba47 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 daac44c606baf5..5e11244c4bc495 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 edab18b49f1de9..2cc88bff813696 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 330b213c3555ac..a56b256e1d9c6f 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 6df95da44dec26..ced8f580514015 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 483238dae6dd24..6a472b5ecdbdcc 100644 --- a/views/controls/combobox/combobox.h +++ b/views/controls/combobox/combobox.h @@ -8,12 +8,9 @@ #include -#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 31aa194a1cd481..4ebf0214ecb10e 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(combobox_->native_wrapper()); + combobox_view_ = static_cast( + 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 7d88563ab6f2c0..f84225a87a9c6a 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 c88cca4a55b92b..7096c295f16efb 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 83dd8d61da33c3..fe328842d0c8a8 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 a053e44409eb7d..8615a9d075128a 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 548df6bcdfc845..0ba6a381beed1f 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 669946114c14af..ee3f018f696bd0 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 01cb51b1bec8b3..935729038b6b94 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 06a31f1a398d79..dc2b7a3fa6bdd8 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 53887e4bce0a60..2b62e60eee9039 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 2d441216e7a019..13b457dce753a1 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 1403729e0d786a..cc0a91f9890ade 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 2fbbf4baf6076f..18a61a5fbdfcc1 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 3dfece5152fda9..873a201dcb4864 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 0816fc0a59135d..a6e67d07496c59 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 3d1ea7df0c0533..8eff89155483d1 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 1ec627b32bfde5..e9d42278047ee2 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 a3f1355dbf70eb..a9ede6fda71028 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 cb711cd3dbcd2b..a9c606b592cbec 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 9cf604e487989c..395811f83b97ed 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 601186dbaa59f5..0de768b881f89d 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 1ac9f827f958ce..c6abf153eb930b 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 d8ffd153ff46e1..1a25d688f6ad45 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 32a128634cad3b..5bcb0a23ea5b21 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 d7f187beacbf63..bbc0d218909bf1 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 405efc34a8d121..50f2918c71b8c7 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 d325fd0c871579..a77ae62dccd657 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 eeef7a8073d42f..96b10ad3960b9a 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 cbf0822be3cfb7..9de687de2311a4 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 a0181c90ae2756..8594a61e3ef889 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 f7b37722a686c1..eeeaf7b4282cce 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 ea6fec8610e5dc..4521504bf53d26 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 0c8ec2e5c9c9e9..55e19ccd6cde20 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(textfield_->native_wrapper()); + textfield_view_ = static_cast( + 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 ceabb34c3de7d2..53c2327be83108 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 6cef09f14a99dc..1a1e5897f1e9eb 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 66675d53ca81d4..0cbb1018f2ce21 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 3f63fe41de5d71..0c4926703a9b98 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 afc25370ef4a76..4da93b3cb5d3cc 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 c43502b640fe8f..28f6ddc5b2568a 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 c7012d8c99aa1d..51665561d372d9 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 ad17ce9d9497f0..b7d743f79bb286 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 #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 7c42537934c1f3..07a86b0309c301 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 9133864ef4ba09..258fa611553f83 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 630c0111c58c20..a2ef532086038e 100644 --- a/views/focus/accelerator_handler.h +++ b/views/focus/accelerator_handler.h @@ -16,6 +16,7 @@ #include #include "base/message_loop.h" +#include "views/views_api.h" namespace views { @@ -31,7 +32,7 @@ void SetTouchDeviceList(std::vector& 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 8080f3997f15e1..a4a12cf95face1 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 a75f79ab2b59dd..018a4f22d0e1ae 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 5fcffe23331219..571982a877a827 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 3bfeec4cf44468..38f4626eaa5272 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 +#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 129b90e880b2a7..68ab9606f50599 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; diff --git a/views/ime/input_method.h b/views/ime/input_method.h index 918d78c031d802..80924e00781645 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 1bea5260a20f68..c835a03f5ae72b 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 70d2ac36cefb78..c683c6521ccc6f 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 26917611791496..a364636ab1e011 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 2f2d1fc76022d9..b6264795555514 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 c4080f9c5b7fd3..da34c6c96370ab 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 e2910b49421369..e8798f76a0e297 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 b8974d97ba7138..b9451a325f731e 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 f2a01741aa8fa2..062ce8df1b4b65 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 3fb99c1db050df..0fb395a4a93ee2 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 88b8fd47da88cc..3558a0947c7520 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 0294a71c30daf6..c7a270c8c0c0da 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 d94a5149ef0a50..9ae390fd618fd5 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 a2c45bcb66df92..c1d6c23f5d8072 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 6cfb7dc7d0adee..45cab2b234cd79 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 40d487f37074ee..22693f7331c5f8 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 00c664b082aeb5..66da529e2384be 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 Views; diff --git a/views/view_constants.h b/views/view_constants.h index 6dbc1de70529c6..ffdf7a0505de4f 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 933d265b96c05c..cc3022018c61a4 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 8e7cc6a45e86f7..0309ada5a0d6d7 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(root)->SetGestureManager(&gm); + static_cast(root)->SetGestureManagerForTesting(&gm); v1->AddChildView(v2); v2->AddChildView(v3); diff --git a/views/views.gyp b/views/views.gyp index c1fab8cabc13b7..08399a23a5a2c6 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 00000000000000..7d6278d3020100 --- /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 41ed17f635bfbc..e1623892d003a4 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 9d0ec5246dafbb..3b96e32cc1aef5 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 b1cdf24c4cc1bc..e50ab8942d90f8 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 9ed37e73f0606c..866598e971e063 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 20456fb8a1cc53..7da3cc7a8e16b5 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 6d94f12f63bf7c..a6df8a97df9d94 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 baf85a44fcf6e1..0c40fbf825ced2 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 61fa8a778c11a9..2f86edcbd014bb 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 4d421a1fde1595..ed46fb2efbcf34 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 930536beb4b59e..c4b591682a9b78 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 2b7935b15eda1b..0dde54cffabf8a 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 4931557fa4e89b..28ca52d7635584 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 #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 883d86c00cb6c7..372b5a8147e04e 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 8dc21bcaeec14d..450aba7ec0fdc3 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 0af791ee50851b..9e85cba86ae501 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 615cd50504a924..4be846035c89c3 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 bfcec7563500be..0363cbb4e2435e 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 4a05d1bc2e12b5..4743681d725602 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 2f5b55095eb7ab..27fa9e786e504e 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 e65bc2b2e255b6..0238b71b2770df 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