diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-16 23:51:38 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-16 23:51:38 +0000 |
commit | c2dacc9ec41232903ba700c6aef5ef98bfcb8af8 (patch) | |
tree | 4aa4d7100862c64bdd92d70e6323001beb19edb7 /chrome/views | |
parent | d66e710ec668e34271def44d7f0416260657171c (diff) | |
download | chromium_src-c2dacc9ec41232903ba700c6aef5ef98bfcb8af8.zip chromium_src-c2dacc9ec41232903ba700c6aef5ef98bfcb8af8.tar.gz chromium_src-c2dacc9ec41232903ba700c6aef5ef98bfcb8af8.tar.bz2 |
Rename ChromeViews namespace to views
http://crbug.com/2188
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3495 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views')
123 files changed, 509 insertions, 513 deletions
diff --git a/chrome/views/accelerator.cc b/chrome/views/accelerator.cc index 05e6bba..2239867 100644 --- a/chrome/views/accelerator.cc +++ b/chrome/views/accelerator.cc @@ -9,7 +9,7 @@ #include "chrome/common/l10n_util.h" #include "generated_resources.h" -namespace ChromeViews { +namespace views { std::wstring Accelerator::GetShortcutText() const { int string_id = 0; @@ -94,8 +94,8 @@ std::wstring Accelerator::GetShortcutText() const { // string. // // TODO(idana) bug# 1232732: this hack can be avoided if instead of using - // ChromeViews::Menu we use ChromeViews::MenuItemView because the latter is a - // View subclass and therefore it supports marking text as RTL or LTR using + // views::Menu we use views::MenuItemView because the latter is a View + // subclass and therefore it supports marking text as RTL or LTR using // standard Unicode directionality marks. if (adjust_shortcut_for_rtl) { int key_length = static_cast<int>(shortcut_rtl.length()); @@ -110,5 +110,5 @@ std::wstring Accelerator::GetShortcutText() const { return shortcut; } -} // namespace ChromeViews +} // namespace views diff --git a/chrome/views/accelerator.h b/chrome/views/accelerator.h index bf71847..2bf8253 100644 --- a/chrome/views/accelerator.h +++ b/chrome/views/accelerator.h @@ -15,7 +15,7 @@ #include "chrome/views/event.h" -namespace ChromeViews { +namespace views { class Accelerator { public: diff --git a/chrome/views/accelerator_handler.cc b/chrome/views/accelerator_handler.cc index 1ac0283..94adc57 100644 --- a/chrome/views/accelerator_handler.cc +++ b/chrome/views/accelerator_handler.cc @@ -6,7 +6,7 @@ #include "chrome/views/focus_manager.h" -namespace ChromeViews { +namespace views { AcceleratorHandler::AcceleratorHandler() { } @@ -14,8 +14,7 @@ AcceleratorHandler::AcceleratorHandler() { bool AcceleratorHandler::Dispatch(const MSG& msg) { bool process_message = true; if ((msg.message == WM_KEYDOWN) || (msg.message == WM_SYSKEYDOWN)) { - ChromeViews::FocusManager* focus_manager = - ChromeViews::FocusManager::GetFocusManager(msg.hwnd); + FocusManager* focus_manager = FocusManager::GetFocusManager(msg.hwnd); if (focus_manager) { // FocusManager::OnKeyDown returns false if this message has been // consumed and should not be propogated further @@ -33,4 +32,4 @@ bool AcceleratorHandler::Dispatch(const MSG& msg) { return true; } -} +} // namespace views diff --git a/chrome/views/accelerator_handler.h b/chrome/views/accelerator_handler.h index 9405178..b836240 100644 --- a/chrome/views/accelerator_handler.h +++ b/chrome/views/accelerator_handler.h @@ -7,7 +7,7 @@ #include "base/message_loop.h" -namespace ChromeViews { +namespace views { // This class delegates WM_KEYDOWN and WM_SYSKEYDOWN messages to // the associated FocusManager class for the window that is receiving @@ -24,6 +24,8 @@ class AcceleratorHandler : public MessageLoopForUI::Dispatcher { private: DISALLOW_EVIL_CONSTRUCTORS(AcceleratorHandler); }; -} + +} // namespace views + #endif // CHROME_VIEWS_ACCELERATOR_HANDLER_H__ diff --git a/chrome/views/accessibility/accessible_wrapper.cc b/chrome/views/accessibility/accessible_wrapper.cc index cc61690..bc7a792 100644 --- a/chrome/views/accessibility/accessible_wrapper.cc +++ b/chrome/views/accessibility/accessible_wrapper.cc @@ -13,7 +13,7 @@ // //////////////////////////////////////////////////////////////////////////////// -AccessibleWrapper::AccessibleWrapper(ChromeViews::View* view) : +AccessibleWrapper::AccessibleWrapper(views::View* view) : accessibility_info_(NULL), view_(view) { } diff --git a/chrome/views/accessibility/accessible_wrapper.h b/chrome/views/accessibility/accessible_wrapper.h index d9e19ac..2785dfe4 100644 --- a/chrome/views/accessibility/accessible_wrapper.h +++ b/chrome/views/accessibility/accessible_wrapper.h @@ -10,8 +10,8 @@ #include "base/basictypes.h" -namespace ChromeViews { - class View; +namespace views { +class View; } //////////////////////////////////////////////////////////////////////////////// @@ -26,7 +26,7 @@ namespace ChromeViews { //////////////////////////////////////////////////////////////////////////////// class AccessibleWrapper { public: - explicit AccessibleWrapper(ChromeViews::View* view); + explicit AccessibleWrapper(views::View* view); ~AccessibleWrapper() {} STDMETHODIMP CreateDefaultInstance(REFIID iid); @@ -47,7 +47,7 @@ class AccessibleWrapper { CComPtr<IAccessible> accessibility_info_; // View needed to initialize IAccessible. - ChromeViews::View* view_; + views::View* view_; DISALLOW_COPY_AND_ASSIGN(AccessibleWrapper); }; diff --git a/chrome/views/accessibility/view_accessibility.cc b/chrome/views/accessibility/view_accessibility.cc index 838995a..af2d933 100644 --- a/chrome/views/accessibility/view_accessibility.cc +++ b/chrome/views/accessibility/view_accessibility.cc @@ -9,7 +9,7 @@ #include "chrome/browser/views/location_bar_view.h" #include "chrome/views/accessibility/accessible_wrapper.h" -HRESULT ViewAccessibility::Initialize(ChromeViews::View* view) { +HRESULT ViewAccessibility::Initialize(views::View* view) { if (!view) { return E_INVALIDARG; } @@ -39,7 +39,7 @@ STDMETHODIMP ViewAccessibility::get_accChild(VARIANT var_child, return S_OK; } - ChromeViews::View* child = NULL; + views::View* child = NULL; bool get_iaccessible = false; // Check to see if child is out-of-bounds. @@ -60,7 +60,7 @@ STDMETHODIMP ViewAccessibility::get_accChild(VARIANT var_child, // Sprecial case to handle the AutocompleteEdit MSAA. if (child->GetID() == VIEW_ID_AUTOCOMPLETE) { - ChromeViews::View* parent = child->GetParent(); + views::View* parent = child->GetParent(); // Paranoia check, to make sure we are making a correct cast. if (parent->GetID() == VIEW_ID_LOCATION_BAR) { @@ -106,7 +106,7 @@ STDMETHODIMP ViewAccessibility::get_accParent(IDispatch** disp_parent) { return E_INVALIDARG; } - ChromeViews::View* parent = view_->GetParent(); + views::View* parent = view_->GetParent(); if (!parent) { // This function can get called during teardown of ContainerWin so we @@ -168,7 +168,7 @@ STDMETHODIMP ViewAccessibility::accNavigate(LONG nav_dir, VARIANT start, child_id = view_->GetChildViewCount() - 1; } - ChromeViews::View* child = view_->GetChildViewAt(child_id); + views::View* child = view_->GetChildViewAt(child_id); if (child->GetChildViewCount() != 0) { end->vt = VT_DISPATCH; @@ -196,7 +196,7 @@ STDMETHODIMP ViewAccessibility::accNavigate(LONG nav_dir, VARIANT start, case NAVDIR_DOWN: case NAVDIR_NEXT: { // Retrieve parent to access view index and perform bounds checking. - ChromeViews::View* parent = view_->GetParent(); + views::View* parent = view_->GetParent(); if (!parent) { return E_FAIL; } @@ -218,7 +218,7 @@ STDMETHODIMP ViewAccessibility::accNavigate(LONG nav_dir, VARIANT start, } } - ChromeViews::View* child = parent->GetChildViewAt(view_index); + views::View* child = parent->GetChildViewAt(view_index); if (child->GetChildViewCount() != 0) { end->vt = VT_DISPATCH; // Retrieve IDispatch for non-leaf child. @@ -449,7 +449,7 @@ STDMETHODIMP ViewAccessibility::accLocation(LONG* x_left, LONG* y_top, gfx::Rect view_bounds; // Retrieving the parent View to be used for converting from view-to-screen // coordinates. - ChromeViews::View* parent = view_->GetParent(); + views::View* parent = view_->GetParent(); if (parent == NULL) { // If no parent, remain within the same View. @@ -475,7 +475,7 @@ STDMETHODIMP ViewAccessibility::accLocation(LONG* x_left, LONG* y_top, *height = view_bounds.height(); gfx::Point topleft(view_bounds.origin()); - ChromeViews::View::ConvertPointToScreen(parent, &topleft); + views::View::ConvertPointToScreen(parent, &topleft); *x_left = topleft.x(); *y_top = topleft.y(); } else { @@ -493,7 +493,7 @@ STDMETHODIMP ViewAccessibility::accHitTest(LONG x_left, LONG y_top, } gfx::Point pt(x_left, y_top); - ChromeViews::View::ConvertPointToView(NULL, view_, &pt); + views::View::ConvertPointToView(NULL, view_, &pt); if (!view_->HitTest(pt)) { // If containing parent is not hit, return with failure. @@ -503,11 +503,11 @@ STDMETHODIMP ViewAccessibility::accHitTest(LONG x_left, LONG y_top, int child_count = view_->GetChildViewCount(); bool child_hit = false; - ChromeViews::View* child_view = NULL; + views::View* child_view = NULL; for (int child_id = 0; child_id < child_count; ++child_id) { // Search for hit within any of the children. child_view = view_->GetChildViewAt(child_id); - ChromeViews::View::ConvertPointToView(view_, child_view, &pt); + views::View::ConvertPointToView(view_, child_view, &pt); if (child_view->HitTest(pt)) { // Store child_id (adjusted with +1 to convert to MSAA indexing). child->lVal = child_id + 1; @@ -515,7 +515,7 @@ STDMETHODIMP ViewAccessibility::accHitTest(LONG x_left, LONG y_top, break; } // Convert point back to parent view to test next child. - ChromeViews::View::ConvertPointToView(child_view, view_, &pt); + views::View::ConvertPointToView(child_view, view_, &pt); } child->vt = VT_I4; @@ -573,8 +573,7 @@ STDMETHODIMP ViewAccessibility::get_accKeyboardShortcut(VARIANT var_id, // Helper functions. -bool ViewAccessibility::IsValidChild(int child_id, - ChromeViews::View* view) const { +bool ViewAccessibility::IsValidChild(int child_id, views::View* view) const { if (((child_id) < 0) || ((child_id) >= view->GetChildViewCount())) { return false; @@ -604,7 +603,7 @@ bool ViewAccessibility::IsValidNav(int nav_dir, int start_id, int lower_bound, return true; } -void ViewAccessibility::SetState(VARIANT* state, ChromeViews::View* view) { +void ViewAccessibility::SetState(VARIANT* state, views::View* view) { // Default state; all views can have accessibility focus. state->lVal |= STATE_SYSTEM_FOCUSABLE; @@ -624,7 +623,7 @@ void ViewAccessibility::SetState(VARIANT* state, ChromeViews::View* view) { state->lVal |= STATE_SYSTEM_PRESSED; } // Check both for actual View focus, as well as accessibility focus. - ChromeViews::View* parent = view->GetParent(); + views::View* parent = view->GetParent(); if (view->HasFocus() || (parent && parent->GetAccFocusedChildView() == view)) { diff --git a/chrome/views/accessibility/view_accessibility.h b/chrome/views/accessibility/view_accessibility.h index 4c173d9..d61ab47 100644 --- a/chrome/views/accessibility/view_accessibility.h +++ b/chrome/views/accessibility/view_accessibility.h @@ -33,7 +33,7 @@ class ATL_NO_VTABLE ViewAccessibility ViewAccessibility() {} ~ViewAccessibility() {} - HRESULT Initialize(ChromeViews::View* view); + HRESULT Initialize(views::View* view); // Supported IAccessible methods. @@ -101,7 +101,7 @@ class ATL_NO_VTABLE ViewAccessibility private: // Checks to see if child_id is within the child bounds of view. Returns true // if the child is within the bounds, false otherwise. - bool IsValidChild(int child_id, ChromeViews::View* view) const; + bool IsValidChild(int child_id, views::View* view) const; // Determines navigation direction for accNavigate, based on left, up and // previous being mapped all to previous and right, down, next being mapped @@ -114,15 +114,15 @@ class ATL_NO_VTABLE ViewAccessibility int upper_bound) const; // Wrapper to retrieve the view's instance of IAccessible. - AccessibleWrapper* GetAccessibleWrapper(ChromeViews::View* view) const { + AccessibleWrapper* GetAccessibleWrapper(views::View* view) const { return view->GetAccessibleWrapper(); } // Helper function which sets applicable states of view. - void SetState(VARIANT* state, ChromeViews::View* view); + void SetState(VARIANT* state, views::View* view); // Member View needed for view-specific calls. - ChromeViews::View* view_; + views::View* view_; DISALLOW_EVIL_CONSTRUCTORS(ViewAccessibility); }; diff --git a/chrome/views/aero_tooltip_manager.cc b/chrome/views/aero_tooltip_manager.cc index 7929786..7e665a1 100644 --- a/chrome/views/aero_tooltip_manager.cc +++ b/chrome/views/aero_tooltip_manager.cc @@ -13,7 +13,7 @@ #include "base/message_loop.h" #include "chrome/common/l10n_util.h" -namespace ChromeViews { +namespace views { /////////////////////////////////////////////////////////////////////////////// // AeroTooltipManager, public: @@ -117,5 +117,5 @@ void AeroTooltipManager::InitialTimer::Execute() { manager_->OnTimer(); } -} // namespace ChromeViews +} // namespace views diff --git a/chrome/views/aero_tooltip_manager.h b/chrome/views/aero_tooltip_manager.h index 2f2f29a..28edda7 100644 --- a/chrome/views/aero_tooltip_manager.h +++ b/chrome/views/aero_tooltip_manager.h @@ -9,7 +9,7 @@ #include "base/task.h" #include "chrome/views/tooltip_manager.h" -namespace ChromeViews { +namespace views { /////////////////////////////////////////////////////////////////////////////// // AeroTooltipManager @@ -26,7 +26,7 @@ namespace ChromeViews { // TTF_TRACKed tooltips. // // TODO(glen): Resolve this with Microsoft. -class AeroTooltipManager : public ChromeViews::TooltipManager { +class AeroTooltipManager : public TooltipManager { public: AeroTooltipManager(Container* container, HWND parent); virtual ~AeroTooltipManager(); @@ -51,7 +51,7 @@ class AeroTooltipManager : public ChromeViews::TooltipManager { scoped_refptr<InitialTimer> initial_timer_; }; -} // namespace ChromeViews +} // namespace views #endif // #ifndef CHROME_VIEWS_AERO_TOOLTIP_MANAGER_H__ diff --git a/chrome/views/app_modal_dialog_delegate.h b/chrome/views/app_modal_dialog_delegate.h index 8dff4e5..b8fefb4 100644 --- a/chrome/views/app_modal_dialog_delegate.h +++ b/chrome/views/app_modal_dialog_delegate.h @@ -7,7 +7,7 @@ #include "chrome/views/dialog_delegate.h" -namespace ChromeViews { +namespace views { // Pure virtual interface for a window which is app modal. class AppModalDialogDelegate : public DialogDelegate { @@ -19,7 +19,7 @@ class AppModalDialogDelegate : public DialogDelegate { virtual void ActivateModalDialog() = 0; }; -} // namespace ChromeViews +} // namespace views #endif // #ifndef CHROME_VIEWS_APP_MODAL_DIALOG_DELEGATE_H__ diff --git a/chrome/views/background.cc b/chrome/views/background.cc index 3734a6e..72352b7 100644 --- a/chrome/views/background.cc +++ b/chrome/views/background.cc @@ -11,7 +11,7 @@ #include "chrome/views/view.h" #include "skia/include/SkPaint.h" -namespace ChromeViews { +namespace views { // SolidBackground is a trivial Background implementation that fills the // background in a solid color. @@ -34,7 +34,7 @@ class SolidBackground : public Background { DISALLOW_EVIL_CONSTRUCTORS(SolidBackground); }; -class BackgroundPainter : public ChromeViews::Background { +class BackgroundPainter : public Background { public: BackgroundPainter(bool owns_painter, Painter* painter) : owns_painter_(owns_painter), painter_(painter) { @@ -102,5 +102,5 @@ Background* Background::CreateBackgroundPainter(bool owns_painter, return new BackgroundPainter(owns_painter, painter); } -} +} // namespace views diff --git a/chrome/views/background.h b/chrome/views/background.h index 300a591..2255d50 100644 --- a/chrome/views/background.h +++ b/chrome/views/background.h @@ -12,7 +12,7 @@ class ChromeCanvas; -namespace ChromeViews { +namespace views { class Painter; class View; @@ -75,6 +75,7 @@ class Background { DISALLOW_EVIL_CONSTRUCTORS(Background); }; -} +} // namespace views + #endif // CHROME_VIEWS_BACKGROUND_H__ diff --git a/chrome/views/base_button.cc b/chrome/views/base_button.cc index 325fc4d..7fc4772 100644 --- a/chrome/views/base_button.cc +++ b/chrome/views/base_button.cc @@ -11,7 +11,7 @@ #include "chrome/common/os_exchange_data.h" #include "chrome/common/throb_animation.h" -namespace ChromeViews { +namespace views { // How long the hover animation takes if uninterrupted. static const int kHoverFadeDurationMs = 150; @@ -41,7 +41,7 @@ BaseButton::~BaseButton() { // //////////////////////////////////////////////////////////////////////////////// -bool BaseButton::IsTriggerableEvent(const ChromeViews::MouseEvent& e) { +bool BaseButton::IsTriggerableEvent(const MouseEvent& e) { return e.IsLeftMouseButton(); } @@ -142,7 +142,7 @@ void BaseButton::SetTooltipText(const std::wstring& tooltip) { // //////////////////////////////////////////////////////////////////////////////// -bool BaseButton::OnMousePressed(const ChromeViews::MouseEvent& e) { +bool BaseButton::OnMousePressed(const MouseEvent& e) { if (state_ != BS_DISABLED) { if (IsTriggerableEvent(e) && HitTest(e.location())) { SetState(BS_PUSHED); @@ -153,7 +153,7 @@ bool BaseButton::OnMousePressed(const ChromeViews::MouseEvent& e) { return true; } -bool BaseButton::OnMouseDragged(const ChromeViews::MouseEvent& e) { +bool BaseButton::OnMouseDragged(const MouseEvent& e) { if (state_ != BS_DISABLED) { if (!HitTest(e.location())) SetState(BS_NORMAL); @@ -165,8 +165,7 @@ bool BaseButton::OnMouseDragged(const ChromeViews::MouseEvent& e) { return true; } -void BaseButton::OnMouseReleased(const ChromeViews::MouseEvent& e, - bool canceled) { +void BaseButton::OnMouseReleased(const MouseEvent& e, bool canceled) { if (InDrag()) { // Starting a drag results in a MouseReleased, we need to ignore it. return; @@ -187,16 +186,12 @@ void BaseButton::OnMouseReleased(const ChromeViews::MouseEvent& e, } } -void BaseButton::OnMouseEntered(const ChromeViews::MouseEvent& e) { - using namespace ChromeViews; - if (state_ != BS_DISABLED) { +void BaseButton::OnMouseEntered(const MouseEvent& e) { + if (state_ != BS_DISABLED) SetState(BS_HOT); - } } -void BaseButton::OnMouseMoved(const ChromeViews::MouseEvent& e) { - using namespace ChromeViews; - +void BaseButton::OnMouseMoved(const MouseEvent& e) { if (state_ != BS_DISABLED) { if (HitTest(e.location())) { SetState(BS_HOT); @@ -206,12 +201,10 @@ void BaseButton::OnMouseMoved(const ChromeViews::MouseEvent& e) { } } -void BaseButton::OnMouseExited(const ChromeViews::MouseEvent& e) { - using namespace ChromeViews; +void BaseButton::OnMouseExited(const MouseEvent& e) { // Starting a drag results in a MouseExited, we need to ignore it. - if (state_ != BS_DISABLED && !InDrag()) { + if (state_ != BS_DISABLED && !InDrag()) SetState(BS_NORMAL); - } } void BaseButton::NotifyClick(int mouse_event_flags) { @@ -303,5 +296,5 @@ void BaseButton::Paint(ChromeCanvas* canvas, bool for_drag) { Paint(canvas); } -} // namespace ChromeViews +} // namespace views diff --git a/chrome/views/base_button.h b/chrome/views/base_button.h index e16bf23..d8ab7bf 100644 --- a/chrome/views/base_button.h +++ b/chrome/views/base_button.h @@ -12,7 +12,7 @@ class OSExchangeData; class ThrobAnimation; -namespace ChromeViews { +namespace views { class MouseEvent; @@ -78,13 +78,12 @@ class BaseButton : public View, // // These methods are overriden to implement a simple push button // behavior - virtual bool OnMousePressed(const ChromeViews::MouseEvent& e); - virtual bool OnMouseDragged(const ChromeViews::MouseEvent& e); - virtual void OnMouseReleased(const ChromeViews::MouseEvent& e, - bool canceled); - virtual void OnMouseMoved(const ChromeViews::MouseEvent& e); - virtual void OnMouseEntered(const ChromeViews::MouseEvent& e); - virtual void OnMouseExited(const ChromeViews::MouseEvent& e); + virtual bool OnMousePressed(const MouseEvent& e); + virtual bool OnMouseDragged(const MouseEvent& e); + virtual void OnMouseReleased(const MouseEvent& e, bool canceled); + virtual void OnMouseMoved(const MouseEvent& e); + virtual void OnMouseEntered(const MouseEvent& e); + virtual void OnMouseExited(const MouseEvent& e); virtual bool OnKeyPressed(const KeyEvent& e); virtual bool OnKeyReleased(const KeyEvent& e); @@ -134,7 +133,7 @@ class BaseButton : public View, // Returns true if the event is one that can trigger notifying the listener. // This implementation returns true if the left mouse button is down. - virtual bool IsTriggerableEvent(const ChromeViews::MouseEvent& e); + virtual bool IsTriggerableEvent(const MouseEvent& e); // // Set the state. If the state is different, causes the button @@ -179,7 +178,7 @@ class BaseButton : public View, bool animate_on_state_change_; }; -} // namespace +} // namespace views #endif // CHROME_VIEWS_BASE_BUTTON_H__ diff --git a/chrome/views/bitmap_scroll_bar.cc b/chrome/views/bitmap_scroll_bar.cc index 117397f..5297f59 100644 --- a/chrome/views/bitmap_scroll_bar.cc +++ b/chrome/views/bitmap_scroll_bar.cc @@ -17,7 +17,7 @@ #undef min #undef max -namespace ChromeViews { +namespace views { namespace { @@ -699,5 +699,5 @@ void BitmapScrollBar::SetThumbTrackState(BaseButton::ButtonState state) { SchedulePaint(); } -} +} // namespace views diff --git a/chrome/views/bitmap_scroll_bar.h b/chrome/views/bitmap_scroll_bar.h index 24a1a18..1c3f46f 100644 --- a/chrome/views/bitmap_scroll_bar.h +++ b/chrome/views/bitmap_scroll_bar.h @@ -10,7 +10,7 @@ #include "chrome/views/repeat_controller.h" #include "chrome/views/scroll_bar.h" -namespace ChromeViews { +namespace views { namespace { class BitmapScrollBarThumb; @@ -178,7 +178,7 @@ class BitmapScrollBar : public ScrollBar, DISALLOW_EVIL_CONSTRUCTORS(BitmapScrollBar); }; -} +} // namespace views #endif // #ifndef CHROME_VIEWS_BITMAP_SCROLL_BAR_H__ diff --git a/chrome/views/border.cc b/chrome/views/border.cc index 7298583..680c071 100644 --- a/chrome/views/border.cc +++ b/chrome/views/border.cc @@ -6,8 +6,7 @@ #include "base/logging.h" -namespace ChromeViews { - +namespace views { namespace { @@ -103,5 +102,5 @@ Border* Border::CreateEmptyBorder(int top, int left, int bottom, int right) { return new EmptyBorder(top, left, bottom, right); } -} // namespace +} // namespace views diff --git a/chrome/views/border.h b/chrome/views/border.h index 9e9df25..2493717 100644 --- a/chrome/views/border.h +++ b/chrome/views/border.h @@ -10,8 +10,7 @@ #include "chrome/views/view.h" #include "SkColor.h" -namespace ChromeViews { - +namespace views { class View; @@ -54,7 +53,7 @@ class Border { DISALLOW_EVIL_CONSTRUCTORS(Border); }; -} +} // namespace views #endif // CHROME_VIEWS_BORDER_H__ diff --git a/chrome/views/button.cc b/chrome/views/button.cc index 4cc1bde..1a55aaf 100644 --- a/chrome/views/button.cc +++ b/chrome/views/button.cc @@ -17,7 +17,7 @@ #include "generated_resources.h" -namespace ChromeViews { +namespace views { static const int kDefaultWidth = 16; // Default button width if no theme. static const int kDefaultHeight = 14; // Default button height if no theme. @@ -199,5 +199,6 @@ void ToggleButton::SetToggled(bool toggled) { void ToggleButton::SetToggledTooltipText(const std::wstring& tooltip) { toggled_tooltip_text_.assign(tooltip); } -} // namespace ChromeViews + +} // namespace views diff --git a/chrome/views/button.h b/chrome/views/button.h index 77e4930..814bf94 100644 --- a/chrome/views/button.h +++ b/chrome/views/button.h @@ -8,7 +8,7 @@ #include "chrome/views/base_button.h" #include "skia/include/SkBitmap.h" -namespace ChromeViews { +namespace views { class MouseEvent; @@ -128,7 +128,7 @@ class ToggleButton : public Button { DISALLOW_EVIL_CONSTRUCTORS(ToggleButton); }; -} // namespace +} // namespace views #endif // CHROME_VIEWS_BUTTON_H_ diff --git a/chrome/views/button_dropdown.cc b/chrome/views/button_dropdown.cc index 00d9cdc..eb97d8f 100644 --- a/chrome/views/button_dropdown.cc +++ b/chrome/views/button_dropdown.cc @@ -12,7 +12,7 @@ #include "generated_resources.h" -namespace ChromeViews { +namespace views { // How long to wait before showing the menu static const int kMenuTimerDelay = 500; @@ -39,7 +39,7 @@ ButtonDropDown::~ButtonDropDown() { // //////////////////////////////////////////////////////////////////////////////// -bool ButtonDropDown::OnMousePressed(const ChromeViews::MouseEvent& e) { +bool ButtonDropDown::OnMousePressed(const MouseEvent& e) { if (IsEnabled() && e.IsLeftMouseButton() && HitTest(e.location())) { // Store the y pos of the mouse coordinates so we can use them later to // determine if the user dragged the mouse down (which should pop up the @@ -56,8 +56,7 @@ bool ButtonDropDown::OnMousePressed(const ChromeViews::MouseEvent& e) { return Button::OnMousePressed(e); } -void ButtonDropDown::OnMouseReleased(const ChromeViews::MouseEvent& e, - bool canceled) { +void ButtonDropDown::OnMouseReleased(const MouseEvent& e, bool canceled) { Button::OnMouseReleased(e, canceled); if (canceled) @@ -78,7 +77,7 @@ void ButtonDropDown::OnMouseReleased(const ChromeViews::MouseEvent& e, } } -bool ButtonDropDown::OnMouseDragged(const ChromeViews::MouseEvent& e) { +bool ButtonDropDown::OnMouseDragged(const MouseEvent& e) { bool result = Button::OnMouseDragged(e); if (!show_menu_factory_.empty()) { @@ -175,5 +174,5 @@ bool ButtonDropDown::GetAccessibleState(VARIANT* state) { return true; } -} // namespace ChromeViews +} // namespace views diff --git a/chrome/views/button_dropdown.h b/chrome/views/button_dropdown.h index 066d2b9..4f8727d 100644 --- a/chrome/views/button_dropdown.h +++ b/chrome/views/button_dropdown.h @@ -11,7 +11,7 @@ class Timer; -namespace ChromeViews { +namespace views { //////////////////////////////////////////////////////////////////////////////// // @@ -43,10 +43,9 @@ class ButtonDropDown : public Button { private: // Overridden from Button - virtual bool OnMousePressed(const ChromeViews::MouseEvent& e); - virtual void OnMouseReleased(const ChromeViews::MouseEvent& e, - bool canceled); - virtual bool OnMouseDragged(const ChromeViews::MouseEvent& e); + virtual bool OnMousePressed(const MouseEvent& e); + virtual void OnMouseReleased(const MouseEvent& e, bool canceled); + virtual bool OnMouseDragged(const MouseEvent& e); // Internal function to show the dropdown menu void ShowDropDownMenu(HWND window); @@ -63,7 +62,7 @@ class ButtonDropDown : public Button { DISALLOW_EVIL_CONSTRUCTORS(ButtonDropDown); }; -} // namespace +} // namespace views #endif // CHROME_VIEWS_BUTTON_DROPDOWN_H__ diff --git a/chrome/views/checkbox.cc b/chrome/views/checkbox.cc index 192dbaf..d5714ad 100644 --- a/chrome/views/checkbox.cc +++ b/chrome/views/checkbox.cc @@ -14,7 +14,7 @@ static int kCheckBoxWidth = 13; static int kCheckBoxHeight = 13; static int kCheckBoxToLabel = 4; -namespace ChromeViews { +namespace views { // Horizontal focus padding. const int CheckBox::kFocusPaddingHorizontal = 2; @@ -27,7 +27,7 @@ CheckBox::CheckBox(const std::wstring& label) is_selected_(false) { // Note: we paint the label as a floating view SetMinSizeFromDLUs(gfx::Size(0, 0)); - label_ = new ChromeViews::Label(label); + label_ = new Label(label); label_->SetHorizontalAlignment(Label::ALIGN_LEFT); } @@ -176,5 +176,5 @@ void CheckBox::OnMouseReleased(const MouseEvent& event, OnCommand(BN_CLICKED, 0, GetNativeControlHWND()); } -} +} // namespace views diff --git a/chrome/views/checkbox.h b/chrome/views/checkbox.h index ce4f492..d72041a 100644 --- a/chrome/views/checkbox.h +++ b/chrome/views/checkbox.h @@ -8,7 +8,7 @@ #include "base/gfx/rect.h" #include "chrome/views/native_button.h" -namespace ChromeViews { +namespace views { class Label; @@ -21,7 +21,7 @@ class Label; // transparent as well as other things. The background was always drawn as solid // black. // -// The label is implemented with a ChromeViews::Label +// The label is implemented with a views::Label // //////////////////////////////////////////////////////////////////////////////// class CheckBox : public NativeButton { @@ -79,7 +79,8 @@ class CheckBox : public NativeButton { DISALLOW_EVIL_CONSTRUCTORS(CheckBox); }; -} + +} // namespace views #endif // CHROME_VIEWS_NATIVE_CHECKBOX_H__ diff --git a/chrome/views/chrome_menu.cc b/chrome/views/chrome_menu.cc index 1b8cb4d..393afe0 100644 --- a/chrome/views/chrome_menu.cc +++ b/chrome/views/chrome_menu.cc @@ -111,7 +111,7 @@ static bool show_mnemonics; using gfx::NativeTheme; -namespace ChromeViews { +namespace views { // Calculates all sizes that we can from the OS. // @@ -1722,8 +1722,8 @@ void MenuController::OnMouseDragged(SubmenuView* source, return; if (possible_drag_) { - if (ChromeViews::View::ExceededDragThreshold(event.x() - press_x_, - event.y() - press_y_)) { + if (View::ExceededDragThreshold(event.x() - press_x_, + event.y() - press_y_)) { MenuItemView* item = state_.item; DCHECK(item); // Points are in the coordinates of the submenu, need to map to that of @@ -2719,5 +2719,5 @@ void MenuController::StopScrolling() { scroll_task_.reset(NULL); } -} // namespace ChromeViews +} // namespace views diff --git a/chrome/views/chrome_menu.h b/chrome/views/chrome_menu.h index 9cd59bf..9051999 100644 --- a/chrome/views/chrome_menu.h +++ b/chrome/views/chrome_menu.h @@ -17,7 +17,7 @@ #include "chrome/views/view.h" #include "skia/include/SkBitmap.h" -namespace ChromeViews { +namespace views { class ContainerWin; class MenuController; @@ -95,7 +95,7 @@ class MenuDelegate : Controller { } // Executes the specified command. mouse_event_flags give the flags of the - // mouse event that triggered this to be invoked (ChromeViews::MouseEvent + // mouse event that triggered this to be invoked (views::MouseEvent // flags). mouse_event_flags is 0 if this is triggered by a user gesture // other than a mouse event. virtual void ExecuteCommand(int id, int mouse_event_flags) { @@ -939,7 +939,7 @@ class MenuController : public MessageLoopForUI::Dispatcher { DISALLOW_EVIL_CONSTRUCTORS(MenuController); }; -} // namespace +} // namespace views #endif // CHROME_VIEWS_CHROME_MENU_H__ diff --git a/chrome/views/client_view.cc b/chrome/views/client_view.cc index 8e7971c..dd9ef5b 100644 --- a/chrome/views/client_view.cc +++ b/chrome/views/client_view.cc @@ -5,7 +5,7 @@ #include "base/logging.h" #include "chrome/views/client_view.h" -namespace ChromeViews { +namespace views { /////////////////////////////////////////////////////////////////////////////// // ClientView, public: @@ -45,4 +45,4 @@ void ClientView::Layout() { contents_view_->SetBounds(0, 0, width(), height()); } -}; // namespace ChromeViews +} // namespace views diff --git a/chrome/views/client_view.h b/chrome/views/client_view.h index 0d1bcd0..692e0ba 100644 --- a/chrome/views/client_view.h +++ b/chrome/views/client_view.h @@ -7,7 +7,7 @@ #include "chrome/views/view.h" -namespace ChromeViews { +namespace views { class DialogClientView; class Window; @@ -73,6 +73,6 @@ class ClientView : public View { View* contents_view_; }; -} // namespace ChromeViews +} // namespace views #endif // #ifndef CHROME_VIEWS_CLIENT_VIEW_H_ diff --git a/chrome/views/combo_box.cc b/chrome/views/combo_box.cc index 2336ff3..8315ced 100644 --- a/chrome/views/combo_box.cc +++ b/chrome/views/combo_box.cc @@ -18,7 +18,8 @@ static const int kMinComboboxWidth = 148; // dropdowns so that text isn't too crowded. static const int kComboboxExtraPaddingX = 6; -namespace ChromeViews { +namespace views { + ComboBox::ComboBox(Model* model) : model_(model), selected_item_(0), listener_(NULL), content_width_(0) { } @@ -159,5 +160,6 @@ void ComboBox::SetSelectedItem(int index) { int ComboBox::GetSelectedItem() { return selected_item_; } -} + +} // namespace views diff --git a/chrome/views/combo_box.h b/chrome/views/combo_box.h index e4dbccb..c4ec53b 100644 --- a/chrome/views/combo_box.h +++ b/chrome/views/combo_box.h @@ -7,7 +7,7 @@ #include "chrome/views/native_control.h" -namespace ChromeViews { +namespace views { //////////////////////////////////////////////////////////////////////////////// // // ComboBox is a basic non editable combo box. It is initialized from a simple @@ -73,7 +73,8 @@ class ComboBox : public NativeControl { DISALLOW_EVIL_CONSTRUCTORS(ComboBox); }; -} + +} // namespace views #endif // CHROME_VIEWS_COMBO_BOX_H__ diff --git a/chrome/views/container.h b/chrome/views/container.h index b4d6e29..e10b409 100644 --- a/chrome/views/container.h +++ b/chrome/views/container.h @@ -14,7 +14,7 @@ class CRect; } using WTL::CRect; -namespace ChromeViews { +namespace views { class RootView; class TooltipManager; @@ -79,7 +79,7 @@ class Container { Accelerator* accelerator) = 0; }; -} // namespace ChromeViews +} // namespace views #endif // CHROME_VIEWS_VIEW_CONTAINER_H_ diff --git a/chrome/views/container_win.cc b/chrome/views/container_win.cc index eecc228..7c0239d 100644 --- a/chrome/views/container_win.cc +++ b/chrome/views/container_win.cc @@ -15,7 +15,7 @@ #include "chrome/views/hwnd_notification_source.h" #include "chrome/views/root_view.h" -namespace ChromeViews { +namespace views { static const DWORD kWindowDefaultChildStyle = WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS; @@ -168,7 +168,7 @@ void ContainerWin::Init(HWND parent, const gfx::Rect& bounds, root_view_->OnContainerCreated(); if (has_own_focus_manager) { - ChromeViews::FocusManager::CreateFocusManager(hwnd_, GetRootView()); + FocusManager::CreateFocusManager(hwnd_, GetRootView()); } else { // Subclass the window so we get the tab key messages when a view with no // associated native window is focused. @@ -217,7 +217,7 @@ void ContainerWin::SetContentsView(View* view) { } /////////////////////////////////////////////////////////////////////////////// -// ChromeViews::Container implementation: +// Container implementation: void ContainerWin::GetBounds(CRect *out, bool including_frame) const { if (including_frame) { @@ -912,5 +912,5 @@ LRESULT CALLBACK ContainerWin::WndProc(HWND window, UINT message, return result; } -} // namespace ChromeViews +} // namespace views diff --git a/chrome/views/container_win.h b/chrome/views/container_win.h index 0a8861a..5df6529 100644 --- a/chrome/views/container_win.h +++ b/chrome/views/container_win.h @@ -19,7 +19,7 @@ namespace gfx { class Rect; } -namespace ChromeViews { +namespace views { class RootView; class TooltipManager; @@ -69,18 +69,18 @@ class FillLayout : public LayoutManager { /////////////////////////////////////////////////////////////////////////////// // // ContainerWin -// A container for a ChromeViews hierarchy used to represent anything that can -// be contained within an HWND, e.g. a control, a window, etc. Specializations +// A container for a views hierarchy used to represent anything that can be +// contained within an HWND, e.g. a control, a window, etc. Specializations // suitable for specific tasks, e.g. top level window, are derived from this. // -// This Container contains a RootView which owns the hierarchy of ChromeViews -// within it. As long as ChromeViews are part of this tree, they will be -// deleted automatically when the RootView is destroyed. If you remove a view -// from the tree, you are then responsible for cleaning up after it. +// This Container contains a RootView which owns the hierarchy of views +// within it. As long as views are part of this tree, they will be deleted +// automatically when the RootView is destroyed. If you remove a view from the +// tree, you are then responsible for cleaning up after it. // // Note: We try and keep this API platform-neutral, since to some extent we // consider this the boundary between the platform and potentially cross -// platform ChromeViews code. In some cases this isn't true, primarily +// platform views code. In some cases this isn't true, primarily // because of other code that has not yet been refactored to maintain // this <controller>-<view>-<platform-specific-view> separation. // @@ -269,8 +269,7 @@ class ContainerWin : public Container, void SetFocusTraversableParent(FocusTraversable* parent); void SetFocusTraversableParentView(View* parent_view); - virtual bool GetAccelerator(int cmd_id, - ChromeViews::Accelerator* accelerator) { + virtual bool GetAccelerator(int cmd_id, Accelerator* accelerator) { return false; } @@ -580,7 +579,7 @@ class ContainerWin : public Container, HWND hwnd_; }; -} // namespace ChromeViews +} // namespace views #endif // #ifndef CHROME_VIEWS_CONTAINER_WIN_H_ diff --git a/chrome/views/custom_frame_window.cc b/chrome/views/custom_frame_window.cc index ef5e3b7..f45731f 100644 --- a/chrome/views/custom_frame_window.cc +++ b/chrome/views/custom_frame_window.cc @@ -23,7 +23,7 @@ #include "chrome/views/window_resources.h" #include "generated_resources.h" -namespace ChromeViews { +namespace views { // A scoping class that removes the WS_VISIBLE style of a window. // @@ -795,7 +795,7 @@ void DefaultNonClientView::LayoutTitleBar() { title_font_.height()); // We draw the custom frame window's title directly rather than using a - // ChromeViews::Label child view. Therefore, we have to mirror the title + // views::Label child view. Therefore, we have to mirror the title // position manually if the View's UI layout is right-to-left. Child Views // are automatically mirrored, which means that the parent view doesn't // need to manually modify their position depending on the View's UI @@ -837,7 +837,7 @@ void DefaultNonClientView::InitClass() { /////////////////////////////////////////////////////////////////////////////// // NonClientViewLayout -class NonClientViewLayout : public ChromeViews::LayoutManager { +class NonClientViewLayout : public LayoutManager { public: // The size of the default window border and padding used by Windows Vista // with DWM disabled when clipping the window for maximized display. @@ -845,15 +845,14 @@ class NonClientViewLayout : public ChromeViews::LayoutManager { // with adjustments to the Windows Border/Padding setting. static const int kBorderAndPadding = 8; - NonClientViewLayout(ChromeViews::View* child, - ChromeViews::Window* window) + NonClientViewLayout(View* child, Window* window) : child_(child), window_(window) { } virtual ~NonClientViewLayout() {} - // Overridden from ChromeViews::LayoutManager: - virtual void Layout(ChromeViews::View* host) { + // Overridden from LayoutManager: + virtual void Layout(View* host) { int horizontal_border_width = window_->IsMaximized() ? kBorderAndPadding : 0; int vertical_border_height = @@ -863,13 +862,13 @@ class NonClientViewLayout : public ChromeViews::LayoutManager { host->width() - (2 * horizontal_border_width), host->height() - (2 * vertical_border_height)); } - virtual gfx::Size GetPreferredSize(ChromeViews::View* host) { + virtual gfx::Size GetPreferredSize(View* host) { return child_->GetPreferredSize(); } private: - ChromeViews::View* child_; - ChromeViews::Window* window_; + View* child_; + Window* window_; DISALLOW_COPY_AND_ASSIGN(NonClientViewLayout); }; @@ -1319,5 +1318,5 @@ void CustomFrameWindow::ResetWindowRegion() { DeleteObject(current_rgn); } -} // namespace ChromeViews +} // namespace views diff --git a/chrome/views/custom_frame_window.h b/chrome/views/custom_frame_window.h index fbaff21..3f3b3b1 100644 --- a/chrome/views/custom_frame_window.h +++ b/chrome/views/custom_frame_window.h @@ -9,7 +9,7 @@ #include "chrome/views/window.h" #include "chrome/views/window_delegate.h" -namespace ChromeViews { +namespace views { class NonClientView; @@ -80,7 +80,7 @@ class CustomFrameWindow : public Window { DISALLOW_EVIL_CONSTRUCTORS(CustomFrameWindow); }; -} +} // namespace views #endif // CHROME_VIEWS_CUSTOM_FRAME_WINDOW_H__ diff --git a/chrome/views/decision.cc b/chrome/views/decision.cc index 39eb9fb..a2b430c 100644 --- a/chrome/views/decision.cc +++ b/chrome/views/decision.cc @@ -12,7 +12,7 @@ using namespace std; -namespace ChromeViews { +namespace views { static const int kPaddingEdge = 10; static const int kSpacingInfoBottom = 20; @@ -26,7 +26,7 @@ class Option : public View, Controller* controller); // NativeButton::Listener methods: - virtual void ButtonPressed(ChromeViews::NativeButton* sender); + virtual void ButtonPressed(NativeButton* sender); private: int command_id_; @@ -145,9 +145,9 @@ Option::Option(int command_id, layout->AddView(button); } -void Option::ButtonPressed(ChromeViews::NativeButton* sender) { +void Option::ButtonPressed(NativeButton* sender) { controller_->ExecuteCommand(command_id_); } -} // namespace ChromeViews +} // namespace views diff --git a/chrome/views/decision.h b/chrome/views/decision.h index 40eda44..437b4a5 100644 --- a/chrome/views/decision.h +++ b/chrome/views/decision.h @@ -11,7 +11,7 @@ #include "chrome/views/native_button.h" #include "chrome/views/view.h" -namespace ChromeViews { +namespace views { class Label; class Option; @@ -56,7 +56,7 @@ class Decision : public View { std::vector<Option*> options_; }; -} // namespace ChromeViews +} // namespace views #endif // CHROME_VIEWS_DECISION_H__ diff --git a/chrome/views/dialog_client_view.cc b/chrome/views/dialog_client_view.cc index f46608c..78cbeca 100644 --- a/chrome/views/dialog_client_view.cc +++ b/chrome/views/dialog_client_view.cc @@ -19,14 +19,14 @@ #include "chrome/views/window.h" #include "generated_resources.h" -namespace ChromeViews { +namespace views { namespace { // Updates any of the standard buttons according to the delegate. -void UpdateButtonHelper(ChromeViews::NativeButton* button_view, - ChromeViews::DialogDelegate* delegate, - ChromeViews::DialogDelegate::DialogButton button) { +void UpdateButtonHelper(NativeButton* button_view, + DialogDelegate* delegate, + DialogDelegate::DialogButton button) { std::wstring label = delegate->GetDialogButtonLabel(button); if (!label.empty()) button_view->SetLabel(label); @@ -136,7 +136,7 @@ void DialogClientView::ShowDialogButtons() { AddChildView(cancel_button_); } - ChromeViews::View* extra_view = dd->GetExtraView(); + View* extra_view = dd->GetExtraView(); if (extra_view && !extra_view_) { extra_view_ = extra_view; extra_view_->SetGroup(kButtonGroup); @@ -372,5 +372,5 @@ void DialogClientView::InitClass() { } } -} +} // namespace views diff --git a/chrome/views/dialog_client_view.h b/chrome/views/dialog_client_view.h index cae6344..b3b4025 100644 --- a/chrome/views/dialog_client_view.h +++ b/chrome/views/dialog_client_view.h @@ -9,7 +9,7 @@ #include "chrome/views/client_view.h" #include "chrome/views/native_button.h" -namespace ChromeViews { +namespace views { class DialogDelegate; class Window; @@ -102,7 +102,7 @@ class DialogClientView : public ClientView, DISALLOW_EVIL_CONSTRUCTORS(DialogClientView); }; -} +} // namespace views #endif // #ifndef CHROME_VIEWS_DIALOG_CLIENT_VIEW_H_ diff --git a/chrome/views/dialog_delegate.cc b/chrome/views/dialog_delegate.cc index 330ebea..6a3ac212 100644 --- a/chrome/views/dialog_delegate.cc +++ b/chrome/views/dialog_delegate.cc @@ -6,7 +6,7 @@ #include "chrome/views/window.h" -namespace ChromeViews { +namespace views { // Overridden from WindowDelegate: View* DialogDelegate::GetInitiallyFocusedView() const { @@ -30,5 +30,5 @@ DialogClientView* DialogDelegate::GetDialogClientView() const { return dialog_client_view; } -} // namespace ChromeViews +} // namespace views diff --git a/chrome/views/dialog_delegate.h b/chrome/views/dialog_delegate.h index c7ee5c0..99b22ec 100644 --- a/chrome/views/dialog_delegate.h +++ b/chrome/views/dialog_delegate.h @@ -8,7 +8,7 @@ #include "chrome/views/dialog_client_view.h" #include "chrome/views/window_delegate.h" -namespace ChromeViews { +namespace views { class NativeButton; class View; @@ -59,7 +59,7 @@ class DialogDelegate : public WindowDelegate { // Override this function if with a view which will be shown in the same // row as the OK and CANCEL buttons but flush to the left and extending // up to the buttons. - virtual ChromeViews::View* GetExtraView() { return NULL; } + virtual View* GetExtraView() { return NULL; } // Returns the default dialog button. This should not be a mask as only one // button should ever be the default button. Return DIALOGBUTTON_NONE if @@ -107,7 +107,7 @@ class DialogDelegate : public WindowDelegate { DialogClientView* GetDialogClientView() const; }; -} // namespace ChromeViews +} // namespace views #endif // #ifndef CHROME_VIEWS_DIALOG_DELEGATE_H_ diff --git a/chrome/views/event.cc b/chrome/views/event.cc index 284550a..03bde10 100644 --- a/chrome/views/event.cc +++ b/chrome/views/event.cc @@ -7,7 +7,7 @@ #include "chrome/views/view.h" #include "webkit/glue/webinputevent.h" -namespace ChromeViews { +namespace views { Event::Event(EventType type, int flags) : type_(type), @@ -94,5 +94,5 @@ bool KeyEvent::IsExtendedKey() const { return (message_flags_ & KF_EXTENDED) == KF_EXTENDED; } -} // namespace ChromeViews +} // namespace views diff --git a/chrome/views/event.h b/chrome/views/event.h index 17cbe60..91e8d36 100644 --- a/chrome/views/event.h +++ b/chrome/views/event.h @@ -11,7 +11,7 @@ class OSExchangeData; -namespace ChromeViews { +namespace views { class View; @@ -83,10 +83,10 @@ class Event { // Returns the EventFlags in terms of windows flags. int GetWindowsFlags() const; - // Convert windows flags to ChromeViews::Event flags + // Convert windows flags to views::Event flags static int ConvertWindowsFlags(uint32 win_flags); - // Convert WebInputEvent::Modifiers flags to ChromeViews::Event flags. + // Convert WebInputEvent::Modifiers flags to views::Event flags. // Note that this only deals with keyboard modifiers. static int ConvertWebInputEventFlags(int web_input_event_flags); @@ -304,7 +304,7 @@ class DropTargetEvent : public LocatedEvent { DISALLOW_EVIL_CONSTRUCTORS(DropTargetEvent); }; -} // namespace ChromeViews +} // namespace views #endif // CHROME_VIEWS_EVENT_H__ diff --git a/chrome/views/external_focus_tracker.cc b/chrome/views/external_focus_tracker.cc index dfd3b55..19a5e7e 100644 --- a/chrome/views/external_focus_tracker.cc +++ b/chrome/views/external_focus_tracker.cc @@ -7,13 +7,13 @@ #include "chrome/views/view.h" #include "chrome/views/view_storage.h" -namespace ChromeViews { +namespace views { -ExternalFocusTracker::ExternalFocusTracker( - ChromeViews::View* parent_view, ChromeViews::FocusManager* focus_manager) +ExternalFocusTracker::ExternalFocusTracker(View* parent_view, + FocusManager* focus_manager) : focus_manager_(focus_manager), parent_view_(parent_view) { - view_storage_ = ChromeViews::ViewStorage::GetSharedInstance(); + view_storage_ = ViewStorage::GetSharedInstance(); last_focused_view_storage_id_ = view_storage_->CreateStorageID(); // Store the view which is focused when we're created. StartTracking(); @@ -41,8 +41,7 @@ void ExternalFocusTracker::FocusLastFocusedExternalView() { last_focused_view->RequestFocus(); } -void ExternalFocusTracker::SetFocusManager( - ChromeViews::FocusManager* focus_manager) { +void ExternalFocusTracker::SetFocusManager(FocusManager* focus_manager) { if (focus_manager_) focus_manager_->RemoveFocusChangeListener(this); focus_manager_ = focus_manager; @@ -63,5 +62,5 @@ void ExternalFocusTracker::StartTracking() { focus_manager_->AddFocusChangeListener(this); } -} // namespace +} // namespace views diff --git a/chrome/views/external_focus_tracker.h b/chrome/views/external_focus_tracker.h index 41ac3c3..8b4dc1e 100644 --- a/chrome/views/external_focus_tracker.h +++ b/chrome/views/external_focus_tracker.h @@ -7,7 +7,7 @@ #include "chrome/views/focus_manager.h" -namespace ChromeViews { +namespace views { class View; class ViewStorage; @@ -43,7 +43,7 @@ class ExternalFocusTracker : public FocusChangeListener { // manager went away, but you might later want to start tracking with a new // manager later, or call FocusLastFocusedExternalView to focus the previous // view. - void SetFocusManager(ChromeViews::FocusManager* focus_manager); + void SetFocusManager(FocusManager* focus_manager); private: // Store the provided view. This view will be focused when @@ -71,6 +71,7 @@ class ExternalFocusTracker : public FocusChangeListener { DISALLOW_EVIL_CONSTRUCTORS(ExternalFocusTracker); }; -} // namespace +} // namespace views + #endif // CHROME_BROWSER_VIEWS_EXTERNAL_FOCUS_TRACKER_H__ diff --git a/chrome/views/focus_manager.cc b/chrome/views/focus_manager.cc index 397a4a8..084fab5 100644 --- a/chrome/views/focus_manager.cc +++ b/chrome/views/focus_manager.cc @@ -30,7 +30,7 @@ static const wchar_t* const kFocusManagerKey = L"__VIEW_CONTAINER__"; // - prevent tab key events from being sent to views. static const wchar_t* const kViewKey = L"__CHROME_VIEW__"; -namespace ChromeViews { +namespace views { static bool IsCompatibleWithMouseWheelRedirection(HWND window) { std::wstring class_name = win_util::GetClassName(window); @@ -367,8 +367,8 @@ bool FocusManager::OnKeyDown(HWND window, UINT message, WPARAM wparam, int repeat_count = LOWORD(lparam); int flags = HIWORD(lparam); if (focused_view_ && - !focused_view_->ShouldLookupAccelerators(ChromeViews::KeyEvent( - ChromeViews::Event::ET_KEY_PRESSED, virtual_key_code, + !focused_view_->ShouldLookupAccelerators(KeyEvent( + Event::ET_KEY_PRESSED, virtual_key_code, repeat_count, flags))) { // This should not be processed as an accelerator. return true; @@ -736,8 +736,7 @@ void FocusManager::Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { DCHECK(type == NOTIFY_VIEW_REMOVED); - if (focused_view_ && - Source<ChromeViews::View>(focused_view_) == source) + if (focused_view_ && Source<View>(focused_view_) == source) focused_view_ = NULL; } @@ -777,5 +776,5 @@ void FocusManager::RemoveFocusChangeListener(FocusChangeListener* listener) { focus_change_listeners_.erase(place); } -} +} // namespace views diff --git a/chrome/views/focus_manager.h b/chrome/views/focus_manager.h index e12457f..767edf7 100644 --- a/chrome/views/focus_manager.h +++ b/chrome/views/focus_manager.h @@ -18,7 +18,7 @@ // // There are 2 types of focus: // - the native focus, which is the focus that an HWND has. -// - the view focus, which is the focus that a ChromeViews::View has. +// - the view focus, which is the focus that a views::View has. // // Each native view must register with their Focus Manager so the focus manager // gets notified when they are focused (and keeps track of the native focus) and @@ -72,7 +72,7 @@ // Note that FocusTraversable do not have to be RootViews: TabContents is // FocusTraversable. -namespace ChromeViews { +namespace views { class View; class RootView; @@ -325,7 +325,7 @@ class FocusManager : public NotificationObserver { DISALLOW_EVIL_CONSTRUCTORS(FocusManager); }; -} +} // namespace views #endif // CHROME_VIEWS_FOCUS_MANAGER_H__ diff --git a/chrome/views/focus_manager_unittest.cc b/chrome/views/focus_manager_unittest.cc index 3eba191..ed6b29b 100644 --- a/chrome/views/focus_manager_unittest.cc +++ b/chrome/views/focus_manager_unittest.cc @@ -96,7 +96,7 @@ class FocusManagerTest; // Taken from keyword_editor_view.cc. // It is interesting in our test as it is a native control containing another // RootView. -class BorderView : public ChromeViews::NativeControl { +class BorderView : public views::NativeControl { public: explicit BorderView(View* child) : child_(child) { DCHECK(child); @@ -114,7 +114,7 @@ class BorderView : public ChromeViews::NativeControl { 0, 0, width(), height(), parent_container, NULL, NULL, NULL); // Create the view container which is a child of the TabControl. - view_container_ = new ChromeViews::ContainerWin(); + view_container_ = new views::ContainerWin(); view_container_->Init(tab_control, gfx::Rect(), false); view_container_->SetContentsView(child_); view_container_->SetFocusTraversableParentView(this); @@ -131,11 +131,11 @@ class BorderView : public ChromeViews::NativeControl { ResizeContents(GetNativeControlHWND()); } - virtual ChromeViews::RootView* GetContentsRootView() { + virtual views::RootView* GetContentsRootView() { return view_container_->GetRootView(); } - virtual ChromeViews::FocusTraversable* GetFocusTraversable() { + virtual views::FocusTraversable* GetFocusTraversable() { return view_container_; } @@ -162,19 +162,19 @@ private: } View* child_; - ChromeViews::ContainerWin* view_container_; + views::ContainerWin* view_container_; DISALLOW_EVIL_CONSTRUCTORS(BorderView); }; -class TestViewWindow : public ChromeViews::ContainerWin { +class TestViewWindow : public views::ContainerWin { public: explicit TestViewWindow(FocusManagerTest* test); ~TestViewWindow() { } void Init(); - ChromeViews::View* contents() const { return contents_; } + views::View* contents() const { return contents_; } // Return the ID of the component that currently has the focus. @@ -183,22 +183,22 @@ class TestViewWindow : public ChromeViews::ContainerWin { // Simulate pressing the tab button in the window. void PressTab(bool shift_pressed, bool ctrl_pressed); - ChromeViews::RootView* GetContentsRootView() const { + views::RootView* GetContentsRootView() const { return contents_->GetRootView(); } - ChromeViews::RootView* GetStyleRootView() const { + views::RootView* GetStyleRootView() const { return style_tab_->GetContentsRootView(); } - ChromeViews::RootView* GetSearchRootView() const { + views::RootView* GetSearchRootView() const { return search_border_view_->GetContentsRootView(); } private: - ChromeViews::View* contents_; + views::View* contents_; - ChromeViews::TabbedPane* style_tab_; + views::TabbedPane* style_tab_; BorderView* search_border_view_; FocusManagerTest* test_; @@ -235,25 +235,25 @@ TestViewWindow::TestViewWindow(FocusManagerTest* test) // Initializes and shows the window with the contents view. void TestViewWindow::Init() { gfx::Rect bounds(0, 0, 600, 460); - contents_ = new ChromeViews::View(); + contents_ = new views::View(); contents_->SetBackground( - ChromeViews::Background::CreateSolidBackground(255, 255, 255)); + views::Background::CreateSolidBackground(255, 255, 255)); ContainerWin::Init(NULL, bounds, true); SetContentsView(contents_); - ChromeViews::CheckBox* cb = - new ChromeViews::CheckBox(L"This is a checkbox"); + views::CheckBox* cb = + new views::CheckBox(L"This is a checkbox"); contents_->AddChildView(cb); // In this fast paced world, who really has time for non hard-coded layout? cb->SetBounds(10, 10, 200, 20); cb->SetID(kTopCheckBoxID); - ChromeViews::View* left_container = new ChromeViews::View(); + views::View* left_container = new views::View(); left_container->SetBorder( - ChromeViews::Border::CreateSolidBorder(1, SK_ColorBLACK)); + views::Border::CreateSolidBorder(1, SK_ColorBLACK)); left_container->SetBackground( - ChromeViews::Background::CreateSolidBackground(240, 240, 240)); + views::Background::CreateSolidBackground(240, 240, 240)); left_container->SetID(kLeftContainerID); contents_->AddChildView(left_container); left_container->SetBounds(10, 35, 250, 200); @@ -265,12 +265,12 @@ void TestViewWindow::Init() { int y = 10; int gap_between_labels = 10; - ChromeViews::Label* label = new ChromeViews::Label(L"Apple:"); + views::Label* label = new views::Label(L"Apple:"); label->SetID(kAppleLabelID); left_container->AddChildView(label); label->SetBounds(label_x, y, label_width, label_height); - ChromeViews::TextField* text_field = new ChromeViews::TextField(); + views::TextField* text_field = new views::TextField(); text_field->SetID(kAppleTextFieldID); left_container->AddChildView(text_field); text_field->SetBounds(label_x + label_width + 5, y, @@ -278,12 +278,12 @@ void TestViewWindow::Init() { y += label_height + gap_between_labels; - label = new ChromeViews::Label(L"Orange:"); + label = new views::Label(L"Orange:"); label->SetID(kOrangeLabelID); left_container->AddChildView(label); label->SetBounds(label_x, y, label_width, label_height); - text_field = new ChromeViews::TextField(); + text_field = new views::TextField(); text_field->SetID(kOrangeTextFieldID); left_container->AddChildView(text_field); text_field->SetBounds(label_x + label_width + 5, y, @@ -291,12 +291,12 @@ void TestViewWindow::Init() { y += label_height + gap_between_labels; - label = new ChromeViews::Label(L"Banana:"); + label = new views::Label(L"Banana:"); label->SetID(kBananaLabelID); left_container->AddChildView(label); label->SetBounds(label_x, y, label_width, label_height); - text_field = new ChromeViews::TextField(); + text_field = new views::TextField(); text_field->SetID(kBananaTextFieldID); left_container->AddChildView(text_field); text_field->SetBounds(label_x + label_width + 5, y, @@ -304,12 +304,12 @@ void TestViewWindow::Init() { y += label_height + gap_between_labels; - label = new ChromeViews::Label(L"Kiwi:"); + label = new views::Label(L"Kiwi:"); label->SetID(kKiwiLabelID); left_container->AddChildView(label); label->SetBounds(label_x, y, label_width, label_height); - text_field = new ChromeViews::TextField(); + text_field = new views::TextField(); text_field->SetID(kKiwiTextFieldID); left_container->AddChildView(text_field); text_field->SetBounds(label_x + label_width + 5, y, @@ -317,23 +317,23 @@ void TestViewWindow::Init() { y += label_height + gap_between_labels; - ChromeViews::NativeButton* button = - new ChromeViews::NativeButton(L"Click me"); + views::NativeButton* button = + new views::NativeButton(L"Click me"); button->SetBounds(label_x, y + 10, 50, 20); button->SetID(kFruitButtonID); left_container->AddChildView(button); y += 40; - cb = new ChromeViews::CheckBox(L"This is another check box"); + cb = new views::CheckBox(L"This is another check box"); cb->SetBounds(label_x + label_width + 5, y, 100, 20); cb->SetID(kFruitCheckBoxID); left_container->AddChildView(cb); - ChromeViews::View* right_container = new ChromeViews::View(); + views::View* right_container = new views::View(); right_container->SetBorder( - ChromeViews::Border::CreateSolidBorder(1, SK_ColorBLACK)); + views::Border::CreateSolidBorder(1, SK_ColorBLACK)); right_container->SetBackground( - ChromeViews::Background::CreateSolidBackground(240, 240, 240)); + views::Background::CreateSolidBackground(240, 240, 240)); right_container->SetID(kRightContainerID); contents_->AddChildView(right_container); right_container->SetBounds(270, 35, 300, 200); @@ -341,44 +341,44 @@ void TestViewWindow::Init() { y = 10; int radio_button_height = 15; int gap_between_radio_buttons = 10; - ChromeViews::View* radio_button = - new ChromeViews::RadioButton(L"Asparagus", 1); + views::View* radio_button = + new views::RadioButton(L"Asparagus", 1); radio_button->SetID(kAsparagusButtonID); right_container->AddChildView(radio_button); radio_button->SetBounds(5, y, 70, radio_button_height); radio_button->SetGroup(1); y += radio_button_height + gap_between_radio_buttons; - radio_button = new ChromeViews::RadioButton(L"Broccoli", 1); + radio_button = new views::RadioButton(L"Broccoli", 1); radio_button->SetID(kBroccoliButtonID); right_container->AddChildView(radio_button); radio_button->SetBounds(5, y, 70, radio_button_height); radio_button->SetGroup(1); y += radio_button_height + gap_between_radio_buttons; - radio_button = new ChromeViews::RadioButton(L"Cauliflower", 1); + radio_button = new views::RadioButton(L"Cauliflower", 1); radio_button->SetID(kCauliflowerButtonID); right_container->AddChildView(radio_button); radio_button->SetBounds(5, y, 70, radio_button_height); radio_button->SetGroup(1); y += radio_button_height + gap_between_radio_buttons; - ChromeViews::View* inner_container = new ChromeViews::View(); + views::View* inner_container = new views::View(); inner_container->SetBorder( - ChromeViews::Border::CreateSolidBorder(1, SK_ColorBLACK)); + views::Border::CreateSolidBorder(1, SK_ColorBLACK)); inner_container->SetBackground( - ChromeViews::Background::CreateSolidBackground(230, 230, 230)); + views::Background::CreateSolidBackground(230, 230, 230)); inner_container->SetID(kInnerContainerID); right_container->AddChildView(inner_container); inner_container->SetBounds(100, 10, 150, 180); - ChromeViews::ScrollView* scroll_view = new ChromeViews::ScrollView(); + views::ScrollView* scroll_view = new views::ScrollView(); scroll_view->SetID(kScrollViewID); inner_container->AddChildView(scroll_view); scroll_view->SetBounds(1, 1, 148, 178); - ChromeViews::View* scroll_content = new ChromeViews::View(); + views::View* scroll_content = new views::View(); scroll_content->SetBounds(0, 0, 200, 200); scroll_content->SetBackground( - ChromeViews::Background::CreateSolidBackground(200, 200, 200)); + views::Background::CreateSolidBackground(200, 200, 200)); scroll_view->SetContents(scroll_content); static const wchar_t* const kTitles[] = { @@ -399,8 +399,8 @@ void TestViewWindow::Init() { y = 5; for (int i = 0; i < arraysize(kTitles); ++i) { - ChromeViews::Link* link = new ChromeViews::Link(kTitles[i]); - link->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + views::Link* link = new views::Link(kTitles[i]); + link->SetHorizontalAlignment(views::Label::ALIGN_LEFT); link->SetID(kIDs[i]); scroll_content->AddChildView(link); link->SetBounds(5, y, 300, 15); @@ -409,18 +409,18 @@ void TestViewWindow::Init() { y = 250; int width = 50; - button = new ChromeViews::NativeButton(L"OK"); + button = new views::NativeButton(L"OK"); button->SetID(kOKButtonID); contents_->AddChildView(button); button->SetBounds(150, y, width, 20); - button = new ChromeViews::NativeButton(L"Cancel"); + button = new views::NativeButton(L"Cancel"); button->SetID(kCancelButtonID); contents_->AddChildView(button); button->SetBounds(250, y, width, 20); - button = new ChromeViews::NativeButton(L"Help"); + button = new views::NativeButton(L"Help"); button->SetID(kHelpButtonID); contents_->AddChildView(button); button->SetBounds(350, y, width, 20); @@ -428,47 +428,47 @@ void TestViewWindow::Init() { y += 40; // Left bottom box with style checkboxes. - ChromeViews::View* contents = new ChromeViews::View(); + views::View* contents = new views::View(); contents->SetBackground( - ChromeViews::Background::CreateSolidBackground(SK_ColorWHITE)); - cb = new ChromeViews::CheckBox(L"Bold"); + views::Background::CreateSolidBackground(SK_ColorWHITE)); + cb = new views::CheckBox(L"Bold"); contents->AddChildView(cb); cb->SetBounds(10, 10, 50, 20); cb->SetID(kBoldCheckBoxID); - cb = new ChromeViews::CheckBox(L"Italic"); + cb = new views::CheckBox(L"Italic"); contents->AddChildView(cb); cb->SetBounds(70, 10, 50, 20); cb->SetID(kItalicCheckBoxID); - cb = new ChromeViews::CheckBox(L"Underlined"); + cb = new views::CheckBox(L"Underlined"); contents->AddChildView(cb); cb->SetBounds(130, 10, 70, 20); cb->SetID(kUnderlinedCheckBoxID); - style_tab_ = new ChromeViews::TabbedPane(); + style_tab_ = new views::TabbedPane(); style_tab_->SetID(kStyleContainerID); contents_->AddChildView(style_tab_); style_tab_->SetBounds(10, y, 210, 50); style_tab_->AddTab(L"Style", contents); - style_tab_->AddTab(L"Other", new ChromeViews::View()); + style_tab_->AddTab(L"Other", new views::View()); // Right bottom box with search. - contents = new ChromeViews::View(); + contents = new views::View(); contents->SetBackground( - ChromeViews::Background::CreateSolidBackground(SK_ColorWHITE)); - text_field = new ChromeViews::TextField(); + views::Background::CreateSolidBackground(SK_ColorWHITE)); + text_field = new views::TextField(); contents->AddChildView(text_field); text_field->SetBounds(10, 10, 100, 20); text_field->SetID(kSearchTextFieldID); - button = new ChromeViews::NativeButton(L"Search"); + button = new views::NativeButton(L"Search"); contents->AddChildView(button); button->SetBounds(115, 10, 50, 20); button->SetID(kSearchButtonID); - ChromeViews::Link* link = new ChromeViews::Link(L"Help"); - link->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + views::Link* link = new views::Link(L"Help"); + link->SetHorizontalAlignment(views::Label::ALIGN_LEFT); link->SetID(kHelpLinkID); contents->AddChildView(link); link->SetBounds(170, 10, 30, 15); @@ -481,16 +481,16 @@ void TestViewWindow::Init() { y += 60; - contents = new ChromeViews::View(); + contents = new views::View(); contents->SetFocusable(true); contents->SetBackground( - ChromeViews::Background::CreateSolidBackground(SK_ColorBLUE)); + views::Background::CreateSolidBackground(SK_ColorBLUE)); contents->SetID(kThumbnailContainerID); - button = new ChromeViews::NativeButton(L"Star"); + button = new views::NativeButton(L"Star"); contents->AddChildView(button); button->SetBounds(5, 5, 50, 20); button->SetID(kThumbnailStarID); - button = new ChromeViews::NativeButton(L"SuperStar"); + button = new views::NativeButton(L"SuperStar"); contents->AddChildView(button); button->SetBounds(60, 5, 100, 20); button->SetID(kThumbnailSuperStarID); @@ -547,17 +547,17 @@ TEST_F(FocusManagerTest, NormalTraversal) { // Uncomment the following line if you want to test manually the UI of this // test. - // MessageLoop::current()->Run(new ChromeViews::AcceleratorHandler()); + // MessageLoop::current()->Run(new views::AcceleratorHandler()); - ChromeViews::FocusManager* focus_manager = - ChromeViews::FocusManager::GetFocusManager(test_window_->GetHWND()); + views::FocusManager* focus_manager = + views::FocusManager::GetFocusManager(test_window_->GetHWND()); // Let's traverse the whole focus hierarchy (several times, to make sure it // loops OK). focus_manager->SetFocusedView(NULL); for (int i = 0; i < 3; ++i) { for (int j = 0; j < arraysize(kTraversalIDs); j++) { focus_manager->AdvanceFocus(false); - ChromeViews::View* focused_view = focus_manager->GetFocusedView(); + views::View* focused_view = focus_manager->GetFocusedView(); EXPECT_TRUE(focused_view != NULL); if (focused_view) EXPECT_EQ(kTraversalIDs[j], focused_view->GetID()); @@ -565,7 +565,7 @@ TEST_F(FocusManagerTest, NormalTraversal) { } // Focus the 1st item. - ChromeViews::RootView* root_view = test_window_->GetContentsRootView(); + views::RootView* root_view = test_window_->GetContentsRootView(); focus_manager->SetFocusedView(root_view->GetViewByID(kTraversalIDs[0])); /* BROKEN because of bug #1153276. The reverse order of traversal in Tabbed @@ -574,7 +574,7 @@ TEST_F(FocusManagerTest, NormalTraversal) { for (int i = 0; i < 3; ++i) { for (int j = arraysize(kTraversalIDs) - 1; j >= 0; --j) { focus_manager->AdvanceFocus(true); - ChromeViews::View* focused_view = focus_manager->GetFocusedView(); + views::View* focused_view = focus_manager->GetFocusedView(); EXPECT_TRUE(focused_view != NULL); if (focused_view) EXPECT_EQ(kTraversalIDs[j], focused_view->GetID()); @@ -602,23 +602,23 @@ TEST_F(FocusManagerTest, TraversalWithNonEnabledViews) { kThumbnailContainerID, kThumbnailStarID, kThumbnailSuperStarID }; // Let's disable some views. - ChromeViews::RootView* root_view = test_window_->GetContentsRootView(); + views::RootView* root_view = test_window_->GetContentsRootView(); for (int i = 0; i < arraysize(kMainContentsDisabledIDs); i++) { - ChromeViews::View* v = root_view->GetViewByID(kMainContentsDisabledIDs[i]); + views::View* v = root_view->GetViewByID(kMainContentsDisabledIDs[i]); ASSERT_TRUE(v != NULL); if (v) v->SetEnabled(false); } root_view = test_window_->GetStyleRootView(); for (int i = 0; i < arraysize(kStyleContentsDisabledIDs); i++) { - ChromeViews::View* v = root_view->GetViewByID(kStyleContentsDisabledIDs[i]); + views::View* v = root_view->GetViewByID(kStyleContentsDisabledIDs[i]); ASSERT_TRUE(v != NULL); if (v) v->SetEnabled(false); } root_view = test_window_->GetSearchRootView(); for (int i = 0; i < arraysize(kSearchContentsDisabledIDs); i++) { - ChromeViews::View* v = + views::View* v = root_view->GetViewByID(kSearchContentsDisabledIDs[i]); ASSERT_TRUE(v != NULL); if (v) @@ -626,9 +626,9 @@ TEST_F(FocusManagerTest, TraversalWithNonEnabledViews) { } - ChromeViews::FocusManager* focus_manager = - ChromeViews::FocusManager::GetFocusManager(test_window_->GetHWND()); - ChromeViews::View* focused_view; + views::FocusManager* focus_manager = + views::FocusManager::GetFocusManager(test_window_->GetHWND()); + views::View* focused_view; // Let's do one traversal (several times, to make sure it loops ok). for (int i = 0; i < 3;++i) { for (int j = 0; j < arraysize(kTraversalIDs); j++) { diff --git a/chrome/views/grid_layout.cc b/chrome/views/grid_layout.cc index 806d7fc..c43ef0e 100644 --- a/chrome/views/grid_layout.cc +++ b/chrome/views/grid_layout.cc @@ -9,7 +9,7 @@ #include "base/logging.h" #include "chrome/views/view.h" -namespace ChromeViews { +namespace views { // LayoutElement ------------------------------------------------------ @@ -1010,5 +1010,5 @@ ColumnSet* GridLayout::GetLastValidColumnSet() { return NULL; } -} // namespace +} // namespace views diff --git a/chrome/views/grid_layout.h b/chrome/views/grid_layout.h index 68df24c..85284a9 100644 --- a/chrome/views/grid_layout.h +++ b/chrome/views/grid_layout.h @@ -56,7 +56,7 @@ // // AddView takes care of adding the View to the View the GridLayout was // created with. -namespace ChromeViews { +namespace views { class Column; class ColumnSet; @@ -348,7 +348,7 @@ class ColumnSet { DISALLOW_EVIL_CONSTRUCTORS(ColumnSet); }; -} // namespace +} // namespace views #endif // CHROME_VIEWS_GRID_LAYOUT_H__ diff --git a/chrome/views/grid_layout_unittest.cc b/chrome/views/grid_layout_unittest.cc index 827e16f..10cb235 100644 --- a/chrome/views/grid_layout_unittest.cc +++ b/chrome/views/grid_layout_unittest.cc @@ -7,9 +7,9 @@ #include "testing/gtest/include/gtest/gtest.h" -using ChromeViews::ColumnSet; -using ChromeViews::GridLayout; -using ChromeViews::View; +using views::ColumnSet; +using views::GridLayout; +using views::View; static void ExpectViewBoundsEquals(int x, int y, int w, int h, const View* view) { @@ -222,7 +222,7 @@ TEST_F(GridLayoutTest, ColSpan3) { TEST_F(GridLayoutTest, ColSpan4) { - ChromeViews::ColumnSet* set = layout->AddColumnSet(0); + views::ColumnSet* set = layout->AddColumnSet(0); set->AddColumn(GridLayout::LEADING, GridLayout::LEADING, 0, GridLayout::USE_PREF, 0, 0); @@ -358,7 +358,7 @@ TEST_F(GridLayoutTest, Insets) { TEST_F(GridLayoutTest, FixedSize) { layout->SetInsets(2, 2, 2, 2); - ChromeViews::ColumnSet* set = layout->AddColumnSet(0); + views::ColumnSet* set = layout->AddColumnSet(0); int column_count = 4; int title_width = 100; @@ -367,10 +367,10 @@ TEST_F(GridLayoutTest, FixedSize) { int pref_height = 20; for (int i = 0; i < column_count; ++i) { - set->AddColumn(ChromeViews::GridLayout::CENTER, - ChromeViews::GridLayout::CENTER, + set->AddColumn(views::GridLayout::CENTER, + views::GridLayout::CENTER, 0, - ChromeViews::GridLayout::FIXED, + views::GridLayout::FIXED, title_width, title_width); } @@ -399,12 +399,12 @@ TEST_F(GridLayoutTest, FixedSize) { } TEST_F(GridLayoutTest, RowSpanWithPaddingRow) { - ChromeViews::ColumnSet* set = layout->AddColumnSet(0); + views::ColumnSet* set = layout->AddColumnSet(0); - set->AddColumn(ChromeViews::GridLayout::CENTER, - ChromeViews::GridLayout::CENTER, + set->AddColumn(views::GridLayout::CENTER, + views::GridLayout::CENTER, 0, - ChromeViews::GridLayout::FIXED, + views::GridLayout::FIXED, 10, 10); @@ -414,18 +414,18 @@ TEST_F(GridLayoutTest, RowSpanWithPaddingRow) { } TEST_F(GridLayoutTest, RowSpan) { - ChromeViews::ColumnSet* set = layout->AddColumnSet(0); + views::ColumnSet* set = layout->AddColumnSet(0); - set->AddColumn(ChromeViews::GridLayout::LEADING, - ChromeViews::GridLayout::LEADING, + set->AddColumn(views::GridLayout::LEADING, + views::GridLayout::LEADING, 0, - ChromeViews::GridLayout::USE_PREF, + views::GridLayout::USE_PREF, 0, 0); - set->AddColumn(ChromeViews::GridLayout::LEADING, - ChromeViews::GridLayout::LEADING, + set->AddColumn(views::GridLayout::LEADING, + views::GridLayout::LEADING, 0, - ChromeViews::GridLayout::USE_PREF, + views::GridLayout::USE_PREF, 0, 0); @@ -433,7 +433,7 @@ TEST_F(GridLayoutTest, RowSpan) { layout->AddView(new SettableSizeView(gfx::Size(20, 10))); layout->AddView(new SettableSizeView(gfx::Size(20, 40)), 1, 2); layout->StartRow(1, 0); - ChromeViews::View* s3 = new SettableSizeView(gfx::Size(20, 10)); + views::View* s3 = new SettableSizeView(gfx::Size(20, 10)); layout->AddView(s3); GetPreferredSize(); @@ -445,7 +445,7 @@ TEST_F(GridLayoutTest, RowSpan) { } TEST_F(GridLayoutTest, RowSpan2) { - ChromeViews::ColumnSet* set = layout->AddColumnSet(0); + views::ColumnSet* set = layout->AddColumnSet(0); set->AddColumn(GridLayout::LEADING, GridLayout::LEADING, 0, GridLayout::USE_PREF, 0, 0); @@ -454,7 +454,7 @@ TEST_F(GridLayoutTest, RowSpan2) { layout->StartRow(0, 0); layout->AddView(new SettableSizeView(gfx::Size(20, 20))); - ChromeViews::View* s3 = new SettableSizeView(gfx::Size(64, 64)); + views::View* s3 = new SettableSizeView(gfx::Size(64, 64)); layout->AddView(s3, 1, 3); layout->AddPaddingRow(0, 10); @@ -471,7 +471,7 @@ TEST_F(GridLayoutTest, RowSpan2) { } TEST_F(GridLayoutTest, FixedViewWidth) { - ChromeViews::ColumnSet* set = layout->AddColumnSet(0); + views::ColumnSet* set = layout->AddColumnSet(0); set->AddColumn(GridLayout::LEADING, GridLayout::LEADING, 0, GridLayout::USE_PREF, 0, 0); @@ -492,7 +492,7 @@ TEST_F(GridLayoutTest, FixedViewWidth) { } TEST_F(GridLayoutTest, FixedViewHeight) { - ChromeViews::ColumnSet* set = layout->AddColumnSet(0); + views::ColumnSet* set = layout->AddColumnSet(0); set->AddColumn(GridLayout::LEADING, GridLayout::LEADING, 0, GridLayout::USE_PREF, 0, 0); diff --git a/chrome/views/group_table_view.cc b/chrome/views/group_table_view.cc index 4642770..d0e6788 100644 --- a/chrome/views/group_table_view.cc +++ b/chrome/views/group_table_view.cc @@ -8,7 +8,7 @@ #include "base/task.h" #include "chrome/common/gfx/chrome_canvas.h" -namespace ChromeViews { +namespace views { static const COLORREF kSeparatorLineColor = RGB(208, 208, 208); static const int kSeparatorLineThickness = 1; @@ -190,4 +190,4 @@ std::string GroupTableView::GetClassName() const { return kViewClassName; } -} // Namespace +} // namespace views diff --git a/chrome/views/group_table_view.h b/chrome/views/group_table_view.h index d534132..44825b4 100644 --- a/chrome/views/group_table_view.h +++ b/chrome/views/group_table_view.h @@ -12,7 +12,7 @@ // It allows to have groups of rows that act as a single row from the selection // perspective. Groups are visually separated by a horizontal line. -namespace ChromeViews { +namespace views { struct GroupRange { int start; @@ -77,6 +77,6 @@ class GroupTableView : public TableView { DISALLOW_COPY_AND_ASSIGN(GroupTableView); }; -} // namespace ChromeViews +} // namespace views #endif // CHROME_VIEWS_GROUP_TABLE_VIEW_H_ diff --git a/chrome/views/hwnd_view.cc b/chrome/views/hwnd_view.cc index d6976a3..9a4ab30 100644 --- a/chrome/views/hwnd_view.cc +++ b/chrome/views/hwnd_view.cc @@ -11,7 +11,7 @@ #include "chrome/views/scroll_view.h" #include "base/logging.h" -namespace ChromeViews { +namespace views { static const char kViewClassName[] = "chrome/views/HWNDView"; @@ -190,5 +190,5 @@ std::string HWNDView::GetClassName() const { return kViewClassName; } -} +} // namespace views diff --git a/chrome/views/hwnd_view.h b/chrome/views/hwnd_view.h index bf2a2e2..701d228 100644 --- a/chrome/views/hwnd_view.h +++ b/chrome/views/hwnd_view.h @@ -9,7 +9,7 @@ #include "chrome/views/view.h" -namespace ChromeViews { +namespace views { ///////////////////////////////////////////////////////////////////////////// // @@ -93,7 +93,7 @@ class HWNDView : public View { View* focus_view_; }; -} +} // namespace views #endif // CHROME_VIEWS_HWND_VIEW_H__ diff --git a/chrome/views/image_view.cc b/chrome/views/image_view.cc index 640541c..6c25574 100644 --- a/chrome/views/image_view.cc +++ b/chrome/views/image_view.cc @@ -6,7 +6,7 @@ #include "chrome/common/gfx/chrome_canvas.h" #include "chrome/views/image_view.h" -namespace ChromeViews { +namespace views { ImageView::ImageView() : image_size_set_(false), @@ -166,5 +166,5 @@ bool ImageView::GetTooltipText(int x, int y, std::wstring* tooltip) { } } -} +} // namespace views diff --git a/chrome/views/image_view.h b/chrome/views/image_view.h index ce18b81..d0ba89b 100644 --- a/chrome/views/image_view.h +++ b/chrome/views/image_view.h @@ -12,7 +12,7 @@ class ChromeCanvas; -namespace ChromeViews { +namespace views { ///////////////////////////////////////////////////////////////////////////// // @@ -104,7 +104,7 @@ class ImageView : public View { DISALLOW_EVIL_CONSTRUCTORS(ImageView); }; -} +} // namespace views #endif // CHROME_VIEWS_IMAGE_VIEW_H__ diff --git a/chrome/views/label.cc b/chrome/views/label.cc index 2f46b34..ebc04deab 100644 --- a/chrome/views/label.cc +++ b/chrome/views/label.cc @@ -17,7 +17,7 @@ #include "chrome/views/background.h" #include "chrome/views/container.h" -namespace ChromeViews { +namespace views { const char Label::kViewClassName[] = "chrome/views/Label"; @@ -373,5 +373,5 @@ bool Label::GetAccessibleState(VARIANT* state) { return true; } -} +} // namespace views diff --git a/chrome/views/label.h b/chrome/views/label.h index 034abee..c65dea5 100644 --- a/chrome/views/label.h +++ b/chrome/views/label.h @@ -10,7 +10,7 @@ #include "googleurl/src/gurl.h" #include "SkColor.h" -namespace ChromeViews { +namespace views { ///////////////////////////////////////////////////////////////////////////// // @@ -171,6 +171,7 @@ class Label : public View { scoped_ptr<Background> mouse_over_background_; }; -} +} // namespace views + #endif // CHROME_VIEWS_VIEW_H__ diff --git a/chrome/views/layout_manager.cc b/chrome/views/layout_manager.cc index 52991a9..3ba85ea 100644 --- a/chrome/views/layout_manager.cc +++ b/chrome/views/layout_manager.cc @@ -6,11 +6,11 @@ #include "chrome/views/view.h" -namespace ChromeViews { +namespace views { int LayoutManager::GetPreferredHeightForWidth(View* host, int width) { return GetPreferredSize(host).height(); } -} // namespace +} // namespace views diff --git a/chrome/views/layout_manager.h b/chrome/views/layout_manager.h index bf55cad..81bfdbc 100644 --- a/chrome/views/layout_manager.h +++ b/chrome/views/layout_manager.h @@ -13,7 +13,7 @@ namespace gfx { class Size; } -namespace ChromeViews { +namespace views { class View; @@ -57,7 +57,7 @@ class LayoutManager { virtual void ViewRemoved(View* host, View* view) {} }; -} +} // namespace views #endif // CHROME_VIEWS_LAYOUT_MANAGER_H__ diff --git a/chrome/views/link.cc b/chrome/views/link.cc index 2d04864..c824e62 100644 --- a/chrome/views/link.cc +++ b/chrome/views/link.cc @@ -8,7 +8,7 @@ #include "chrome/common/gfx/chrome_font.h" #include "chrome/views/event.h" -namespace ChromeViews { +namespace views { static HCURSOR g_hand_cursor = NULL; @@ -184,5 +184,5 @@ HCURSOR Link::GetCursorForPoint(Event::EventType event_type, int x, int y) { } } -} +} // namespace views diff --git a/chrome/views/link.h b/chrome/views/link.h index fd99ea8..8db9620 100644 --- a/chrome/views/link.h +++ b/chrome/views/link.h @@ -7,7 +7,7 @@ #include "chrome/views/label.h" -namespace ChromeViews { +namespace views { class Link; @@ -86,6 +86,8 @@ class Link : public Label { // The color when the link is neither highlighted nor disabled. SkColor normal_color_; }; -} + +} // namespace views + #endif // CHROME_VIEWS_LINK_H__ diff --git a/chrome/views/menu.cc b/chrome/views/menu.cc index 93185d6a..b064e72 100644 --- a/chrome/views/menu.cc +++ b/chrome/views/menu.cc @@ -297,7 +297,7 @@ void Menu::AddMenuItemInternal(int index, delegate_->GetLabel(item_id) : label); // Find out if there is a shortcut we need to append to the label. - ChromeViews::Accelerator accelerator(0, false, false, false); + views::Accelerator accelerator(0, false, false, false); if (delegate_ && delegate_->GetAcceleratorInfo(item_id, &accelerator)) { actual_label += L'\t'; actual_label += accelerator.GetShortcutText(); diff --git a/chrome/views/menu.h b/chrome/views/menu.h index a1a4d02..fabfcdf 100644 --- a/chrome/views/menu.h +++ b/chrome/views/menu.h @@ -18,7 +18,7 @@ namespace { class MenuHostWindow; } -namespace ChromeViews { +namespace views { class Accelerator; } @@ -65,7 +65,7 @@ class Menu { // The delegate needs to implement this function if it wants to display // the shortcut text next to each menu item. If there is an accelerator // for a given item id, the implementor must return it. - virtual bool GetAcceleratorInfo(int id, ChromeViews::Accelerator* accel) { + virtual bool GetAcceleratorInfo(int id, views::Accelerator* accel) { return false; } diff --git a/chrome/views/menu_button.cc b/chrome/views/menu_button.cc index 038faa0..412d8fa 100644 --- a/chrome/views/menu_button.cc +++ b/chrome/views/menu_button.cc @@ -21,7 +21,7 @@ #include "generated_resources.h" -namespace ChromeViews { +namespace views { // The amount of time, in milliseconds, we wait before allowing another mouse // pressed event to show the menu. @@ -81,10 +81,10 @@ void MenuButton::Paint(ChromeCanvas* canvas, bool for_drag) { if (show_menu_marker_) { gfx::Insets insets = GetInsets(); - // We can not use the ChromeViews' mirroring infrastructure for mirroring - // a MenuButton control (see TextButton::Paint() for a detailed - // explanation regarding why we can not flip the canvas). Therefore, we - // need to manually mirror the position of the down arrow. + // We can not use the views' mirroring infrastructure for mirroring a + // MenuButton control (see TextButton::Paint() for a detailed explanation + // regarding why we can not flip the canvas). Therefore, we need to + // manually mirror the position of the down arrow. gfx::Rect arrow_bounds(width() - insets.right() - kMenuMarker->width() - kMenuMarkerPaddingRight, height() / 2, @@ -177,8 +177,7 @@ bool MenuButton::Activate() { return true; } -bool MenuButton::OnMousePressed(const ChromeViews::MouseEvent& e) { - using namespace ChromeViews; +bool MenuButton::OnMousePressed(const MouseEvent& e) { if (IsFocusable()) RequestFocus(); if (GetState() != BS_DISABLED) { @@ -196,7 +195,7 @@ bool MenuButton::OnMousePressed(const ChromeViews::MouseEvent& e) { return true; } -void MenuButton::OnMouseReleased(const ChromeViews::MouseEvent& e, +void MenuButton::OnMouseReleased(const MouseEvent& e, bool canceled) { if (GetDragOperations(e.x(), e.y()) != DragDropTypes::DRAG_NONE && GetState() != BS_DISABLED && !canceled && !InDrag() && @@ -249,11 +248,10 @@ bool MenuButton::GetAccessibleState(VARIANT* state) { // to BS_NORMAL instead of keeping the state BM_PUSHED. This, in turn, will // cause the button to appear depressed while the menu is displayed. void MenuButton::OnMouseExited(const MouseEvent& event) { - using namespace ChromeViews; if ((state_ != BS_DISABLED) && (!menu_visible_) && (!InDrag())) { SetState(BS_NORMAL); } } -} // namespace ChromeViews +} // namespace views diff --git a/chrome/views/menu_button.h b/chrome/views/menu_button.h index 961360b..de6f973 100644 --- a/chrome/views/menu_button.h +++ b/chrome/views/menu_button.h @@ -12,7 +12,7 @@ #include "chrome/views/text_button.h" #include "base/time.h" -namespace ChromeViews { +namespace views { class MouseEvent; class ViewMenuDelegate; @@ -43,8 +43,8 @@ class MenuButton : public TextButton { // These methods are overriden to implement a simple push button // behavior - virtual bool OnMousePressed(const ChromeViews::MouseEvent& e); - void OnMouseReleased(const ChromeViews::MouseEvent& e, bool canceled); + virtual bool OnMousePressed(const MouseEvent& e); + void OnMouseReleased(const MouseEvent& e, bool canceled); virtual bool OnKeyReleased(const KeyEvent& e); virtual void OnMouseExited(const MouseEvent& event); @@ -92,7 +92,7 @@ class MenuButton : public TextButton { friend class TextButtonBackground; }; -} // namespace +} // namespace views #endif // CHROME_VIEWS_MENU_BUTTON_H__ diff --git a/chrome/views/message_box_view.cc b/chrome/views/message_box_view.cc index bf2ac5f..beeb708 100644 --- a/chrome/views/message_box_view.cc +++ b/chrome/views/message_box_view.cc @@ -22,7 +22,7 @@ MessageBoxView::MessageBoxView(int dialog_flags, const std::wstring& message, const std::wstring& default_prompt, int message_width) - : message_label_(new ChromeViews::Label(message)), + : message_label_(new views::Label(message)), prompt_field_(NULL), icon_(NULL), check_box_(NULL), @@ -34,7 +34,7 @@ MessageBoxView::MessageBoxView(int dialog_flags, MessageBoxView::MessageBoxView(int dialog_flags, const std::wstring& message, const std::wstring& default_prompt) - : message_label_(new ChromeViews::Label(message)), + : message_label_(new views::Label(message)), prompt_field_(NULL), icon_(NULL), check_box_(NULL), @@ -57,7 +57,7 @@ bool MessageBoxView::IsCheckBoxSelected() { void MessageBoxView::SetIcon(const SkBitmap& icon) { if (!icon_) - icon_ = new ChromeViews::ImageView(); + icon_ = new views::ImageView(); icon_->SetImage(icon); icon_->SetBounds(0, 0, icon.width(), icon.height()); ResetLayoutManager(); @@ -65,18 +65,18 @@ void MessageBoxView::SetIcon(const SkBitmap& icon) { void MessageBoxView::SetCheckBoxLabel(const std::wstring& label) { if (!check_box_) - check_box_ = new ChromeViews::CheckBox(label); + check_box_ = new views::CheckBox(label); else check_box_->SetLabel(label); ResetLayoutManager(); } /////////////////////////////////////////////////////////////////////////////// -// MessageBoxView, ChromeViews::View overrides: +// MessageBoxView, views::View overrides: void MessageBoxView::ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child) { + views::View* parent, + views::View* child) { if (child == this && is_add) { if (prompt_field_) prompt_field_->SelectAll(); @@ -101,10 +101,10 @@ void MessageBoxView::FocusFirstFocusableControl() { void MessageBoxView::Init(int dialog_flags, const std::wstring& default_prompt) { message_label_->SetMultiLine(true); - message_label_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + message_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); if (dialog_flags & kFlagHasPromptField) { - prompt_field_ = new ChromeViews::TextField; + prompt_field_ = new views::TextField; prompt_field_->SetText(default_prompt); } @@ -112,8 +112,8 @@ void MessageBoxView::Init(int dialog_flags, } void MessageBoxView::ResetLayoutManager() { - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; + using views::GridLayout; + using views::ColumnSet; // Initialize the Grid Layout Manager used for this dialog box. GridLayout* layout = CreatePanelGridLayout(this); diff --git a/chrome/views/message_box_view.h b/chrome/views/message_box_view.h index 12ed15d..ad9a8fd 100644 --- a/chrome/views/message_box_view.h +++ b/chrome/views/message_box_view.h @@ -16,7 +16,7 @@ // This class displays a message box within a constrained window // with options for a message, a prompt, and OK and Cancel buttons. -class MessageBoxView : public ChromeViews::View { +class MessageBoxView : public views::View { public: // flags static const int kFlagHasOKButton = 0x1; @@ -61,8 +61,8 @@ class MessageBoxView : public ChromeViews::View { protected: // Layout and Painting functions. virtual void ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child); + views::View* parent, + views::View* child); private: // Called after ViewHierarchyChanged's call stack unwinds and returns to the @@ -78,16 +78,16 @@ class MessageBoxView : public ChromeViews::View { void ResetLayoutManager(); // Message for the message box. - ChromeViews::Label* message_label_; + views::Label* message_label_; // Input text field for the message box. - ChromeViews::TextField* prompt_field_; + views::TextField* prompt_field_; // Icon displayed in the upper left corner of the message box. - ChromeViews::ImageView* icon_; + views::ImageView* icon_; // Checkbox for the message box. - ChromeViews::CheckBox* check_box_; + views::CheckBox* check_box_; // Maximum width of the message label. int message_width_; diff --git a/chrome/views/native_button.cc b/chrome/views/native_button.cc index ee2288f..bbee9e9 100644 --- a/chrome/views/native_button.cc +++ b/chrome/views/native_button.cc @@ -10,7 +10,7 @@ #include "chrome/common/resource_bundle.h" #include "chrome/views/background.h" -namespace ChromeViews { +namespace views { NativeButton::NativeButton(const std::wstring& label) : enforce_dlu_min_size_(true) { @@ -192,4 +192,4 @@ bool NativeButton::OnKeyDown(int virtual_key_code) { return false; } -} +} // namespace views diff --git a/chrome/views/native_button.h b/chrome/views/native_button.h index df1fd8e..03b03b0 100644 --- a/chrome/views/native_button.h +++ b/chrome/views/native_button.h @@ -11,8 +11,7 @@ #include "chrome/common/gfx/chrome_font.h" #include "chrome/views/native_control.h" -namespace ChromeViews { - +namespace views { class HWNDView; @@ -134,7 +133,7 @@ class NativeButton : public NativeControl { DISALLOW_EVIL_CONSTRUCTORS(NativeButton); }; -} +} // namespace views #endif // CHROME_VIEWS_NATIVE_BUTTON_H__ diff --git a/chrome/views/native_control.cc b/chrome/views/native_control.cc index 18a1324..8fdcb39 100644 --- a/chrome/views/native_control.cc +++ b/chrome/views/native_control.cc @@ -18,7 +18,7 @@ #include "chrome/views/background.h" #include "base/gfx/native_theme.h" -namespace ChromeViews { +namespace views { // Maps to the original WNDPROC for the controller window before we subclassed // it. @@ -348,5 +348,5 @@ LRESULT CALLBACK NativeControl::NativeControlWndProc(HWND window, UINT message, message, w_param, l_param); } -} +} // namespace views diff --git a/chrome/views/native_control.h b/chrome/views/native_control.h index 29a57cf..6831069 100644 --- a/chrome/views/native_control.h +++ b/chrome/views/native_control.h @@ -7,7 +7,7 @@ #include "chrome/views/view.h" -namespace ChromeViews { +namespace views { class HWNDView; class NativeControlContainer; @@ -120,7 +120,7 @@ class NativeControl : public View { DISALLOW_EVIL_CONSTRUCTORS(NativeControl); }; -} +} // namespace views #endif // CHROME_VIEWS_NATIVE_CONTROL_H__ diff --git a/chrome/views/native_scroll_bar.cc b/chrome/views/native_scroll_bar.cc index 5d69c43..fb10520 100644 --- a/chrome/views/native_scroll_bar.cc +++ b/chrome/views/native_scroll_bar.cc @@ -14,7 +14,7 @@ #include "chrome/views/container.h" #include "chrome/views/hwnd_view.h" -namespace ChromeViews { +namespace views { ///////////////////////////////////////////////////////////////////////////// // @@ -350,5 +350,5 @@ int NativeScrollBar::GetVerticalScrollBarWidth() { return ::GetSystemMetrics(SM_CXVSCROLL); } -} +} // namespace views diff --git a/chrome/views/native_scroll_bar.h b/chrome/views/native_scroll_bar.h index 8eee019..3b94621 100644 --- a/chrome/views/native_scroll_bar.h +++ b/chrome/views/native_scroll_bar.h @@ -7,7 +7,7 @@ #include "chrome/views/scroll_bar.h" -namespace ChromeViews { +namespace views { class HWNDView; class ScrollBarContainer; @@ -58,6 +58,7 @@ class NativeScrollBar : public ScrollBar { ScrollBarContainer* sb_container_; }; -} +} // namespace views + #endif diff --git a/chrome/views/non_client_view.cc b/chrome/views/non_client_view.cc index ff91dff..63fcd34 100644 --- a/chrome/views/non_client_view.cc +++ b/chrome/views/non_client_view.cc @@ -4,7 +4,7 @@ #include "chrome/views/non_client_view.h" -namespace ChromeViews { +namespace views { int NonClientView::GetHTComponentForFrame(const gfx::Point& point, int resize_area_size, @@ -53,5 +53,5 @@ int NonClientView::GetHTComponentForFrame(const gfx::Point& point, return HTNOWHERE; } -} // namespace ChromeViews +} // namespace views diff --git a/chrome/views/non_client_view.h b/chrome/views/non_client_view.h index 9bbe1ac..808227e 100644 --- a/chrome/views/non_client_view.h +++ b/chrome/views/non_client_view.h @@ -11,7 +11,7 @@ namespace gfx { class Path; } -namespace ChromeViews { +namespace views { class ClientView; @@ -83,7 +83,7 @@ class NonClientView : public View { bool paint_as_active_; }; -} // namespace ChromeViews +} // namespace views #endif // #ifndef CHROME_VIEWS_NON_CLIENT_VIEW_H_ diff --git a/chrome/views/painter.cc b/chrome/views/painter.cc index 93152e2..e20820c 100644 --- a/chrome/views/painter.cc +++ b/chrome/views/painter.cc @@ -11,7 +11,7 @@ #include "skia/include/SkBitmap.h" #include "skia/include/SkGradientShader.h" -namespace ChromeViews { +namespace views { namespace { @@ -163,5 +163,5 @@ void HorizontalPainter::Paint(int w, int h, ChromeCanvas* canvas) { height_); } -} +} // namespace views diff --git a/chrome/views/painter.h b/chrome/views/painter.h index e0e3519..9bdd7ff 100644 --- a/chrome/views/painter.h +++ b/chrome/views/painter.h @@ -13,7 +13,7 @@ class ChromeCanvas; class SkBitmap; -namespace ChromeViews { +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 @@ -115,7 +115,7 @@ class HorizontalPainter : public Painter { DISALLOW_EVIL_CONSTRUCTORS(HorizontalPainter); }; -} +} // namespace views #endif // CHROME_VIEWS_PAINTER_H__ diff --git a/chrome/views/radio_button.cc b/chrome/views/radio_button.cc index 56e80f1..e96ec41 100644 --- a/chrome/views/radio_button.cc +++ b/chrome/views/radio_button.cc @@ -8,7 +8,7 @@ #include "chrome/views/hwnd_view.h" #include "chrome/views/root_view.h" -namespace ChromeViews { +namespace views { // FIXME(ACW) there got be a better way to find out the check box sizes static int kRadioWidth = 13; @@ -120,5 +120,5 @@ View* RadioButton::GetSelectedViewForGroup(int group_id) { return NULL; } -} +} // namespace views diff --git a/chrome/views/radio_button.h b/chrome/views/radio_button.h index 0a5e5fa..7d0748b 100644 --- a/chrome/views/radio_button.h +++ b/chrome/views/radio_button.h @@ -7,7 +7,7 @@ #include "chrome/views/checkbox.h" -namespace ChromeViews { +namespace views { //////////////////////////////////////////////////////////////////////////////// // @@ -55,6 +55,7 @@ class RadioButton : public CheckBox { DISALLOW_EVIL_CONSTRUCTORS(RadioButton); }; -} +} // namespace views + #endif // CHROME_VIEWS_RADIO_BUTTON_H__ diff --git a/chrome/views/repeat_controller.cc b/chrome/views/repeat_controller.cc index 96aa923..d6a9ac4 100644 --- a/chrome/views/repeat_controller.cc +++ b/chrome/views/repeat_controller.cc @@ -4,7 +4,7 @@ #include "chrome/views/repeat_controller.h" -namespace ChromeViews { +namespace views { // The delay before the first and then subsequent repeats. Values taken from // XUL code: http://mxr.mozilla.org/seamonkey/source/layout/xul/base/src/nsRepeatService.cpp#52 @@ -40,4 +40,4 @@ void RepeatController::Run() { callback_->Run(); } -} // namespace ChromeViews +} // namespace views diff --git a/chrome/views/repeat_controller.h b/chrome/views/repeat_controller.h index 92434f6..474d882 100644 --- a/chrome/views/repeat_controller.h +++ b/chrome/views/repeat_controller.h @@ -7,7 +7,7 @@ #include "base/timer.h" -namespace ChromeViews { +namespace views { /////////////////////////////////////////////////////////////////////////////// // @@ -47,6 +47,6 @@ class RepeatController { DISALLOW_COPY_AND_ASSIGN(RepeatController); }; -} // namespace ChromeViews +} // namespace views #endif // #ifndef CHROME_VIEWS_REPEAT_CONTROLLER_H_ diff --git a/chrome/views/resize_corner.cc b/chrome/views/resize_corner.cc index d1a91b4..97925ca 100644 --- a/chrome/views/resize_corner.cc +++ b/chrome/views/resize_corner.cc @@ -9,7 +9,7 @@ #include "base/gfx/native_theme.h" #include "chrome/common/gfx/chrome_canvas.h" -namespace ChromeViews { +namespace views { ResizeCorner::ResizeCorner() { } @@ -29,5 +29,5 @@ void ResizeCorner::Paint(ChromeCanvas* canvas) { canvas->endPlatformPaint(); } -} +} // namespace views diff --git a/chrome/views/resize_corner.h b/chrome/views/resize_corner.h index 96b1780..ed02216 100644 --- a/chrome/views/resize_corner.h +++ b/chrome/views/resize_corner.h @@ -7,7 +7,7 @@ #include "chrome/views/view.h" -namespace ChromeViews { +namespace views { // Simple drawing of a resize corner. Has no functionality. class ResizeCorner : public View { @@ -22,7 +22,7 @@ class ResizeCorner : public View { DISALLOW_EVIL_CONSTRUCTORS(ResizeCorner); }; -} +} // namespace views #endif // CHROME_VIEWS_RESIZE_CORNER_H__ diff --git a/chrome/views/root_view.cc b/chrome/views/root_view.cc index db6c80a..80abe75 100644 --- a/chrome/views/root_view.cc +++ b/chrome/views/root_view.cc @@ -14,7 +14,7 @@ #include "chrome/views/root_view_drop_target.h" #include "chrome/views/container.h" -namespace ChromeViews { +namespace views { ///////////////////////////////////////////////////////////////////////////// // @@ -966,5 +966,5 @@ View* RootView::GetDragView() { return drag_view_; } -} +} // namespace views diff --git a/chrome/views/root_view.h b/chrome/views/root_view.h index 14a3977..eef96eb 100644 --- a/chrome/views/root_view.h +++ b/chrome/views/root_view.h @@ -9,7 +9,7 @@ #include "chrome/views/focus_manager.h" #include "chrome/views/view.h" -namespace ChromeViews { +namespace views { class Container; class PaintTask; @@ -339,7 +339,7 @@ class RootView : public View, #endif }; -} +} // namespace views #endif // CHROME_VIEWS_ROOT_VIEW_H__ diff --git a/chrome/views/root_view_drop_target.cc b/chrome/views/root_view_drop_target.cc index a58320c..c5beedc 100644 --- a/chrome/views/root_view_drop_target.cc +++ b/chrome/views/root_view_drop_target.cc @@ -10,7 +10,7 @@ #include "chrome/views/container.h" #include "chrome/views/root_view.h" -namespace ChromeViews { +namespace views { RootViewDropTarget::RootViewDropTarget(RootView* root_view) : BaseDropTarget(root_view->GetContainer()->GetHWND()), @@ -116,5 +116,5 @@ View* RootViewDropTarget::CalculateTargetView( return view; } -} // namespace +} // namespace views diff --git a/chrome/views/root_view_drop_target.h b/chrome/views/root_view_drop_target.h index 8764689..9c2bd4d 100644 --- a/chrome/views/root_view_drop_target.h +++ b/chrome/views/root_view_drop_target.h @@ -16,7 +16,7 @@ namespace gfx { class Point; } -namespace ChromeViews { +namespace views { class RootView; class View; @@ -70,7 +70,7 @@ class RootViewDropTarget : public BaseDropTarget { DISALLOW_EVIL_CONSTRUCTORS(RootViewDropTarget); }; -} // namespace +} // namespace views #endif // CHROME_VIEWS_ROOT_VIEW_DROP_TARGET_H__ diff --git a/chrome/views/scroll_bar.cc b/chrome/views/scroll_bar.cc index 06cf81c..aeb907a 100644 --- a/chrome/views/scroll_bar.cc +++ b/chrome/views/scroll_bar.cc @@ -4,7 +4,7 @@ #include "chrome/views/scroll_bar.h" -namespace ChromeViews { +namespace views { ///////////////////////////////////////////////////////////////////////////// // @@ -44,5 +44,5 @@ int ScrollBar::GetMinPosition() const { return 0; } -} +} // namespace views diff --git a/chrome/views/scroll_bar.h b/chrome/views/scroll_bar.h index 1dc2f22..1697c98 100644 --- a/chrome/views/scroll_bar.h +++ b/chrome/views/scroll_bar.h @@ -8,7 +8,7 @@ #include "chrome/views/view.h" #include "chrome/views/event.h" -namespace ChromeViews { +namespace views { class ScrollBar; @@ -97,6 +97,7 @@ class ScrollBar : public View { int max_pos_; }; -} +} // namespace views + #endif diff --git a/chrome/views/scroll_view.cc b/chrome/views/scroll_view.cc index 7a96681..c6fdd7e 100644 --- a/chrome/views/scroll_view.cc +++ b/chrome/views/scroll_view.cc @@ -10,7 +10,7 @@ #include "chrome/views/native_scroll_bar.h" #include "chrome/views/root_view.h" -namespace ChromeViews { +namespace views { const char* const ScrollView::kViewClassName = "chrome/views/ScrollView"; @@ -497,5 +497,5 @@ VariableRowHeightScrollHelper::RowInfo row_height_); } -} +} // namespace views diff --git a/chrome/views/scroll_view.h b/chrome/views/scroll_view.h index c41ad87..db0685a 100644 --- a/chrome/views/scroll_view.h +++ b/chrome/views/scroll_view.h @@ -7,7 +7,7 @@ #include "chrome/views/scroll_bar.h" -namespace ChromeViews { +namespace views { ///////////////////////////////////////////////////////////////////////////// // @@ -202,7 +202,7 @@ class FixedRowHeightScrollHelper : public VariableRowHeightScrollHelper { DISALLOW_EVIL_CONSTRUCTORS(FixedRowHeightScrollHelper); }; -} +} // namespace views #endif // CHROME_VIEWS_SCROLL_VIEW_H__ diff --git a/chrome/views/separator.cc b/chrome/views/separator.cc index c808826..63ad3a9 100644 --- a/chrome/views/separator.cc +++ b/chrome/views/separator.cc @@ -7,7 +7,7 @@ #include "base/logging.h" #include "chrome/views/hwnd_view.h" -namespace ChromeViews { +namespace views { static const int kSeparatorSize = 2; @@ -35,5 +35,5 @@ gfx::Size Separator::GetPreferredSize() { return gfx::Size(width(), fixed_height_); } -} +} // namespace views diff --git a/chrome/views/separator.h b/chrome/views/separator.h index 9a4c2bc..fe8f26f 100644 --- a/chrome/views/separator.h +++ b/chrome/views/separator.h @@ -7,7 +7,7 @@ #include "chrome/views/native_control.h" -namespace ChromeViews { +namespace views { // The Separator class is a view that shows a line used to visually separate // other views. The current implementation is only horizontal. @@ -29,5 +29,6 @@ class Separator : public NativeControl { DISALLOW_EVIL_CONSTRUCTORS(Separator); }; -} +} // namespace views + #endif // #define CHROME_VIEWS_SEPARATOR_H__ diff --git a/chrome/views/tabbed_pane.cc b/chrome/views/tabbed_pane.cc index 3d87ca8..85baaf4 100644 --- a/chrome/views/tabbed_pane.cc +++ b/chrome/views/tabbed_pane.cc @@ -20,7 +20,7 @@ #include "chrome/views/root_view.h" #include "skia/include/SkColor.h" -namespace ChromeViews { +namespace views { // A background object that paints the tab panel background which may be // rendered by the system visual styles system. @@ -146,13 +146,13 @@ HWND TabbedPane::CreateNativeControl(HWND parent_container) { // we do that, then the HWND we create for |content_window_| below will // inherit the WS_EX_LAYOUTRTL property and this will result in the contents // being flipped, which is not what we want (because we handle mirroring in - // ChromeViews without the use of Windows' support for mirroring). Therefore, + // views without the use of Windows' support for mirroring). Therefore, // we initially create our HWND without the aforementioned property and we // explicitly set this property our child is created. This way, on RTL // locales, our tabs will be nicely rendered from right to left (by virtue of // Windows doing the right thing with the TabbedPane HWND) and each tab // contents will use an RTL layout correctly (by virtue of the mirroring - // infrastructure in ChromeViews doing the right thing with each View we put + // infrastructure in views doing the right thing with each View we put // in the tab). tab_control_ = ::CreateWindowEx(0, WC_TABCONTROL, @@ -249,5 +249,5 @@ void TabbedPane::ResizeContents(HWND tab_control) { TRUE); } -} +} // namespace views diff --git a/chrome/views/tabbed_pane.h b/chrome/views/tabbed_pane.h index d518a4e..fc30765 100644 --- a/chrome/views/tabbed_pane.h +++ b/chrome/views/tabbed_pane.h @@ -7,7 +7,7 @@ #include "chrome/views/native_control.h" -namespace ChromeViews { +namespace views { // The TabbedPane class is a view that shows tabs. When the user clicks on a // tab, the associated view is displayed. @@ -83,6 +83,6 @@ class TabbedPane : public NativeControl { DISALLOW_EVIL_CONSTRUCTORS(TabbedPane); }; -} +} // namespace views #endif // #define CHROME_VIEWS_TABBED_PANE_H__ diff --git a/chrome/views/table_view.cc b/chrome/views/table_view.cc index 398145c..fe4a40e 100644 --- a/chrome/views/table_view.cc +++ b/chrome/views/table_view.cc @@ -20,7 +20,7 @@ #include "SkBitmap.h" #include "SkColorFilter.h" -namespace ChromeViews { +namespace views { // Added to column width to prevent truncation. const int kListViewTextPadding = 15; @@ -554,7 +554,7 @@ HWND TableView::CreateNativeControl(HWND parent_container) { // If there's only one column and the title string is empty, don't show a // header. if (all_columns_.size() == 1) { - std::map<int, ChromeViews::TableColumn>::const_iterator first = + std::map<int, TableColumn>::const_iterator first = all_columns_.begin(); if (first->second.title.empty()) style |= LVS_NOCOLUMNHEADER; @@ -1294,4 +1294,4 @@ void TableSelectionIterator::UpdateModelIndexFromViewIndex() { model_index_ = table_view_->view_to_model(view_index_); } -} // namespace +} // namespace views diff --git a/chrome/views/table_view.h b/chrome/views/table_view.h index 4e1c943..ab92a86 100644 --- a/chrome/views/table_view.h +++ b/chrome/views/table_view.h @@ -41,7 +41,7 @@ class SkBitmap; // sort by way of overriding CompareValues. // // TableView is a wrapper around the window type ListView in report mode. -namespace ChromeViews { +namespace views { class HWNDView; class ListView; @@ -583,7 +583,7 @@ class TableView : public NativeControl, std::vector<int> visible_columns_; // Mapping of an int id to a TableColumn representing all possible columns. - std::map<int,ChromeViews::TableColumn> all_columns_; + std::map<int, TableColumn> all_columns_; // Cached value of columns_.size() int column_count_; @@ -643,6 +643,6 @@ class TableView : public NativeControl, DISALLOW_COPY_AND_ASSIGN(TableView); }; -} // namespace +} // namespace views #endif // CHROME_VIEWS_TABLE_VIEW_H_ diff --git a/chrome/views/table_view_unittest.cc b/chrome/views/table_view_unittest.cc index 2e3ab7f..5b4c509 100644 --- a/chrome/views/table_view_unittest.cc +++ b/chrome/views/table_view_unittest.cc @@ -10,7 +10,7 @@ #include "chrome/views/window_delegate.h" #include "testing/gtest/include/gtest/gtest.h" -using ChromeViews::TableView; +using views::TableView; // TestTableModel -------------------------------------------------------------- @@ -22,7 +22,7 @@ using ChromeViews::TableView; // 0, 1 // 1, 1 // 2, 2 -class TestTableModel : public ChromeViews::TableModel { +class TestTableModel : public views::TableModel { public: TestTableModel(); @@ -38,11 +38,11 @@ class TestTableModel : public ChromeViews::TableModel { // TableModel virtual int RowCount(); virtual std::wstring GetText(int row, int column_id); - virtual void SetObserver(ChromeViews::TableModelObserver* observer); + virtual void SetObserver(views::TableModelObserver* observer); virtual int CompareValues(int row1, int row2, int column_id); private: - ChromeViews::TableModelObserver* observer_; + views::TableModelObserver* observer_; // The data. std::vector<std::vector<int>> rows_; @@ -88,7 +88,7 @@ std::wstring TestTableModel::GetText(int row, int column_id) { return IntToWString(rows_[row][column_id]); } -void TestTableModel::SetObserver(ChromeViews::TableModelObserver* observer) { +void TestTableModel::SetObserver(views::TableModelObserver* observer) { observer_ = observer; } @@ -98,12 +98,12 @@ int TestTableModel::CompareValues(int row1, int row2, int column_id) { // TableViewTest --------------------------------------------------------------- -class TableViewTest : public testing::Test, ChromeViews::WindowDelegate { +class TableViewTest : public testing::Test, views::WindowDelegate { public: virtual void SetUp(); virtual void TearDown(); - virtual ChromeViews::View* GetContentsView() { + virtual views::View* GetContentsView() { return table_; } @@ -133,20 +133,20 @@ class TableViewTest : public testing::Test, ChromeViews::WindowDelegate { private: MessageLoopForUI message_loop_; - ChromeViews::Window* window_; + views::Window* window_; }; void TableViewTest::SetUp() { OleInitialize(NULL); model_.reset(CreateModel()); - std::vector<ChromeViews::TableColumn> columns; + std::vector<views::TableColumn> columns; columns.resize(2); columns[0].id = 0; columns[1].id = 1; - table_ = new TableView(model_.get(), columns, ChromeViews::ICON_AND_TEXT, + table_ = new TableView(model_.get(), columns, views::ICON_AND_TEXT, false, false, false); window_ = - ChromeViews::Window::CreateChromeWindow(NULL, + views::Window::CreateChromeWindow(NULL, gfx::Rect(100, 100, 512, 512), this); } diff --git a/chrome/views/text_button.cc b/chrome/views/text_button.cc index 91e2e9808..be9a221 100644 --- a/chrome/views/text_button.cc +++ b/chrome/views/text_button.cc @@ -16,7 +16,7 @@ #include "generated_resources.h" -namespace ChromeViews { +namespace views { // Padding between the icon and text. static const int kIconTextPadding = 5; @@ -178,7 +178,7 @@ gfx::Size TextButton::GetMinimumSize() { return max_text_size_; } -bool TextButton::OnMousePressed(const ChromeViews::MouseEvent& e) { +bool TextButton::OnMousePressed(const MouseEvent& e) { return true; } @@ -298,5 +298,5 @@ void TextButton::SetEnabled(bool enabled) { SchedulePaint(); } -} // namespace ChromeViews +} // namespace views diff --git a/chrome/views/text_button.h b/chrome/views/text_button.h index 2b4a01f..5fee1e3 100644 --- a/chrome/views/text_button.h +++ b/chrome/views/text_button.h @@ -12,7 +12,7 @@ #include "chrome/views/base_button.h" #include "skia/include/SkBitmap.h" -namespace ChromeViews { +namespace views { class MouseEvent; @@ -77,7 +77,7 @@ public: virtual gfx::Size GetPreferredSize(); virtual gfx::Size GetMinimumSize(); - virtual bool OnMousePressed(const ChromeViews::MouseEvent& e); + virtual bool OnMousePressed(const MouseEvent& e); // Call SetText once per string in your set of possible values at // button creation time, so that it can contain the largest of them @@ -135,7 +135,7 @@ public: }; -} // namespace +} // namespace views #endif // CHROME_VIEWS_TEXT_BUTTON_H__ diff --git a/chrome/views/text_field.cc b/chrome/views/text_field.cc index 517968a..44bbf85 100644 --- a/chrome/views/text_field.cc +++ b/chrome/views/text_field.cc @@ -28,7 +28,7 @@ using gfx::NativeTheme; -namespace ChromeViews { +namespace views { static const int kDefaultEditStyle = WS_CHILD | WS_VISIBLE; @@ -996,5 +996,5 @@ bool TextField::ShouldLookupAccelerators(const KeyEvent& e) { return !win_util::IsNumPadDigit(e.GetCharacter(), e.IsExtendedKey()); } -} // namespace ChromeViews +} // namespace views diff --git a/chrome/views/text_field.h b/chrome/views/text_field.h index e9685fd..e69dd329 100644 --- a/chrome/views/text_field.h +++ b/chrome/views/text_field.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// These classes define a text field widget that can be used in the ChromeViews -// UI toolkit. +// These classes define a text field widget that can be used in the views UI +// toolkit. #ifndef CHROME_VIEWS_TEXT_FIELD_H__ #define CHROME_VIEWS_TEXT_FIELD_H__ @@ -15,7 +15,7 @@ #include "chrome/views/view.h" #include "skia/include/SkColor.h" -namespace ChromeViews { +namespace views { class HWNDView; @@ -191,7 +191,7 @@ class TextField : public View { DISALLOW_EVIL_CONSTRUCTORS(TextField); }; -} // namespace ChromeViews +} // namespace views #endif // CHROME_VIEWS_TEXT_FIELD_H__ diff --git a/chrome/views/throbber.cc b/chrome/views/throbber.cc index f848fba..7a82277 100644 --- a/chrome/views/throbber.cc +++ b/chrome/views/throbber.cc @@ -10,7 +10,7 @@ #include "chrome/common/resource_bundle.h" #include "skia/include/SkBitmap.h" -namespace ChromeViews { +namespace views { Throbber::Throbber(int frame_time_ms, bool paint_while_stopped) @@ -178,5 +178,5 @@ void CheckmarkThrobber::InitClass() { // static SkBitmap* CheckmarkThrobber::checkmark_ = NULL; -} // namespace ChromeViews +} // namespace views diff --git a/chrome/views/throbber.h b/chrome/views/throbber.h index 93d771c..f35fd7bd 100644 --- a/chrome/views/throbber.h +++ b/chrome/views/throbber.h @@ -13,9 +13,9 @@ class SkBitmap; -namespace ChromeViews { +namespace views { -class Throbber : public ChromeViews::View { +class Throbber : public View { public: // |frame_time_ms| is the amount of time that should elapse between frames // (in milliseconds) @@ -90,7 +90,7 @@ class CheckmarkThrobber : public Throbber { // If checked is false, the throbber stops spinning and displays nothing. void SetChecked(bool checked); - // Overridden from ChromeViews::Throbber: + // Overridden from Throbber: virtual void Paint(ChromeCanvas* canvas); private: @@ -107,7 +107,7 @@ class CheckmarkThrobber : public Throbber { DISALLOW_EVIL_CONSTRUCTORS(CheckmarkThrobber); }; -} // namespace ChromeViews +} // namespace views #endif // CHROME_VIEWS_THROBBER_H__ diff --git a/chrome/views/tooltip_manager.cc b/chrome/views/tooltip_manager.cc index aa37cf3..6ddc31b 100644 --- a/chrome/views/tooltip_manager.cc +++ b/chrome/views/tooltip_manager.cc @@ -15,7 +15,7 @@ #include "chrome/views/view.h" #include "chrome/views/container.h" -namespace ChromeViews { +namespace views { //static int TooltipManager::tooltip_height_ = 0; @@ -438,4 +438,4 @@ void TooltipManager::DestroyKeyboardTooltipWindow(HWND window_to_destroy) { HideKeyboardTooltip(); } -} // namespace ChromeViews +} // namespace views diff --git a/chrome/views/tooltip_manager.h b/chrome/views/tooltip_manager.h index b48ddeb..5050923 100644 --- a/chrome/views/tooltip_manager.h +++ b/chrome/views/tooltip_manager.h @@ -11,7 +11,7 @@ class ChromeFont; -namespace ChromeViews { +namespace views { class Container; class View; @@ -158,6 +158,6 @@ class TooltipManager { DISALLOW_EVIL_CONSTRUCTORS(TooltipManager); }; -} // namespace ChromeViews +} // namespace views #endif // CHROME_VIEWS_TOOLTIP_MANAGER_H_ diff --git a/chrome/views/tree_node_model.h b/chrome/views/tree_node_model.h index cad02e1..fe0914d 100644 --- a/chrome/views/tree_node_model.h +++ b/chrome/views/tree_node_model.h @@ -11,7 +11,7 @@ #include "chrome/common/scoped_vector.h" #include "chrome/views/tree_view.h" -namespace ChromeViews { +namespace views { // TreeNodeModel and TreeNodes provide an implementation of TreeModel around // TreeNodes. TreeNodes form a directed acyclic graph. @@ -266,7 +266,7 @@ class TreeNodeModel : public TreeModel { DISALLOW_EVIL_CONSTRUCTORS(TreeNodeModel); }; -} // namespace +} // namespace views #endif // CHROME_VIEWS_TREE_NODE_MODEL_H__ diff --git a/chrome/views/tree_view.cc b/chrome/views/tree_view.cc index 2dca467..43f3d24 100644 --- a/chrome/views/tree_view.cc +++ b/chrome/views/tree_view.cc @@ -16,7 +16,7 @@ #include "chrome/views/container.h" #include "chrome/views/focus_manager.h" -namespace ChromeViews { +namespace views { static HIMAGELIST tree_image_list_ = NULL; @@ -590,5 +590,5 @@ LRESULT CALLBACK TreeView::TreeWndProc(HWND window, return CallWindowProc(handler, window, message, w_param, l_param); } -} // namespace ChromeViews +} // namespace views diff --git a/chrome/views/tree_view.h b/chrome/views/tree_view.h index 955e5b5..09d046a3 100644 --- a/chrome/views/tree_view.h +++ b/chrome/views/tree_view.h @@ -11,7 +11,7 @@ #include "base/logging.h" #include "chrome/views/native_control.h" -namespace ChromeViews { +namespace views { class TreeModel; class TreeModelNode; @@ -322,7 +322,7 @@ class TreeView : public NativeControl, public TreeModelObserver { DISALLOW_EVIL_CONSTRUCTORS(TreeView); }; -} // namespace ChromeViews +} // namespace views #endif // CHROME_VIEWS_TREE_VIEW_H__ diff --git a/chrome/views/view.cc b/chrome/views/view.cc index 2dfedd8e..2b6c7cd 100644 --- a/chrome/views/view.cc +++ b/chrome/views/view.cc @@ -28,7 +28,7 @@ #include "chrome/views/tooltip_manager.h" #include "SkShader.h" -namespace ChromeViews { +namespace views { // static char View::kViewClassName[] = "chrome/views/View"; @@ -297,7 +297,7 @@ FocusManager* View::GetFocusManager() { if (!hwnd) return NULL; - return ChromeViews::FocusManager::GetFocusManager(hwnd); + return FocusManager::GetFocusManager(hwnd); } bool View::HasFocus() { diff --git a/chrome/views/view.h b/chrome/views/view.h index 738e8b5..b96e9ca 100644 --- a/chrome/views/view.h +++ b/chrome/views/view.h @@ -27,7 +27,7 @@ class ChromeCanvas; class OSExchangeData; class SkBitmap; -namespace ChromeViews { +namespace views { class Background; class Border; @@ -87,8 +87,8 @@ class DragController { // // View class // -// A View is a rectangle within the ChromeViews View hierarchy. It is the -// base class for all Views. +// A View is a rectangle within the views View hierarchy. It is the base +/// class for all Views. // // A View is a container of other Views (there is no such thing as a Leaf // View - makes code simpler, reduces type conversion headaches, design @@ -320,9 +320,9 @@ class View : public AcceleratorTarget { // // Enabling canvas flipping is useful for leaf views that draw a bitmap that // needs to be flipped horizontally when the UI layout is right-to-left - // (ChromeViews::Button, for example). This method is helpful for such - // classes because their drawing logic stays the same and they can become - // agnostic to the UI directionality. + // (views::Button, for example). This method is helpful for such classes + // because their drawing logic stays the same and they can become agnostic to + // the UI directionality. void EnableCanvasFlippingForRTLUI(bool enable) { flip_canvas_on_paint_for_rtl_ui_ = enable; } @@ -587,7 +587,7 @@ class View : public AcceleratorTarget { // Accessor used to determine if a child view (leaf) has accessibility focus. // Returns NULL if there are no children, or if none of the children has // accessibility focus. - virtual ChromeViews::View* GetAccFocusedChildView() { return NULL; } + virtual View* GetAccFocusedChildView() { return NULL; } // Floating views // @@ -1124,7 +1124,7 @@ class View : public AcceleratorTarget { // Starts a drag and drop operation originating from this view. This invokes // WriteDragData to write the data and GetDragOperations to determine the // supported drag operations. When done, OnDragDone is invoked. - void DoDrag(const ChromeViews::MouseEvent& e, int press_x, int press_y); + void DoDrag(const MouseEvent& e, int press_x, int press_y); // Adds a child View at the specified position. |floating_view| should be true // if the |v| is a floating view. @@ -1301,7 +1301,7 @@ class View : public AcceleratorTarget { DISALLOW_COPY_AND_ASSIGN(View); }; -} // namespace ChromeViews +} // namespace views #endif // CHROME_VIEWS_VIEW_H_ diff --git a/chrome/views/view_menu_delegate.h b/chrome/views/view_menu_delegate.h index 91b010c..6ac2598 100644 --- a/chrome/views/view_menu_delegate.h +++ b/chrome/views/view_menu_delegate.h @@ -7,7 +7,7 @@ #include <windows.h> -namespace ChromeViews { +namespace views { class View; @@ -24,12 +24,10 @@ class ViewMenuDelegate { public: // Create and show a menu at the specified position. Source is the view the // ViewMenuDelegate was set on. - virtual void RunMenu(ChromeViews::View* source, - const CPoint& pt, - HWND hwnd) = 0; + virtual void RunMenu(View* source, const CPoint& pt, HWND hwnd) = 0; }; -} // namespace +} // namespace views #endif // CHROME_VIEWS_VIEW_MENU_DELEGATE_H__ diff --git a/chrome/views/view_storage.cc b/chrome/views/view_storage.cc index 8463b16..f19c5c4 100644 --- a/chrome/views/view_storage.cc +++ b/chrome/views/view_storage.cc @@ -9,7 +9,7 @@ #include "chrome/common/notification_types.h" #include "chrome/common/stl_util-inl.h" -namespace ChromeViews { +namespace views { ViewStorage* ViewStorage::shared_instance_ = NULL; @@ -203,5 +203,5 @@ void ViewStorage::Observe(NotificationType type, EraseView((*ids)[0], true); } -} +} // namespace views diff --git a/chrome/views/view_storage.h b/chrome/views/view_storage.h index 38487c2..b343139 100644 --- a/chrome/views/view_storage.h +++ b/chrome/views/view_storage.h @@ -21,7 +21,7 @@ // To use it, you first need to create a view storage id that can then be used // to store/retrieve views. -namespace ChromeViews { +namespace views { struct ViewLocationInfo; @@ -75,7 +75,7 @@ class ViewStorage : public NotificationObserver { DISALLOW_EVIL_CONSTRUCTORS(ViewStorage); }; -} +} // namespace views #endif // #ifndef CHROME_VIEWS_VIEW_STORAGE_H__ diff --git a/chrome/views/view_unittest.cc b/chrome/views/view_unittest.cc index 9599c34..6d95d35 100644 --- a/chrome/views/view_unittest.cc +++ b/chrome/views/view_unittest.cc @@ -28,7 +28,7 @@ class ViewTest : public testing::Test { }; // Paints the RootView. -void PaintRootView(ChromeViews::RootView* root, bool empty_paint) { +void PaintRootView(views::RootView* root, bool empty_paint) { if (!empty_paint) { root->PaintNow(); } else { @@ -90,7 +90,7 @@ class EmptyWindow : public CWindowImpl<EmptyWindow, */ } -using namespace ChromeViews; +using namespace views; //////////////////////////////////////////////////////////////////////////////// // @@ -283,7 +283,7 @@ TEST_F(ViewTest, MouseEvent) { TestView* v2 = new TestView(); v2->SetBounds (100, 100, 100, 100); - ChromeViews::ContainerWin window; + views::ContainerWin window; window.set_delete_on_destroy(false); window.set_window_style(WS_OVERLAPPEDWINDOW); window.Init(NULL, gfx::Rect(50, 50, 650, 650), false); @@ -357,7 +357,7 @@ TEST_F(ViewTest, Painting) { RDW_UPDATENOW | RDW_INVALIDATE | RDW_ALLCHILDREN); bool empty_paint = paint_window.empty_paint(); - ChromeViews::ContainerWin window; + views::ContainerWin window; window.set_delete_on_destroy(false); window.set_window_style(WS_OVERLAPPEDWINDOW); window.Init(NULL, gfx::Rect(50, 50, 650, 650), NULL); @@ -426,10 +426,10 @@ public: void Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { ASSERT_TRUE(type == NOTIFY_VIEW_REMOVED); - removed_views_.push_back(Source<ChromeViews::View>(source).ptr()); + removed_views_.push_back(Source<views::View>(source).ptr()); } - bool WasRemoved(ChromeViews::View* view) { + bool WasRemoved(views::View* view) { return std::find(removed_views_.begin(), removed_views_.end(), view) != removed_views_.end(); } @@ -444,8 +444,8 @@ TEST_F(ViewTest, RemoveNotification) { NotificationService::current()->AddObserver( observer.get(), NOTIFY_VIEW_REMOVED, NotificationService::AllSources()); - ChromeViews::ContainerWin* window = new ChromeViews::ContainerWin; - ChromeViews::RootView* root_view = window->GetRootView(); + views::ContainerWin* window = new views::ContainerWin; + views::RootView* root_view = window->GetRootView(); View* v1 = new View; root_view->AddChildView(v1); @@ -508,7 +508,7 @@ TEST_F(ViewTest, RemoveNotification) { } namespace { -class HitTestView : public ChromeViews::View { +class HitTestView : public views::View { public: explicit HitTestView(bool has_hittest_mask) : has_hittest_mask_(has_hittest_mask) { @@ -516,7 +516,7 @@ class HitTestView : public ChromeViews::View { virtual ~HitTestView() {} protected: - // Overridden from ChromeViews::View: + // Overridden from views::View: virtual bool HasHitTestMask() const { return has_hittest_mask_; } @@ -540,16 +540,16 @@ class HitTestView : public ChromeViews::View { DISALLOW_COPY_AND_ASSIGN(HitTestView); }; -gfx::Point ConvertPointToView(ChromeViews::View* view, const gfx::Point& p) { +gfx::Point ConvertPointToView(views::View* view, const gfx::Point& p) { gfx::Point tmp(p); - ChromeViews::View::ConvertPointToView(view->GetRootView(), view, &tmp); + views::View::ConvertPointToView(view->GetRootView(), view, &tmp); return tmp; } } TEST_F(ViewTest, HitTestMasks) { - ChromeViews::ContainerWin window; - ChromeViews::RootView* root_view = window.GetRootView(); + views::ContainerWin window; + views::RootView* root_view = window.GetRootView(); root_view->SetBounds(0, 0, 500, 500); gfx::Rect v1_bounds = gfx::Rect(0, 0, 100, 100); diff --git a/chrome/views/window.cc b/chrome/views/window.cc index 6171b3a..b4b71c2 100644 --- a/chrome/views/window.cc +++ b/chrome/views/window.cc @@ -22,7 +22,7 @@ #include "generated_resources.h" -namespace ChromeViews { +namespace views { // static HCURSOR Window::nwse_cursor_ = NULL; @@ -503,7 +503,7 @@ void Window::SetInitialFocus() { if (!focus_on_creation_) return; - ChromeViews::View* v = window_delegate_->GetInitiallyFocusedView(); + View* v = window_delegate_->GetInitiallyFocusedView(); if (v) { v->RequestFocus(); } else { @@ -658,5 +658,5 @@ void Window::InitClass() { } } -} // namespace ChromeViews +} // namespace views diff --git a/chrome/views/window.h b/chrome/views/window.h index cfb0b88..b1379b9 100644 --- a/chrome/views/window.h +++ b/chrome/views/window.h @@ -15,7 +15,7 @@ class Point; class PrefService; -namespace ChromeViews { +namespace views { class ClientView; class Client; @@ -259,7 +259,7 @@ class Window : public ContainerWin { DISALLOW_EVIL_CONSTRUCTORS(Window); }; -} +} // namespace views #endif // CHROME_VIEWS_WINDOW_H__ diff --git a/chrome/views/window_delegate.cc b/chrome/views/window_delegate.cc index c4dd3f6..555c5ec 100644 --- a/chrome/views/window_delegate.cc +++ b/chrome/views/window_delegate.cc @@ -8,7 +8,7 @@ #include "chrome/views/window.h" #include "skia/include/SkBitmap.h" -namespace ChromeViews { +namespace views { WindowDelegate::WindowDelegate() { } @@ -30,5 +30,5 @@ void WindowDelegate::ReleaseWindow() { window_.release(); } -} // namespace ChromeViews +} // namespace views diff --git a/chrome/views/window_delegate.h b/chrome/views/window_delegate.h index 8abda7c..49cf5d0 100644 --- a/chrome/views/window_delegate.h +++ b/chrome/views/window_delegate.h @@ -17,7 +17,7 @@ class CRect; } using WTL::CRect; -namespace ChromeViews { +namespace views { class ClientView; class DialogDelegate; @@ -141,7 +141,7 @@ class WindowDelegate { scoped_ptr<Window> window_; }; -} // namespace ChromeViews +} // namespace views #endif // CHROME_VIEWS_WINDOW_DELEGATE_H_ diff --git a/chrome/views/window_resources.h b/chrome/views/window_resources.h index 30ffe65..9013f2b 100644 --- a/chrome/views/window_resources.h +++ b/chrome/views/window_resources.h @@ -5,9 +5,9 @@ #ifndef CHROME_BROWSER_VIEWS_WINDOW_RESOURCES_H_ #define CHROME_BROWSER_VIEWS_WINDOW_RESOURCES_H_ -#include "SkBitmap.h" +class SkBitmap; -// TODO(beng): (http://crbug.com/2395) Move this file to chrome/views. +namespace views { typedef int FramePartBitmap; @@ -25,4 +25,7 @@ class WindowResources { virtual SkBitmap* GetPartBitmap(FramePartBitmap part) const = 0; }; +} // namespace views + #endif // CHROME_BROWSER_VIEWS_WINDOW_RESOURCES_H_ + |