diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-09 08:32:27 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-09 08:32:27 +0000 |
commit | 707bd37ed8d42c6030cb43c889d343da8d218f90 (patch) | |
tree | 49096d56e7c0306ea616478f1cdfc313116364f9 | |
parent | d9c7755e6c948dcd57cd6777b22b32602741d0ea (diff) | |
download | chromium_src-707bd37ed8d42c6030cb43c889d343da8d218f90.zip chromium_src-707bd37ed8d42c6030cb43c889d343da8d218f90.tar.gz chromium_src-707bd37ed8d42c6030cb43c889d343da8d218f90.tar.bz2 |
views: Convert View::GetClassName() to return const char*.
BUG=235984
R=jamescook@chromium.org,sky@chromium.org
Review URL: https://chromiumcodereview.appspot.com/14676008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199164 0039d316-1c4b-4281-b951-d872f2087c98
111 files changed, 192 insertions, 196 deletions
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc index f7a9ecb..d76ab775 100644 --- a/ash/accelerators/accelerator_controller.cc +++ b/ash/accelerators/accelerator_controller.cc @@ -111,7 +111,7 @@ bool HandleAccessibleFocusCycle(bool reverse) { if (!focus_manager) return false; views::View* view = focus_manager->GetFocusedView(); - if (view->GetClassName() == views::WebView::kViewClassName) + if (!strcmp(view->GetClassName(), views::WebView::kViewClassName)) return false; focus_manager->AdvanceFocus(reverse); diff --git a/ash/system/chromeos/network/tray_network.cc b/ash/system/chromeos/network/tray_network.cc index 911b272..b5731ad 100644 --- a/ash/system/chromeos/network/tray_network.cc +++ b/ash/system/chromeos/network/tray_network.cc @@ -131,7 +131,7 @@ class NetworkTrayView : public TrayItemView, network_icon::NetworkIconAnimation::GetInstance()->RemoveObserver(this); } - virtual std::string GetClassName() const OVERRIDE { + virtual const char* GetClassName() const OVERRIDE { return "NetworkTrayView"; } diff --git a/ash/wm/custom_frame_view_ash.cc b/ash/wm/custom_frame_view_ash.cc index 72c62ee..45cea61 100644 --- a/ash/wm/custom_frame_view_ash.cc +++ b/ash/wm/custom_frame_view_ash.cc @@ -37,7 +37,7 @@ const gfx::Font& GetTitleFont() { namespace ash { // static -const char CustomFrameViewAsh::kViewClassName[] = "ash/wm/CustomFrameViewAsh"; +const char CustomFrameViewAsh::kViewClassName[] = "CustomFrameViewAsh"; //////////////////////////////////////////////////////////////////////////////// // CustomFrameViewAsh, public: @@ -150,7 +150,7 @@ void CustomFrameViewAsh::OnPaint(gfx::Canvas* canvas) { canvas->Restore(); } -std::string CustomFrameViewAsh::GetClassName() const { +const char* CustomFrameViewAsh::GetClassName() const { return kViewClassName; } diff --git a/ash/wm/custom_frame_view_ash.h b/ash/wm/custom_frame_view_ash.h index 5c3f0c3..b6ccf7f 100644 --- a/ash/wm/custom_frame_view_ash.h +++ b/ash/wm/custom_frame_view_ash.h @@ -68,7 +68,7 @@ class ASH_EXPORT CustomFrameViewAsh : public views::NonClientFrameView, // views::View overrides: virtual gfx::Size GetPreferredSize() OVERRIDE; virtual void Layout() OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; virtual gfx::Size GetMinimumSize() OVERRIDE; virtual gfx::Size GetMaximumSize() OVERRIDE; diff --git a/chrome/browser/chromeos/login/webui_login_view.cc b/chrome/browser/chromeos/login/webui_login_view.cc index fc7ba2a..0bc4da2 100644 --- a/chrome/browser/chromeos/login/webui_login_view.cc +++ b/chrome/browser/chromeos/login/webui_login_view.cc @@ -205,7 +205,7 @@ void WebUILoginView::Init(views::Widget* login_window) { content::Source<WebContents>(web_contents)); } -std::string WebUILoginView::GetClassName() const { +const char* WebUILoginView::GetClassName() const { return kViewClassName; } diff --git a/chrome/browser/chromeos/login/webui_login_view.h b/chrome/browser/chromeos/login/webui_login_view.h index 6192d0f..ae991c7 100644 --- a/chrome/browser/chromeos/login/webui_login_view.h +++ b/chrome/browser/chromeos/login/webui_login_view.h @@ -49,7 +49,7 @@ class WebUILoginView : public views::View, // Overridden from views::Views: virtual bool AcceleratorPressed( const ui::Accelerator& accelerator) OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; // Called when WebUI window is created. virtual void OnWindowCreated(); diff --git a/chrome/browser/ui/views/accessibility/accessibility_event_router_views.cc b/chrome/browser/ui/views/accessibility/accessibility_event_router_views.cc index 1137d21..4a9a4cb 100644 --- a/chrome/browser/ui/views/accessibility/accessibility_event_router_views.cc +++ b/chrome/browser/ui/views/accessibility/accessibility_event_router_views.cc @@ -260,12 +260,12 @@ void AccessibilityEventRouterViews::SendMenuItemNotification( int index = -1; int count = -1; - if (view->GetClassName() == views::MenuItemView::kViewClassName) + if (!strcmp(view->GetClassName(), views::MenuItemView::kViewClassName)) has_submenu = static_cast<views::MenuItemView*>(view)->HasSubmenu(); views::View* parent_menu = view->parent(); - while (parent_menu != NULL && parent_menu->GetClassName() != - views::SubmenuView::kViewClassName) { + while (parent_menu != NULL && strcmp(parent_menu->GetClassName(), + views::SubmenuView::kViewClassName)) { parent_menu = parent_menu->parent(); } if (parent_menu) { @@ -464,12 +464,13 @@ void AccessibilityEventRouterViews::RecursiveGetMenuItemIndexAndCount( views::View* child = menu->child_at(i); int previous_count = *count; RecursiveGetMenuItemIndexAndCount(child, item, index, count); - if (child->GetClassName() == views::MenuItemView::kViewClassName && + if (!strcmp(child->GetClassName(), views::MenuItemView::kViewClassName) && *count == previous_count) { if (item == child) *index = *count; (*count)++; - } else if (child->GetClassName() == views::TextButton::kViewClassName) { + } else if (!strcmp(child->GetClassName(), + views::TextButton::kViewClassName)) { if (item == child) *index = *count; (*count)++; diff --git a/chrome/browser/ui/views/autofill/autofill_dialog_views.cc b/chrome/browser/ui/views/autofill/autofill_dialog_views.cc index f6c0716..7428344 100644 --- a/chrome/browser/ui/views/autofill/autofill_dialog_views.cc +++ b/chrome/browser/ui/views/autofill/autofill_dialog_views.cc @@ -307,7 +307,7 @@ void AutofillDialogViews::DecoratedTextfield::SetInvalid(bool invalid) { SchedulePaint(); } -std::string AutofillDialogViews::DecoratedTextfield::GetClassName() const { +const char* AutofillDialogViews::DecoratedTextfield::GetClassName() const { return kDecoratedTextfieldClassName; } @@ -481,7 +481,7 @@ void AutofillDialogViews::NotificationArea::SetNotifications( PreferredSizeChanged(); } -std::string AutofillDialogViews::NotificationArea::GetClassName() const { +const char* AutofillDialogViews::NotificationArea::GetClassName() const { return kNotificationAreaClassName; } diff --git a/chrome/browser/ui/views/autofill/autofill_dialog_views.h b/chrome/browser/ui/views/autofill/autofill_dialog_views.h index 3732425..fba2399 100644 --- a/chrome/browser/ui/views/autofill/autofill_dialog_views.h +++ b/chrome/browser/ui/views/autofill/autofill_dialog_views.h @@ -210,7 +210,7 @@ class AutofillDialogViews : public AutofillDialogView, bool invalid() const { return invalid_; } // views::View implementation. - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE; virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; @@ -276,7 +276,7 @@ class AutofillDialogViews : public AutofillDialogView, void SetNotifications(const std::vector<DialogNotification>& notifications); // views::View implementation. - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; // views::ButtonListener implementation: diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc index dd3e94f..d7a0779 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc @@ -101,8 +101,7 @@ static const int kLeftMargin = 1; static const int kRightMargin = 1; // static -const char BookmarkBarView::kViewClassName[] = - "browser/ui/views/bookmarks/BookmarkBarView"; +const char BookmarkBarView::kViewClassName[] = "BookmarkBarView"; // Padding between buttons. static const int kButtonPadding = 0; @@ -218,7 +217,7 @@ class BookmarkButton : public BookmarkButtonBase { return !tooltip->empty(); } - virtual std::string GetClassName() const OVERRIDE { + virtual const char* GetClassName() const OVERRIDE { return kViewClassName; } @@ -229,9 +228,8 @@ class BookmarkButton : public BookmarkButtonBase { DISALLOW_COPY_AND_ASSIGN(BookmarkButton); }; -// static for BookmarkButton -const char BookmarkButton::kViewClassName[] = - "browser/ui/views/bookmarks/BookmarkButton"; +// static +const char BookmarkButton::kViewClassName[] = "BookmarkButton"; // ShortcutButton ------------------------------------------------------------- @@ -247,7 +245,7 @@ class ShortcutButton : public BookmarkButtonBase { : BookmarkButtonBase(listener, title) { } - virtual std::string GetClassName() const OVERRIDE { + virtual const char* GetClassName() const OVERRIDE { return kViewClassName; } @@ -256,9 +254,8 @@ class ShortcutButton : public BookmarkButtonBase { DISALLOW_COPY_AND_ASSIGN(ShortcutButton); }; -// static for ShortcutButton -const char ShortcutButton::kViewClassName[] = - "browser/ui/views/bookmarks/ShortcutButton"; +// static +const char ShortcutButton::kViewClassName[] = "ShortcutButton"; // BookmarkFolderButton ------------------------------------------------------- @@ -923,7 +920,7 @@ void BookmarkBarView::OnThemeChanged() { UpdateColors(); } -std::string BookmarkBarView::GetClassName() const { +const char* BookmarkBarView::GetClassName() const { return kViewClassName; } diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h index 13dc6c8..8312205 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h +++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.h @@ -182,7 +182,7 @@ class BookmarkBarView : public DetachableToolbarView, virtual void ShowContextMenu(const gfx::Point& p, bool is_mouse_gesture) OVERRIDE; virtual void OnThemeChanged() OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; // AccessiblePaneView: virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; diff --git a/chrome/browser/ui/views/extensions/shell_window_frame_view.cc b/chrome/browser/ui/views/extensions/shell_window_frame_view.cc index 280b968..165691d 100644 --- a/chrome/browser/ui/views/extensions/shell_window_frame_view.cc +++ b/chrome/browser/ui/views/extensions/shell_window_frame_view.cc @@ -321,7 +321,7 @@ void ShellWindowFrameView::OnPaint(gfx::Canvas* canvas) { canvas->DrawPath(path, paint); } -std::string ShellWindowFrameView::GetClassName() const { +const char* ShellWindowFrameView::GetClassName() const { return kViewClassName; } diff --git a/chrome/browser/ui/views/extensions/shell_window_frame_view.h b/chrome/browser/ui/views/extensions/shell_window_frame_view.h index c015482..a244b02 100644 --- a/chrome/browser/ui/views/extensions/shell_window_frame_view.h +++ b/chrome/browser/ui/views/extensions/shell_window_frame_view.h @@ -55,7 +55,7 @@ class ShellWindowFrameView : public views::NonClientFrameView, // views::View implementation. virtual gfx::Size GetPreferredSize() OVERRIDE; virtual void Layout() OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; virtual gfx::Size GetMinimumSize() OVERRIDE; virtual gfx::Size GetMaximumSize() OVERRIDE; diff --git a/chrome/browser/ui/views/frame/app_non_client_frame_view_ash.cc b/chrome/browser/ui/views/frame/app_non_client_frame_view_ash.cc index 5fd7b93..10f5c07 100644 --- a/chrome/browser/ui/views/frame/app_non_client_frame_view_ash.cc +++ b/chrome/browser/ui/views/frame/app_non_client_frame_view_ash.cc @@ -278,7 +278,7 @@ int AppNonClientFrameViewAsh::GetThemeBackgroundXInset() const { void AppNonClientFrameViewAsh::UpdateThrobber(bool running) { } -std::string AppNonClientFrameViewAsh::GetClassName() const { +const char* AppNonClientFrameViewAsh::GetClassName() const { return kViewClassName; } diff --git a/chrome/browser/ui/views/frame/app_non_client_frame_view_ash.h b/chrome/browser/ui/views/frame/app_non_client_frame_view_ash.h index e238a19..2d8ac3e 100644 --- a/chrome/browser/ui/views/frame/app_non_client_frame_view_ash.h +++ b/chrome/browser/ui/views/frame/app_non_client_frame_view_ash.h @@ -41,8 +41,8 @@ class AppNonClientFrameViewAsh : public BrowserNonClientFrameView { virtual int GetThemeBackgroundXInset() const OVERRIDE; virtual void UpdateThrobber(bool running) OVERRIDE; - // View: - virtual std::string GetClassName() const OVERRIDE; + // views::View: + virtual const char* GetClassName() const OVERRIDE; virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; private: diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc index 7955e18..27e18af 100644 --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc @@ -242,7 +242,7 @@ void BrowserNonClientFrameViewAsh::Layout() { BrowserNonClientFrameView::Layout(); } -std::string BrowserNonClientFrameViewAsh::GetClassName() const { +const char* BrowserNonClientFrameViewAsh::GetClassName() const { return kViewClassName; } diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h index 4fa5871..140a7c7 100644 --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h @@ -53,7 +53,7 @@ class BrowserNonClientFrameViewAsh // views::View overrides: virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; virtual void Layout() OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE; virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; virtual gfx::Size GetMinimumSize() OVERRIDE; diff --git a/chrome/browser/ui/views/frame/browser_root_view.cc b/chrome/browser/ui/views/frame/browser_root_view.cc index d36b384..7a0ffd4 100644 --- a/chrome/browser/ui/views/frame/browser_root_view.cc +++ b/chrome/browser/ui/views/frame/browser_root_view.cc @@ -118,7 +118,7 @@ int BrowserRootView::OnPerformDrop(const ui::DropTargetEvent& event) { return tabstrip()->OnPerformDrop(*mapped_event); } -std::string BrowserRootView::GetClassName() const { +const char* BrowserRootView::GetClassName() const { return kViewClassName; } diff --git a/chrome/browser/ui/views/frame/browser_root_view.h b/chrome/browser/ui/views/frame/browser_root_view.h index dbd3d77..b1696a9 100644 --- a/chrome/browser/ui/views/frame/browser_root_view.h +++ b/chrome/browser/ui/views/frame/browser_root_view.h @@ -37,7 +37,7 @@ class BrowserRootView : public views::internal::RootView { virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE; virtual void OnDragExited() OVERRIDE; virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual void SchedulePaintInRect(const gfx::Rect& rect) OVERRIDE; private: diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index ebe1f38..0e969a3 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc @@ -227,8 +227,8 @@ void PaintAttachedBookmarkBar(gfx::Canvas* canvas, } // namespace -// Returned from BrowserView::GetClassName. -const char BrowserView::kViewClassName[] = "browser/ui/views/BrowserView"; +// static +const char BrowserView::kViewClassName[] = "BrowserView"; namespace { @@ -1807,7 +1807,7 @@ gfx::Size BrowserView::GetMinimumSize() { /////////////////////////////////////////////////////////////////////////////// // BrowserView, views::View overrides: -std::string BrowserView::GetClassName() const { +const char* BrowserView::GetClassName() const { return kViewClassName; } @@ -2584,8 +2584,8 @@ void BrowserView::DoCutCopyPaste(void (content::RenderWidgetHost::*method)(), views::FocusManager* focus_manager = GetFocusManager(); views::View* focused = focus_manager->GetFocusedView(); if (focused && - (focused->GetClassName() == views::Textfield::kViewClassName || - focused->GetClassName() == OmniboxViewViews::kViewClassName)) { + (!strcmp(focused->GetClassName(), views::Textfield::kViewClassName) || + !strcmp(focused->GetClassName(), OmniboxViewViews::kViewClassName))) { views::Textfield* textfield = static_cast<views::Textfield*>(focused); textfield->ExecuteCommand(command_id); return; diff --git a/chrome/browser/ui/views/frame/browser_view.h b/chrome/browser/ui/views/frame/browser_view.h index 4744a17..4e5217d 100644 --- a/chrome/browser/ui/views/frame/browser_view.h +++ b/chrome/browser/ui/views/frame/browser_view.h @@ -433,7 +433,7 @@ class BrowserView : public BrowserWindow, virtual void OnSysColorChange() OVERRIDE; // Overridden from views::View: - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual void Layout() OVERRIDE; virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE; virtual void ViewHierarchyChanged(bool is_add, diff --git a/chrome/browser/ui/views/frame/contents_container.cc b/chrome/browser/ui/views/frame/contents_container.cc index ef10ea1..788783b 100644 --- a/chrome/browser/ui/views/frame/contents_container.cc +++ b/chrome/browser/ui/views/frame/contents_container.cc @@ -14,8 +14,7 @@ #include "ui/gfx/image/image_skia.h" // static -const char ContentsContainer::kViewClassName[] = - "browser/ui/views/frame/ContentsContainer"; +const char ContentsContainer::kViewClassName[] = "ContentsContainer"; namespace { @@ -303,7 +302,7 @@ void ContentsContainer::Layout() { views::View::Layout(); } -std::string ContentsContainer::GetClassName() const { +const char* ContentsContainer::GetClassName() const { return kViewClassName; } diff --git a/chrome/browser/ui/views/frame/contents_container.h b/chrome/browser/ui/views/frame/contents_container.h index 3b3ee90..f25f380 100644 --- a/chrome/browser/ui/views/frame/contents_container.h +++ b/chrome/browser/ui/views/frame/contents_container.h @@ -83,7 +83,7 @@ class ContentsContainer : public views::View, // Overridden from views::View: virtual void Layout() OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; // Testing interface: views::WebView* GetActiveWebViewForTest() { return active_; } diff --git a/chrome/browser/ui/views/frame/top_container_view.cc b/chrome/browser/ui/views/frame/top_container_view.cc index 86e865d..10d3c59f 100644 --- a/chrome/browser/ui/views/frame/top_container_view.cc +++ b/chrome/browser/ui/views/frame/top_container_view.cc @@ -46,7 +46,7 @@ gfx::Size TopContainerView::GetPreferredSize() { return gfx::Size(browser_view_->width(), height); } -std::string TopContainerView::GetClassName() const { +const char* TopContainerView::GetClassName() const { return "TopContainerView"; } diff --git a/chrome/browser/ui/views/frame/top_container_view.h b/chrome/browser/ui/views/frame/top_container_view.h index 6d7bc49..4da9619 100644 --- a/chrome/browser/ui/views/frame/top_container_view.h +++ b/chrome/browser/ui/views/frame/top_container_view.h @@ -28,7 +28,7 @@ class TopContainerView : public views::View { // views::View overrides: virtual gfx::Size GetPreferredSize() OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual void OnBoundsChanged(const gfx::Rect& bounds) OVERRIDE; virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE; diff --git a/chrome/browser/ui/views/infobars/infobar_container_view.cc b/chrome/browser/ui/views/infobars/infobar_container_view.cc index d277514..8bc5752 100644 --- a/chrome/browser/ui/views/infobars/infobar_container_view.cc +++ b/chrome/browser/ui/views/infobars/infobar_container_view.cc @@ -32,7 +32,7 @@ gfx::Size InfoBarContainerView::GetPreferredSize() { return gfx::Size(0, total_height); } -std::string InfoBarContainerView::GetClassName() const { +const char* InfoBarContainerView::GetClassName() const { return kViewClassName; } diff --git a/chrome/browser/ui/views/infobars/infobar_container_view.h b/chrome/browser/ui/views/infobars/infobar_container_view.h index e7c1724..6efda9a 100644 --- a/chrome/browser/ui/views/infobars/infobar_container_view.h +++ b/chrome/browser/ui/views/infobars/infobar_container_view.h @@ -21,7 +21,7 @@ class InfoBarContainerView : public views::AccessiblePaneView, private: // AccessiblePaneView: virtual gfx::Size GetPreferredSize() OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual void Layout() OVERRIDE; virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc index ae24a6d..678318d 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc @@ -130,8 +130,7 @@ const int LocationBarView::kNormalHorizontalEdgeThickness = 2; const int LocationBarView::kVerticalEdgeThickness = 3; const int LocationBarView::kIconInternalPadding = 2; const int LocationBarView::kBubbleHorizontalPadding = 1; -const char LocationBarView::kViewClassName[] = - "browser/ui/views/location_bar/LocationBarView"; +const char LocationBarView::kViewClassName[] = "LocationBarView"; static const int kCSBubbleBackgroundImages[] = { IDR_OMNIBOX_CS_BUBBLE_BACKGROUND_L, @@ -1245,7 +1244,7 @@ void LocationBarView::PaintPageActionBackgrounds(gfx::Canvas* canvas) { } } -std::string LocationBarView::GetClassName() const { +const char* LocationBarView::GetClassName() const { return kViewClassName; } diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.h b/chrome/browser/ui/views/location_bar/location_bar_view.h index 3a54890..ce1d0f9 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_view.h +++ b/chrome/browser/ui/views/location_bar/location_bar_view.h @@ -269,7 +269,7 @@ class LocationBarView : public LocationBar, virtual content::WebContents* GetWebContents() const OVERRIDE; // Overridden from views::View: - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual bool SkipDefaultKeyEventProcessing( const ui::KeyEvent& event) OVERRIDE; virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc index 68e5cdf..d8c40a1 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc @@ -112,7 +112,7 @@ void DoCopyURL(const GURL& url, const string16& text, Profile* profile) { } // namespace // static -const char OmniboxViewViews::kViewClassName[] = "BrowserOmniboxViewViews"; +const char OmniboxViewViews::kViewClassName[] = "OmniboxViewViews"; OmniboxViewViews::OmniboxViewViews(OmniboxEditController* controller, ToolbarModel* toolbar_model, @@ -185,7 +185,7 @@ gfx::Font OmniboxViewViews::GetFont() { //////////////////////////////////////////////////////////////////////////////// // OmniboxViewViews, views::Textfield implementation: -std::string OmniboxViewViews::GetClassName() const { +const char* OmniboxViewViews::GetClassName() const { return kViewClassName; } diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.h b/chrome/browser/ui/views/omnibox/omnibox_view_views.h index 90f5bf7..39277a6 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_view_views.h +++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.h @@ -56,7 +56,7 @@ class OmniboxViewViews void SetBaseColor(); // views::Textfield: - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; diff --git a/chrome/browser/ui/views/panels/panel_frame_view.cc b/chrome/browser/ui/views/panels/panel_frame_view.cc index 8a8d2ed..5359e72 100644 --- a/chrome/browser/ui/views/panels/panel_frame_view.cc +++ b/chrome/browser/ui/views/panels/panel_frame_view.cc @@ -247,8 +247,8 @@ bool ShouldRenderAsFrameless() { } // namespace -const char PanelFrameView::kViewClassName[] = - "browser/ui/panels/PanelFrameView"; +// static +const char PanelFrameView::kViewClassName[] = "PanelFrameView"; PanelFrameView::PanelFrameView(PanelView* panel_view) : is_frameless_(ShouldRenderAsFrameless()), @@ -507,7 +507,7 @@ gfx::Size PanelFrameView::GetPreferredSize() { GetWindowBoundsForClientBounds(bounds).size(); } -std::string PanelFrameView::GetClassName() const { +const char* PanelFrameView::GetClassName() const { return kViewClassName; } diff --git a/chrome/browser/ui/views/panels/panel_frame_view.h b/chrome/browser/ui/views/panels/panel_frame_view.h index 51d412f..e8a90ad 100644 --- a/chrome/browser/ui/views/panels/panel_frame_view.h +++ b/chrome/browser/ui/views/panels/panel_frame_view.h @@ -68,7 +68,7 @@ class PanelFrameView : public views::NonClientFrameView, // Overridden from views::View: virtual gfx::Size GetPreferredSize() OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual gfx::Size GetMinimumSize() OVERRIDE; virtual gfx::Size GetMaximumSize() OVERRIDE; virtual void Layout() OVERRIDE; diff --git a/chrome/browser/ui/views/reload_button.cc b/chrome/browser/ui/views/reload_button.cc index de89722..6bc696c 100644 --- a/chrome/browser/ui/views/reload_button.cc +++ b/chrome/browser/ui/views/reload_button.cc @@ -20,7 +20,7 @@ #include "ui/views/widget/widget.h" // static -const char ReloadButton::kViewClassName[] = "browser/ui/views/ReloadButton"; +const char ReloadButton::kViewClassName[] = "ReloadButton"; const int kReloadImages[] = { IDR_RELOAD, IDR_RELOAD_H, IDR_RELOAD_P, IDR_RELOAD_D }; @@ -162,7 +162,7 @@ bool ReloadButton::GetTooltipText(const gfx::Point& p, return true; } -std::string ReloadButton::GetClassName() const { +const char* ReloadButton::GetClassName() const { return kViewClassName; } diff --git a/chrome/browser/ui/views/reload_button.h b/chrome/browser/ui/views/reload_button.h index 9c04841..9c463ed 100644 --- a/chrome/browser/ui/views/reload_button.h +++ b/chrome/browser/ui/views/reload_button.h @@ -55,7 +55,7 @@ class ReloadButton : public views::ButtonDropDown, virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; virtual bool GetTooltipText(const gfx::Point& p, string16* tooltip) const OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; // Overridden from views::ButtonDropDown: virtual bool ShouldShowMenu() OVERRIDE; diff --git a/chrome/browser/ui/views/tabs/tab.cc b/chrome/browser/ui/views/tabs/tab.cc index 43d3073..fcf8537 100644 --- a/chrome/browser/ui/views/tabs/tab.cc +++ b/chrome/browser/ui/views/tabs/tab.cc @@ -432,7 +432,8 @@ Tab::ImageCacheEntry::~ImageCacheEntry() {} // Tab, statics: // static -const char Tab::kViewClassName[] = "BrowserTab"; +const char Tab::kViewClassName[] = "Tab"; + // static Tab::TabImage Tab::tab_alpha_ = {0}; Tab::TabImage Tab::tab_active_ = {0}; @@ -866,7 +867,7 @@ void Tab::OnThemeChanged() { LoadTabImages(); } -std::string Tab::GetClassName() const { +const char* Tab::GetClassName() const { return kViewClassName; } diff --git a/chrome/browser/ui/views/tabs/tab.h b/chrome/browser/ui/views/tabs/tab.h index 3094154..28cfcc9 100644 --- a/chrome/browser/ui/views/tabs/tab.h +++ b/chrome/browser/ui/views/tabs/tab.h @@ -167,7 +167,7 @@ class Tab : public TabAudioIndicator::Delegate, virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; virtual void Layout() OVERRIDE; virtual void OnThemeChanged() OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual bool HasHitTestMask() const OVERRIDE; virtual void GetHitTestMask(gfx::Path* path) const OVERRIDE; virtual bool GetTooltipText(const gfx::Point& p, diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc index 4e4a7a4..59524de 100644 --- a/chrome/browser/ui/views/tabs/tab_strip.cc +++ b/chrome/browser/ui/views/tabs/tab_strip.cc @@ -1338,7 +1338,7 @@ void TabStrip::PaintChildren(gfx::Canvas* canvas) { active_tab->Paint(canvas); } -std::string TabStrip::GetClassName() const { +const char* TabStrip::GetClassName() const { return kViewClassName; } @@ -1406,7 +1406,7 @@ views::View* TabStrip::GetEventHandlerForPoint(const gfx::Point& point) { // Return any view that isn't a Tab or this TabStrip immediately. We don't // want to interfere. views::View* v = View::GetEventHandlerForPoint(point); - if (v && v != this && v->GetClassName() != Tab::kViewClassName) + if (v && v != this && strcmp(v->GetClassName(), Tab::kViewClassName)) return v; views::View* tab = FindTabHitByPoint(point); @@ -1434,7 +1434,7 @@ views::View* TabStrip::GetTooltipHandlerForPoint(const gfx::Point& point) { // Return any view that isn't a Tab or this TabStrip immediately. We don't // want to interfere. views::View* v = View::GetTooltipHandlerForPoint(point); - if (v && v != this && v->GetClassName() != Tab::kViewClassName) + if (v && v != this && strcmp(v->GetClassName(), Tab::kViewClassName)) return v; views::View* tab = FindTabHitByPoint(point); diff --git a/chrome/browser/ui/views/tabs/tab_strip.h b/chrome/browser/ui/views/tabs/tab_strip.h index 727bcc4..49f68e8 100644 --- a/chrome/browser/ui/views/tabs/tab_strip.h +++ b/chrome/browser/ui/views/tabs/tab_strip.h @@ -211,7 +211,7 @@ class TabStrip : public views::View, // views::View overrides: virtual void Layout() OVERRIDE; virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual gfx::Size GetPreferredSize() OVERRIDE; // NOTE: the drag and drop methods are invoked from FrameView. This is done // to allow for a drop region that extends outside the bounds of the TabStrip. diff --git a/chrome/browser/ui/views/tabs/tab_strip_unittest.cc b/chrome/browser/ui/views/tabs/tab_strip_unittest.cc index 572e683..a75a51f 100644 --- a/chrome/browser/ui/views/tabs/tab_strip_unittest.cc +++ b/chrome/browser/ui/views/tabs/tab_strip_unittest.cc @@ -18,7 +18,7 @@ namespace { // found tab view, on NULL if none is found. views::View* FindTabView(views::View* view) { views::View* current = view; - while (current && current->GetClassName() != Tab::kViewClassName) { + while (current && strcmp(current->GetClassName(), Tab::kViewClassName)) { current = current->parent(); } return current; diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc index 22f8257..cd0c49d 100644 --- a/chrome/browser/ui/views/toolbar_view.cc +++ b/chrome/browser/ui/views/toolbar_view.cc @@ -141,7 +141,8 @@ int button_spacing() { } // namespace // static -const char ToolbarView::kViewClassName[] = "browser/ui/views/ToolbarView"; +const char ToolbarView::kViewClassName[] = "ToolbarView"; + // The space between items is 3 px in general. const int ToolbarView::kStandardSpacing = 3; // The top of the toolbar has an edge we have to skip over in addition to the @@ -672,7 +673,7 @@ void ToolbarView::OnThemeChanged() { LoadImages(); } -std::string ToolbarView::GetClassName() const { +const char* ToolbarView::GetClassName() const { return kViewClassName; } diff --git a/chrome/browser/ui/views/toolbar_view.h b/chrome/browser/ui/views/toolbar_view.h index bebc4cf..6af7c97 100644 --- a/chrome/browser/ui/views/toolbar_view.h +++ b/chrome/browser/ui/views/toolbar_view.h @@ -135,7 +135,7 @@ class ToolbarView : public views::AccessiblePaneView, virtual int OnDragUpdated(const ui::DropTargetEvent& event) OVERRIDE; virtual int OnPerformDrop(const ui::DropTargetEvent& event) OVERRIDE; virtual void OnThemeChanged() OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual bool AcceleratorPressed(const ui::Accelerator& acc) OVERRIDE; // Whether the wrench/hotdogs menu is currently showing. diff --git a/chrome/browser/ui/views/wrench_menu.cc b/chrome/browser/ui/views/wrench_menu.cc index 3c1054c..ab0a7e4 100644 --- a/chrome/browser/ui/views/wrench_menu.cc +++ b/chrome/browser/ui/views/wrench_menu.cc @@ -167,7 +167,7 @@ class MenuButtonBackground : public views::Background { // Overridden from views::Background. virtual void Paint(gfx::Canvas* canvas, View* view) const OVERRIDE { CustomButton::ButtonState state = - (view->GetClassName() == views::Label::kViewClassName) ? + (!strcmp(view->GetClassName(), views::Label::kViewClassName)) ? CustomButton::STATE_NORMAL : static_cast<CustomButton*>(view)->state(); int w = view->width(); int h = view->height(); diff --git a/ui/app_list/views/app_list_item_view.cc b/ui/app_list/views/app_list_item_view.cc index 6af92da..90892ba 100644 --- a/ui/app_list/views/app_list_item_view.cc +++ b/ui/app_list/views/app_list_item_view.cc @@ -199,7 +199,7 @@ void AppListItemView::ItemPercentDownloadedChanged() { SchedulePaint(); } -std::string AppListItemView::GetClassName() const { +const char* AppListItemView::GetClassName() const { return kViewClassName; } diff --git a/ui/app_list/views/app_list_item_view.h b/ui/app_list/views/app_list_item_view.h index 85248b9..1e11bdeb 100644 --- a/ui/app_list/views/app_list_item_view.h +++ b/ui/app_list/views/app_list_item_view.h @@ -71,7 +71,7 @@ class APP_LIST_EXPORT AppListItemView : public views::CustomButton, virtual void ItemPercentDownloadedChanged() OVERRIDE; // views::View overrides: - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual void Layout() OVERRIDE; virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; diff --git a/ui/app_list/views/apps_grid_view.cc b/ui/app_list/views/apps_grid_view.cc index 21719da..6c48d44 100644 --- a/ui/app_list/views/apps_grid_view.cc +++ b/ui/app_list/views/apps_grid_view.cc @@ -774,7 +774,7 @@ void AppsGridView::ButtonPressed(views::Button* sender, if (dragging()) return; - if (sender->GetClassName() != AppListItemView::kViewClassName) + if (strcmp(sender->GetClassName(), AppListItemView::kViewClassName)) return; if (delegate_) { diff --git a/ui/app_list/views/search_result_view.cc b/ui/app_list/views/search_result_view.cc index d0227f5..63bff78 100644 --- a/ui/app_list/views/search_result_view.cc +++ b/ui/app_list/views/search_result_view.cc @@ -139,7 +139,7 @@ void SearchResultView::UpdateDetailsText() { } } -std::string SearchResultView::GetClassName() const { +const char* SearchResultView::GetClassName() const { return kViewClassName; } diff --git a/ui/app_list/views/search_result_view.h b/ui/app_list/views/search_result_view.h index 1c0422a..232a08c 100644 --- a/ui/app_list/views/search_result_view.h +++ b/ui/app_list/views/search_result_view.h @@ -52,7 +52,7 @@ class SearchResultView : public views::CustomButton, void UpdateDetailsText(); // views::View overrides: - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual gfx::Size GetPreferredSize() OVERRIDE; virtual void Layout() OVERRIDE; virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; diff --git a/ui/views/accessibility/native_view_accessibility_win.cc b/ui/views/accessibility/native_view_accessibility_win.cc index 865215f..860ae29 100644 --- a/ui/views/accessibility/native_view_accessibility_win.cc +++ b/ui/views/accessibility/native_view_accessibility_win.cc @@ -1174,7 +1174,7 @@ void NativeViewAccessibilityWin::SetState( msaa_state->lVal |= STATE_SYSTEM_UNAVAILABLE; if (!view->visible()) msaa_state->lVal |= STATE_SYSTEM_INVISIBLE; - if (view->GetClassName() == CustomButton::kViewClassName) { + if (!strcmp(view->GetClassName(), CustomButton::kViewClassName)) { CustomButton* button = static_cast<CustomButton*>(view); if (button->IsHotTracked()) msaa_state->lVal |= STATE_SYSTEM_HOTTRACKED; diff --git a/ui/views/bubble/bubble_frame_view.cc b/ui/views/bubble/bubble_frame_view.cc index f6850e7..e6375dc 100644 --- a/ui/views/bubble/bubble_frame_view.cc +++ b/ui/views/bubble/bubble_frame_view.cc @@ -159,8 +159,8 @@ void BubbleFrameView::Layout() { } } -std::string BubbleFrameView::GetClassName() const { - return "ui/views/bubble/BubbleFrameView"; +const char* BubbleFrameView::GetClassName() const { + return "BubbleFrameView"; } void BubbleFrameView::ChildPreferredSizeChanged(View* child) { diff --git a/ui/views/bubble/bubble_frame_view.h b/ui/views/bubble/bubble_frame_view.h index 20d82d9..a52a522 100644 --- a/ui/views/bubble/bubble_frame_view.h +++ b/ui/views/bubble/bubble_frame_view.h @@ -40,7 +40,7 @@ class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView, virtual gfx::Insets GetInsets() const OVERRIDE; virtual gfx::Size GetPreferredSize() OVERRIDE; virtual void Layout() OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual void ChildPreferredSizeChanged(View* child) OVERRIDE; // Overridden from ButtonListener: diff --git a/ui/views/controls/button/button_dropdown.cc b/ui/views/controls/button/button_dropdown.cc index 5cb3b20..cfab435 100644 --- a/ui/views/controls/button/button_dropdown.cc +++ b/ui/views/controls/button/button_dropdown.cc @@ -102,7 +102,7 @@ void ButtonDropDown::OnMouseReleased(const ui::MouseEvent& event) { show_menu_factory_.InvalidateWeakPtrs(); } -std::string ButtonDropDown::GetClassName() const { +const char* ButtonDropDown::GetClassName() const { return kViewClassName; } diff --git a/ui/views/controls/button/button_dropdown.h b/ui/views/controls/button/button_dropdown.h index 1fe1c02..2842b04 100644 --- a/ui/views/controls/button/button_dropdown.h +++ b/ui/views/controls/button/button_dropdown.h @@ -45,7 +45,7 @@ class VIEWS_EXPORT ButtonDropDown : public ImageButton, virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; // Showing the drop down results in a MouseCaptureLost, we need to ignore it. virtual void OnMouseCaptureLost() OVERRIDE {} virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; diff --git a/ui/views/controls/button/checkbox.cc b/ui/views/controls/button/checkbox.cc index 2981d5b..0bf11ae 100644 --- a/ui/views/controls/button/checkbox.cc +++ b/ui/views/controls/button/checkbox.cc @@ -75,7 +75,7 @@ gfx::Size Checkbox::GetPreferredSize() { return prefsize; } -std::string Checkbox::GetClassName() const { +const char* Checkbox::GetClassName() const { return kViewClassName; } diff --git a/ui/views/controls/button/checkbox.h b/ui/views/controls/button/checkbox.h index 0d48ced..3c73930 100644 --- a/ui/views/controls/button/checkbox.h +++ b/ui/views/controls/button/checkbox.h @@ -64,7 +64,7 @@ class VIEWS_EXPORT Checkbox : public TextButtonBase { protected: // Overridden from View: virtual gfx::Size GetPreferredSize() OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; virtual void OnPaintFocusBorder(gfx::Canvas* canvas) OVERRIDE; diff --git a/ui/views/controls/button/custom_button.cc b/ui/views/controls/button/custom_button.cc index bd5124c..65e367b 100644 --- a/ui/views/controls/button/custom_button.cc +++ b/ui/views/controls/button/custom_button.cc @@ -105,7 +105,7 @@ void CustomButton::OnEnabledChanged() { SetState(STATE_DISABLED); } -std::string CustomButton::GetClassName() const { +const char* CustomButton::GetClassName() const { return kViewClassName; } diff --git a/ui/views/controls/button/custom_button.h b/ui/views/controls/button/custom_button.h index 708c268..023d2fd 100644 --- a/ui/views/controls/button/custom_button.h +++ b/ui/views/controls/button/custom_button.h @@ -71,7 +71,7 @@ class VIEWS_EXPORT CustomButton : public Button, // Overridden from View: virtual void OnEnabledChanged() OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; diff --git a/ui/views/controls/button/label_button.cc b/ui/views/controls/button/label_button.cc index 7587156..2167c1a 100644 --- a/ui/views/controls/button/label_button.cc +++ b/ui/views/controls/button/label_button.cc @@ -194,7 +194,7 @@ gfx::Size LabelButton::GetPreferredSize() { return size; } -std::string LabelButton::GetClassName() const { +const char* LabelButton::GetClassName() const { return kViewClassName; } diff --git a/ui/views/controls/button/label_button.h b/ui/views/controls/button/label_button.h index 6e98f7c..b96c785 100644 --- a/ui/views/controls/button/label_button.h +++ b/ui/views/controls/button/label_button.h @@ -64,7 +64,7 @@ class VIEWS_EXPORT LabelButton : public CustomButton, // Overridden from View: virtual gfx::Size GetPreferredSize() OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; private: FRIEND_TEST_ALL_PREFIXES(LabelButtonTest, Init); diff --git a/ui/views/controls/button/label_button_border.cc b/ui/views/controls/button/label_button_border.cc index 76d7283..f1e9e2c 100644 --- a/ui/views/controls/button/label_button_border.cc +++ b/ui/views/controls/button/label_button_border.cc @@ -93,7 +93,7 @@ LabelButtonBorder::LabelButtonBorder(Button::ButtonStyle style) LabelButtonBorder::~LabelButtonBorder() {} void LabelButtonBorder::Paint(const View& view, gfx::Canvas* canvas) { - DCHECK(view.GetClassName() == LabelButton::kViewClassName); + DCHECK(!strcmp(view.GetClassName(), LabelButton::kViewClassName)); const NativeThemeDelegate* native_theme_delegate = static_cast<const LabelButton*>(&view); ui::NativeTheme::Part part = native_theme_delegate->GetThemePart(); diff --git a/ui/views/controls/button/menu_button.cc b/ui/views/controls/button/menu_button.cc index 1f0bfb9..115445f 100644 --- a/ui/views/controls/button/menu_button.cc +++ b/ui/views/controls/button/menu_button.cc @@ -172,7 +172,7 @@ gfx::Size MenuButton::GetPreferredSize() { return prefsize; } -std::string MenuButton::GetClassName() const { +const char* MenuButton::GetClassName() const { return kViewClassName; } diff --git a/ui/views/controls/button/menu_button.h b/ui/views/controls/button/menu_button.h index 676c0268..6350de9 100644 --- a/ui/views/controls/button/menu_button.h +++ b/ui/views/controls/button/menu_button.h @@ -56,7 +56,7 @@ class VIEWS_EXPORT MenuButton : public TextButton { // Overridden from View: virtual gfx::Size GetPreferredSize() OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; diff --git a/ui/views/controls/button/radio_button.cc b/ui/views/controls/button/radio_button.cc index f1018a7..7f7aa1e 100644 --- a/ui/views/controls/button/radio_button.cc +++ b/ui/views/controls/button/radio_button.cc @@ -37,7 +37,7 @@ void RadioButton::SetChecked(bool checked) { container->GetViewsInGroup(GetGroup(), &other); for (Views::iterator i(other.begin()); i != other.end(); ++i) { if (*i != this) { - if ((*i)->GetClassName() != kViewClassName) { + if (strcmp((*i)->GetClassName(), kViewClassName)) { NOTREACHED() << "radio-button-nt has same group as other non " "radio-button-nt views."; continue; @@ -51,7 +51,7 @@ void RadioButton::SetChecked(bool checked) { Checkbox::SetChecked(checked); } -std::string RadioButton::GetClassName() const { +const char* RadioButton::GetClassName() const { return kViewClassName; } diff --git a/ui/views/controls/button/radio_button.h b/ui/views/controls/button/radio_button.h index 1101b2d..d6f08ac 100644 --- a/ui/views/controls/button/radio_button.h +++ b/ui/views/controls/button/radio_button.h @@ -21,7 +21,7 @@ class VIEWS_EXPORT RadioButton : public Checkbox { virtual ~RadioButton(); // Overridden from View: - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; virtual View* GetSelectedViewForGroup(int group) OVERRIDE; virtual bool IsGroupFocusTraversable() const OVERRIDE; diff --git a/ui/views/controls/button/text_button.cc b/ui/views/controls/button/text_button.cc index fa250ab..cfaca78 100644 --- a/ui/views/controls/button/text_button.cc +++ b/ui/views/controls/button/text_button.cc @@ -517,7 +517,7 @@ void TextButtonBase::OnEnabledChanged() { CustomButton::OnEnabledChanged(); } -std::string TextButtonBase::GetClassName() const { +const char* TextButtonBase::GetClassName() const { return kViewClassName; } @@ -693,7 +693,7 @@ void TextButton::set_ignore_minimum_size(bool ignore_minimum_size) { ignore_minimum_size_ = ignore_minimum_size; } -std::string TextButton::GetClassName() const { +const char* TextButton::GetClassName() const { return kViewClassName; } @@ -771,7 +771,7 @@ gfx::Size NativeTextButton::GetMinimumSize() { return GetPreferredSize(); } -std::string NativeTextButton::GetClassName() const { +const char* NativeTextButton::GetClassName() const { return kViewClassName; } diff --git a/ui/views/controls/button/text_button.h b/ui/views/controls/button/text_button.h index 6d604fd..07a98d3 100644 --- a/ui/views/controls/button/text_button.h +++ b/ui/views/controls/button/text_button.h @@ -197,7 +197,7 @@ class VIEWS_EXPORT TextButtonBase : public CustomButton, virtual void OnEnabledChanged() OVERRIDE; virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) OVERRIDE; protected: @@ -357,7 +357,7 @@ class VIEWS_EXPORT TextButton : public TextButtonBase { // Overridden from View: virtual gfx::Size GetPreferredSize() OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; // Overridden from TextButtonBase: virtual void PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) OVERRIDE; @@ -418,7 +418,7 @@ class VIEWS_EXPORT NativeTextButton : public TextButton { // Overridden from TextButton: virtual gfx::Size GetMinimumSize() OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) OVERRIDE; private: diff --git a/ui/views/controls/combobox/combobox.cc b/ui/views/controls/combobox/combobox.cc index 78d2105..1446d3c 100644 --- a/ui/views/controls/combobox/combobox.cc +++ b/ui/views/controls/combobox/combobox.cc @@ -155,7 +155,7 @@ void Combobox::ViewHierarchyChanged(bool is_add, View* parent, View* child) { } } -std::string Combobox::GetClassName() const { +const char* Combobox::GetClassName() const { return kViewClassName; } diff --git a/ui/views/controls/combobox/combobox.h b/ui/views/controls/combobox/combobox.h index 03eb2b6..2b0404f 100644 --- a/ui/views/controls/combobox/combobox.h +++ b/ui/views/controls/combobox/combobox.h @@ -88,7 +88,7 @@ class VIEWS_EXPORT Combobox : public View { virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child) OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; // The object that actually implements the native combobox. NativeComboboxWrapper* native_wrapper_; diff --git a/ui/views/controls/label.cc b/ui/views/controls/label.cc index c6044cd..bc0a8f6 100644 --- a/ui/views/controls/label.cc +++ b/ui/views/controls/label.cc @@ -242,7 +242,7 @@ int Label::GetHeightForWidth(int w) { return h + GetInsets().height(); } -std::string Label::GetClassName() const { +const char* Label::GetClassName() const { return kViewClassName; } diff --git a/ui/views/controls/label.h b/ui/views/controls/label.h index 93abb54..c78d414 100644 --- a/ui/views/controls/label.h +++ b/ui/views/controls/label.h @@ -167,7 +167,7 @@ class VIEWS_EXPORT Label : public View { // This method is used to layout multi-line labels. It is equivalent to // GetPreferredSize().height() if the receiver is not multi-line. virtual int GetHeightForWidth(int w) OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual View* GetTooltipHandlerForPoint(const gfx::Point& point) OVERRIDE; virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE; virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; diff --git a/ui/views/controls/link.cc b/ui/views/controls/link.cc index 94aaa60..6ea7412 100644 --- a/ui/views/controls/link.cc +++ b/ui/views/controls/link.cc @@ -21,7 +21,7 @@ namespace views { -const char Link::kViewClassName[] = "views/Link"; +const char Link::kViewClassName[] = "Link"; Link::Link() : Label(string16()) { Init(); @@ -39,7 +39,7 @@ void Link::OnEnabledChanged() { View::OnEnabledChanged(); } -std::string Link::GetClassName() const { +const char* Link::GetClassName() const { return kViewClassName; } diff --git a/ui/views/controls/link.h b/ui/views/controls/link.h index 798a9b2..cec26c4 100644 --- a/ui/views/controls/link.h +++ b/ui/views/controls/link.h @@ -32,7 +32,7 @@ class VIEWS_EXPORT Link : public Label { // Overridden from View: virtual void OnEnabledChanged() OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE; virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE; virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc index 017879f..8f6ecf5 100644 --- a/ui/views/controls/menu/menu_controller.cc +++ b/ui/views/controls/menu/menu_controller.cc @@ -97,7 +97,7 @@ static View* GetFirstHotTrackedView(View* view) { if (!view) return NULL; - if (view->GetClassName() == CustomButton::kViewClassName) { + if (!strcmp(view->GetClassName(), CustomButton::kViewClassName)) { CustomButton* button = static_cast<CustomButton*>(view); if (button->IsHotTracked()) return button; @@ -771,8 +771,8 @@ void MenuController::SetSelection(MenuItemView* menu_item, bool pending_item_changed = pending_state_.item != menu_item; if (pending_item_changed && pending_state_.item) { View* current_hot_view = GetFirstHotTrackedView(pending_state_.item); - if (current_hot_view && - current_hot_view->GetClassName() == CustomButton::kViewClassName) { + if (current_hot_view && !strcmp(current_hot_view->GetClassName(), + CustomButton::kViewClassName)) { CustomButton* button = static_cast<CustomButton*>(current_hot_view); button->SetHotTracked(false); } @@ -1141,7 +1141,7 @@ MenuController::SendAcceleratorResultType ui::Accelerator accelerator(ui::VKEY_RETURN, ui::EF_NONE); hot_view->AcceleratorPressed(accelerator); - if (hot_view->GetClassName() == CustomButton::kViewClassName) { + if (!strcmp(hot_view->GetClassName(), CustomButton::kViewClassName)) { CustomButton* button = static_cast<CustomButton*>(hot_view); button->SetHotTracked(true); } @@ -1885,12 +1885,13 @@ void MenuController::IncrementSelection(int delta) { if (item->has_children()) { View* hot_view = GetFirstHotTrackedView(item); - if (hot_view && hot_view->GetClassName() == CustomButton::kViewClassName) { + if (hot_view && + !strcmp(hot_view->GetClassName(), CustomButton::kViewClassName)) { CustomButton* button = static_cast<CustomButton*>(hot_view); button->SetHotTracked(false); View* to_make_hot = GetNextFocusableView(item, button, delta == 1); if (to_make_hot && - to_make_hot->GetClassName() == CustomButton::kViewClassName) { + !strcmp(to_make_hot->GetClassName(), CustomButton::kViewClassName)) { CustomButton* button_hot = static_cast<CustomButton*>(to_make_hot); button_hot->SetHotTracked(true); return; @@ -1898,7 +1899,7 @@ void MenuController::IncrementSelection(int delta) { } else { View* to_make_hot = GetInitialFocusableView(item, delta == 1); if (to_make_hot && - to_make_hot->GetClassName() == CustomButton::kViewClassName) { + !strcmp(to_make_hot->GetClassName(), CustomButton::kViewClassName)) { CustomButton* button_hot = static_cast<CustomButton*>(to_make_hot); button_hot->SetHotTracked(true); return; @@ -1919,8 +1920,8 @@ void MenuController::IncrementSelection(int delta) { ScrollToVisible(to_select); SetSelection(to_select, SELECTION_DEFAULT); View* to_make_hot = GetInitialFocusableView(to_select, delta == 1); - if (to_make_hot && - to_make_hot->GetClassName() == CustomButton::kViewClassName) { + if (to_make_hot && !strcmp(to_make_hot->GetClassName(), + CustomButton::kViewClassName)) { CustomButton* button_hot = static_cast<CustomButton*>(to_make_hot); button_hot->SetHotTracked(true); } diff --git a/ui/views/controls/menu/menu_item_view.cc b/ui/views/controls/menu/menu_item_view.cc index 9d565d0..5b2c806 100644 --- a/ui/views/controls/menu/menu_item_view.cc +++ b/ui/views/controls/menu/menu_item_view.cc @@ -612,7 +612,7 @@ MenuItemView::~MenuItemView() { STLDeleteElements(&removed_items_); } -std::string MenuItemView::GetClassName() const { +const char* MenuItemView::GetClassName() const { return kViewClassName; } diff --git a/ui/views/controls/menu/menu_item_view.h b/ui/views/controls/menu/menu_item_view.h index aa070f4..d60dd31 100644 --- a/ui/views/controls/menu/menu_item_view.h +++ b/ui/views/controls/menu/menu_item_view.h @@ -343,7 +343,7 @@ class VIEWS_EXPORT MenuItemView : public View { virtual void ChildPreferredSizeChanged(View* child) OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; // Returns the preferred size (and padding) of any children. virtual gfx::Size GetChildPreferredSize(); diff --git a/ui/views/controls/menu/submenu_view.cc b/ui/views/controls/menu/submenu_view.cc index 0cda4eb..87edc0322 100644 --- a/ui/views/controls/menu/submenu_view.cc +++ b/ui/views/controls/menu/submenu_view.cc @@ -389,7 +389,7 @@ void SubmenuView::MenuHostDestroyed() { GetMenuItem()->GetMenuController()->Cancel(MenuController::EXIT_DESTROYED); } -std::string SubmenuView::GetClassName() const { +const char* SubmenuView::GetClassName() const { return kViewClassName; } diff --git a/ui/views/controls/menu/submenu_view.h b/ui/views/controls/menu/submenu_view.h index ae4c0e9..ce38d68 100644 --- a/ui/views/controls/menu/submenu_view.h +++ b/ui/views/controls/menu/submenu_view.h @@ -149,8 +149,8 @@ class VIEWS_EXPORT SubmenuView : public View, } protected: - // View override. - virtual std::string GetClassName() const OVERRIDE; + // Overridden from View: + virtual const char* GetClassName() const OVERRIDE; // View method. Overridden to schedule a paint. We do this so that when // scrolling occurs, everything is repainted correctly. diff --git a/ui/views/controls/native/native_view_host.cc b/ui/views/controls/native/native_view_host.cc index d30e285..9653ec9 100644 --- a/ui/views/controls/native/native_view_host.cc +++ b/ui/views/controls/native/native_view_host.cc @@ -157,7 +157,7 @@ void NativeViewHost::ViewHierarchyChanged(bool is_add, View* parent, } } -std::string NativeViewHost::GetClassName() const { +const char* NativeViewHost::GetClassName() const { return kViewClassName; } diff --git a/ui/views/controls/native/native_view_host.h b/ui/views/controls/native/native_view_host.h index f092254..448d1e8 100644 --- a/ui/views/controls/native/native_view_host.h +++ b/ui/views/controls/native/native_view_host.h @@ -89,7 +89,7 @@ class VIEWS_EXPORT NativeViewHost : public View { virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child) OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; private: friend class NativeViewHostAuraTest; diff --git a/ui/views/controls/native_control_win.cc b/ui/views/controls/native_control_win.cc index 32a06ba..e8d97d8 100644 --- a/ui/views/controls/native_control_win.cc +++ b/ui/views/controls/native_control_win.cc @@ -109,7 +109,7 @@ void NativeControlWin::OnFocus() { // a native win32 control, we don't always send a native (MSAA) // focus notification. bool send_native_event = - parent_view->GetClassName() != Combobox::kViewClassName && + strcmp(parent_view->GetClassName(), Combobox::kViewClassName) && parent_view->HasFocus(); // Send the accessibility focus notification. diff --git a/ui/views/controls/progress_bar.cc b/ui/views/controls/progress_bar.cc index f547aea..2764351 100644 --- a/ui/views/controls/progress_bar.cc +++ b/ui/views/controls/progress_bar.cc @@ -131,7 +131,7 @@ void StrokeRoundRect(gfx::Canvas* canvas, namespace views { // static -const char ProgressBar::kViewClassName[] = "views/ProgressBar"; +const char ProgressBar::kViewClassName[] = "ProgressBar"; ProgressBar::ProgressBar() : min_display_value_(0.0), @@ -179,7 +179,7 @@ gfx::Size ProgressBar::GetPreferredSize() { return gfx::Size(100, 11); } -std::string ProgressBar::GetClassName() const { +const char* ProgressBar::GetClassName() const { return kViewClassName; } diff --git a/ui/views/controls/progress_bar.h b/ui/views/controls/progress_bar.h index 988b230..3e7272c 100644 --- a/ui/views/controls/progress_bar.h +++ b/ui/views/controls/progress_bar.h @@ -43,7 +43,7 @@ class VIEWS_EXPORT ProgressBar : public View { // Overridden from View: virtual gfx::Size GetPreferredSize() OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; // Inclusive range used when displaying values. diff --git a/ui/views/controls/resize_area.cc b/ui/views/controls/resize_area.cc index 531e6bc..845f2e8 100644 --- a/ui/views/controls/resize_area.cc +++ b/ui/views/controls/resize_area.cc @@ -15,7 +15,7 @@ namespace views { -const char ResizeArea::kViewClassName[] = "views/ResizeArea"; +const char ResizeArea::kViewClassName[] = "ResizeArea"; //////////////////////////////////////////////////////////////////////////////// // ResizeArea @@ -28,7 +28,7 @@ ResizeArea::ResizeArea(ResizeAreaDelegate* delegate) ResizeArea::~ResizeArea() { } -std::string ResizeArea::GetClassName() const { +const char* ResizeArea::GetClassName() const { return kViewClassName; } diff --git a/ui/views/controls/resize_area.h b/ui/views/controls/resize_area.h index 9717a5f2..288b912 100644 --- a/ui/views/controls/resize_area.h +++ b/ui/views/controls/resize_area.h @@ -26,7 +26,7 @@ class VIEWS_EXPORT ResizeArea : public View { virtual ~ResizeArea(); // Overridden from views::View: - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE; virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; diff --git a/ui/views/controls/scroll_view.cc b/ui/views/controls/scroll_view.cc index 1f806a4..3659c35 100644 --- a/ui/views/controls/scroll_view.cc +++ b/ui/views/controls/scroll_view.cc @@ -13,7 +13,7 @@ namespace views { -const char* const ScrollView::kViewClassName = "views/ScrollView"; +const char ScrollView::kViewClassName[] = "ScrollView"; namespace { @@ -84,8 +84,8 @@ class ScrollView::Viewport : public View { Viewport() {} virtual ~Viewport() {} - virtual std::string GetClassName() const OVERRIDE { - return "views/Viewport"; + virtual const char* GetClassName() const OVERRIDE { + return "ScrollView::Viewport"; } virtual void ScrollRectToVisible(const gfx::Rect& rect) OVERRIDE { @@ -331,7 +331,7 @@ void ScrollView::OnGestureEvent(ui::GestureEvent* event) { } } -std::string ScrollView::GetClassName() const { +const char* ScrollView::GetClassName() const { return kViewClassName; } diff --git a/ui/views/controls/scroll_view.h b/ui/views/controls/scroll_view.h index f5914bc..857ddac 100644 --- a/ui/views/controls/scroll_view.h +++ b/ui/views/controls/scroll_view.h @@ -28,7 +28,7 @@ namespace views { class VIEWS_EXPORT ScrollView : public View, public ScrollBarController { public: - static const char* const kViewClassName; + static const char kViewClassName[]; ScrollView(); virtual ~ScrollView(); @@ -71,7 +71,7 @@ class VIEWS_EXPORT ScrollView : public View, public ScrollBarController { virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; virtual bool OnMouseWheel(const ui::MouseWheelEvent& e) OVERRIDE; virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; // ScrollBarController overrides: virtual void ScrollToPosition(ScrollBar* source, int position) OVERRIDE; diff --git a/ui/views/controls/scrollbar/native_scroll_bar.cc b/ui/views/controls/scrollbar/native_scroll_bar.cc index 0848576..e2a522f 100644 --- a/ui/views/controls/scrollbar/native_scroll_bar.cc +++ b/ui/views/controls/scrollbar/native_scroll_bar.cc @@ -19,7 +19,7 @@ namespace views { // static -const char NativeScrollBar::kViewClassName[] = "views/NativeScrollBar"; +const char NativeScrollBar::kViewClassName[] = "NativeScrollBar"; //////////////////////////////////////////////////////////////////////////////// // NativeScrollBar, public: @@ -67,7 +67,7 @@ void NativeScrollBar::ViewHierarchyChanged(bool is_add, View *parent, } } -std::string NativeScrollBar::GetClassName() const { +const char* NativeScrollBar::GetClassName() const { return kViewClassName; } diff --git a/ui/views/controls/scrollbar/native_scroll_bar.h b/ui/views/controls/scrollbar/native_scroll_bar.h index c105f29..6f0caae 100644 --- a/ui/views/controls/scrollbar/native_scroll_bar.h +++ b/ui/views/controls/scrollbar/native_scroll_bar.h @@ -45,7 +45,7 @@ class VIEWS_EXPORT NativeScrollBar : public ScrollBar { virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child) OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; // Overrideen from View for keyboard UI purpose. virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; diff --git a/ui/views/controls/scrollbar/native_scroll_bar_views.cc b/ui/views/controls/scrollbar/native_scroll_bar_views.cc index eecec0a..aa812a8 100644 --- a/ui/views/controls/scrollbar/native_scroll_bar_views.cc +++ b/ui/views/controls/scrollbar/native_scroll_bar_views.cc @@ -33,8 +33,8 @@ class ScrollBarButton : public BaseScrollBarButton { virtual ~ScrollBarButton(); virtual gfx::Size GetPreferredSize() OVERRIDE; - virtual std::string GetClassName() const OVERRIDE { - return "views/ScrollBarButton"; + virtual const char* GetClassName() const OVERRIDE { + return "ScrollBarButton"; } protected: @@ -55,8 +55,8 @@ class ScrollBarThumb : public BaseScrollBarThumb { virtual ~ScrollBarThumb(); virtual gfx::Size GetPreferredSize() OVERRIDE; - virtual std::string GetClassName() const OVERRIDE { - return "views/ScrollBarThumb"; + virtual const char* GetClassName() const OVERRIDE { + return "ScrollBarThumb"; } protected: @@ -73,9 +73,7 @@ class ScrollBarThumb : public BaseScrollBarThumb { ///////////////////////////////////////////////////////////////////////////// // ScrollBarButton -ScrollBarButton::ScrollBarButton( - ButtonListener* listener, - Type type) +ScrollBarButton::ScrollBarButton(ButtonListener* listener, Type type) : BaseScrollBarButton(listener), type_(type) { set_focusable(false); @@ -229,8 +227,7 @@ ui::NativeTheme::State ScrollBarThumb::GetNativeThemeState() const { //////////////////////////////////////////////////////////////////////////////// // NativeScrollBarViews, public: -const char NativeScrollBarViews::kViewClassName[] = - "views/NativeScrollBarViews"; +const char NativeScrollBarViews::kViewClassName[] = "NativeScrollBarViews"; NativeScrollBarViews::NativeScrollBarViews(NativeScrollBar* scroll_bar) : BaseScrollBar(scroll_bar->IsHorizontal(), @@ -302,7 +299,7 @@ gfx::Size NativeScrollBarViews::GetPreferredSize() { return gfx::Size(GetVerticalScrollBarWidth(theme), 0); } -std::string NativeScrollBarViews::GetClassName() const { +const char* NativeScrollBarViews::GetClassName() const { return kViewClassName; } diff --git a/ui/views/controls/scrollbar/native_scroll_bar_views.h b/ui/views/controls/scrollbar/native_scroll_bar_views.h index e928db0..72d1821 100644 --- a/ui/views/controls/scrollbar/native_scroll_bar_views.h +++ b/ui/views/controls/scrollbar/native_scroll_bar_views.h @@ -37,7 +37,7 @@ class VIEWS_EXPORT NativeScrollBarViews : public BaseScrollBar, virtual void Layout() OVERRIDE; virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; virtual gfx::Size GetPreferredSize() OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; // ScrollBar overrides: virtual int GetLayoutSize() const OVERRIDE; diff --git a/ui/views/controls/separator.cc b/ui/views/controls/separator.cc index 810e7d8..9f1dfc2 100644 --- a/ui/views/controls/separator.cc +++ b/ui/views/controls/separator.cc @@ -10,7 +10,7 @@ namespace views { // static -const char Separator::kViewClassName[] = "views/Separator"; +const char Separator::kViewClassName[] = "Separator"; // The separator height in pixels. const int kSeparatorHeight = 1; @@ -40,7 +40,7 @@ void Separator::Paint(gfx::Canvas* canvas) { canvas->FillRect(bounds(), kDefaultColor); } -std::string Separator::GetClassName() const { +const char* Separator::GetClassName() const { return kViewClassName; } diff --git a/ui/views/controls/separator.h b/ui/views/controls/separator.h index 7980ea7..e4afcb8 100644 --- a/ui/views/controls/separator.h +++ b/ui/views/controls/separator.h @@ -26,7 +26,7 @@ class VIEWS_EXPORT Separator : public View { virtual gfx::Size GetPreferredSize() OVERRIDE; virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; virtual void Paint(gfx::Canvas* canvas) OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; private: DISALLOW_COPY_AND_ASSIGN(Separator); diff --git a/ui/views/controls/single_split_view.cc b/ui/views/controls/single_split_view.cc index f31e6f4..4311cc9 100644 --- a/ui/views/controls/single_split_view.cc +++ b/ui/views/controls/single_split_view.cc @@ -17,8 +17,7 @@ namespace views { // static -const char SingleSplitView::kViewClassName[] = - "ui/views/controls/SingleSplitView"; +const char SingleSplitView::kViewClassName[] = "SingleSplitView"; // Size of the divider in pixels. static const int kDividerSize = 4; @@ -61,7 +60,7 @@ void SingleSplitView::Layout() { View::Layout(); } -std::string SingleSplitView::GetClassName() const { +const char* SingleSplitView::GetClassName() const { return kViewClassName; } diff --git a/ui/views/controls/single_split_view.h b/ui/views/controls/single_split_view.h index 62e1578..f4a336a 100644 --- a/ui/views/controls/single_split_view.h +++ b/ui/views/controls/single_split_view.h @@ -32,7 +32,7 @@ class VIEWS_EXPORT SingleSplitView : public View { SingleSplitViewListener* listener); virtual void Layout() OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; diff --git a/ui/views/controls/tabbed_pane/tabbed_pane.cc b/ui/views/controls/tabbed_pane/tabbed_pane.cc index 2cf72dd8..197097d 100644 --- a/ui/views/controls/tabbed_pane/tabbed_pane.cc +++ b/ui/views/controls/tabbed_pane/tabbed_pane.cc @@ -31,7 +31,7 @@ const SkScalar kTabBorderRadius = 2.0f; namespace views { // static -const char TabbedPane::kViewClassName[] = "views/TabbedPane"; +const char TabbedPane::kViewClassName[] = "TabbedPane"; // The tab view shown in the tab strip. class Tab : public View { @@ -350,7 +350,7 @@ bool TabbedPane::AcceleratorPressed(const ui::Accelerator& accelerator) { return true; } -std::string TabbedPane::GetClassName() const { +const char* TabbedPane::GetClassName() const { return kViewClassName; } diff --git a/ui/views/controls/tabbed_pane/tabbed_pane.h b/ui/views/controls/tabbed_pane/tabbed_pane.h index 7f6d882..2b446a7 100644 --- a/ui/views/controls/tabbed_pane/tabbed_pane.h +++ b/ui/views/controls/tabbed_pane/tabbed_pane.h @@ -55,7 +55,7 @@ class VIEWS_EXPORT TabbedPane : public View { // Overridden from View: virtual gfx::Size GetPreferredSize() OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; private: // Get the Tab (the tabstrip view, not its content) at the valid |index|. diff --git a/ui/views/controls/textfield/native_textfield_win.cc b/ui/views/controls/textfield/native_textfield_win.cc index c15c324..1eee735 100644 --- a/ui/views/controls/textfield/native_textfield_win.cc +++ b/ui/views/controls/textfield/native_textfield_win.cc @@ -556,7 +556,7 @@ void NativeTextfieldWin::InitializeAccessibilityInfo() { // We expect it to be a Label preceeding this view (if it exists). string16 name; View* label_view = parent->child_at(label_index); - if (label_view->GetClassName() == Label::kViewClassName) { + if (!strcmp(label_view->GetClassName(), Label::kViewClassName)) { ui::AccessibleViewState state; label_view->GetAccessibleState(&state); hr = pAccPropServices->SetHwndPropStr(m_hWnd, OBJID_CLIENT, diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc index c5d2632..788e173 100644 --- a/ui/views/controls/textfield/textfield.cc +++ b/ui/views/controls/textfield/textfield.cc @@ -589,7 +589,7 @@ void Textfield::ViewHierarchyChanged(bool is_add, View* parent, View* child) { } } -std::string Textfield::GetClassName() const { +const char* Textfield::GetClassName() const { return kViewClassName; } diff --git a/ui/views/controls/textfield/textfield.h b/ui/views/controls/textfield/textfield.h index 4d53d9b..b3d5c17 100644 --- a/ui/views/controls/textfield/textfield.h +++ b/ui/views/controls/textfield/textfield.h @@ -270,7 +270,7 @@ class VIEWS_EXPORT Textfield : public View { protected: virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child) OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; // The object that actually implements the native text field. NativeTextfieldWrapper* native_wrapper_; diff --git a/ui/views/controls/webview/webview.cc b/ui/views/controls/webview/webview.cc index 64c54ef..d668170 100644 --- a/ui/views/controls/webview/webview.cc +++ b/ui/views/controls/webview/webview.cc @@ -26,8 +26,7 @@ namespace views { // static -const char WebView::kViewClassName[] = - "ui/views/WebView"; +const char WebView::kViewClassName[] = "WebView"; //////////////////////////////////////////////////////////////////////////////// // WebView, public: @@ -93,7 +92,7 @@ void WebView::SetPreferredSize(const gfx::Size& preferred_size) { //////////////////////////////////////////////////////////////////////////////// // WebView, View overrides: -std::string WebView::GetClassName() const { +const char* WebView::GetClassName() const { return kViewClassName; } diff --git a/ui/views/controls/webview/webview.h b/ui/views/controls/webview/webview.h index 1ea3ec1..d82702b 100644 --- a/ui/views/controls/webview/webview.h +++ b/ui/views/controls/webview/webview.h @@ -81,11 +81,11 @@ class WEBVIEW_EXPORT WebView : public View, void SetPreferredSize(const gfx::Size& preferred_size); // Overridden from View: - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; // Overridden from AccessibleWebView: - virtual gfx::NativeViewAccessible AccessibleObjectFromChildId(long child_id) - OVERRIDE; + virtual gfx::NativeViewAccessible AccessibleObjectFromChildId( + long child_id) OVERRIDE; virtual View* AsView() OVERRIDE; private: diff --git a/ui/views/debug_utils.cc b/ui/views/debug_utils.cc index adeadd6..1c95e19 100644 --- a/ui/views/debug_utils.cc +++ b/ui/views/debug_utils.cc @@ -42,7 +42,7 @@ void PrintFocusHierarchyImp(const View* view, *out << L' '; *out << view->id(); *out << L' '; - *out << view->GetClassName().c_str(); + *out << view->GetClassName(); *out << L' '; *out << view; *out << L'\n'; diff --git a/ui/views/view.cc b/ui/views/view.cc index dacc36a..bae1d82 100644 --- a/ui/views/view.cc +++ b/ui/views/view.cc @@ -613,13 +613,13 @@ void View::SetLayoutManager(LayoutManager* layout_manager) { // Attributes ------------------------------------------------------------------ -std::string View::GetClassName() const { +const char* View::GetClassName() const { return kViewClassName; } View* View::GetAncestorWithClassName(const std::string& name) { for (View* view = this; view; view = view->parent_) { - if (view->GetClassName() == name) + if (!strcmp(view->GetClassName(), name.c_str())) return view; } return NULL; @@ -1562,7 +1562,8 @@ std::string View::DoPrintViewGraph(bool first, View* view_with_children) { // Node characteristics. char p[kMaxPointerStringLength]; - size_t base_name_index = GetClassName().find_last_of('/'); + const std::string class_name(GetClassName()); + size_t base_name_index = class_name.find_last_of('/'); if (base_name_index == std::string::npos) base_name_index = 0; else @@ -1576,7 +1577,7 @@ std::string View::DoPrintViewGraph(bool first, View* view_with_children) { result.append(p + 2); result.append(" [label=\""); - result.append(GetClassName().substr(base_name_index).c_str()); + result.append(class_name.substr(base_name_index).c_str()); base::snprintf(bounds_buffer, arraysize(bounds_buffer), diff --git a/ui/views/view.h b/ui/views/view.h index 306e3a9..536eb3d 100644 --- a/ui/views/view.h +++ b/ui/views/view.h @@ -360,7 +360,7 @@ class VIEWS_EXPORT View : public ui::LayerDelegate, // uniquely identifies the view class. It is intended to be used as a way to // find out during run time if a view can be safely casted to a specific view // subclass. The default implementation returns kViewClassName. - virtual std::string GetClassName() const; + virtual const char* GetClassName() const; // Returns the first ancestor, starting at this, whose class name is |name|. // Returns null if no ancestor has the class name |name|. diff --git a/ui/views/widget/root_view.cc b/ui/views/widget/root_view.cc index 36a4e83..9c9c551 100644 --- a/ui/views/widget/root_view.cc +++ b/ui/views/widget/root_view.cc @@ -363,7 +363,7 @@ bool RootView::IsDrawn() const { return visible(); } -std::string RootView::GetClassName() const { +const char* RootView::GetClassName() const { return kViewClassName; } diff --git a/ui/views/widget/root_view.h b/ui/views/widget/root_view.h index a771537..719d404 100644 --- a/ui/views/widget/root_view.h +++ b/ui/views/widget/root_view.h @@ -97,7 +97,7 @@ class VIEWS_EXPORT RootView : public View, virtual const Widget* GetWidget() const OVERRIDE; virtual Widget* GetWidget() OVERRIDE; virtual bool IsDrawn() const OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; virtual void SchedulePaintInRect(const gfx::Rect& rect) OVERRIDE; virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; diff --git a/ui/views/window/client_view.cc b/ui/views/window/client_view.cc index 86044c2..fa3e381 100644 --- a/ui/views/window/client_view.cc +++ b/ui/views/window/client_view.cc @@ -70,7 +70,7 @@ void ClientView::Layout() { contents_view_->SetBounds(0, 0, width(), height()); } -std::string ClientView::GetClassName() const { +const char* ClientView::GetClassName() const { return kViewClassName; } diff --git a/ui/views/window/client_view.h b/ui/views/window/client_view.h index a6c8236..deb7aad 100644 --- a/ui/views/window/client_view.h +++ b/ui/views/window/client_view.h @@ -61,7 +61,7 @@ class VIEWS_EXPORT ClientView : public View { virtual gfx::Size GetMaximumSize() OVERRIDE; virtual gfx::Size GetMinimumSize() OVERRIDE; virtual void Layout() OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; protected: // Overridden from View: diff --git a/ui/views/window/dialog_client_view.cc b/ui/views/window/dialog_client_view.cc index fdc6c53..7ae2023 100644 --- a/ui/views/window/dialog_client_view.cc +++ b/ui/views/window/dialog_client_view.cc @@ -155,7 +155,7 @@ void DialogClientView::OnWillChangeFocus(View* focused_before, const int default_button = GetDialogDelegate()->GetDefaultDialogButton(); LabelButton* new_default_button = NULL; if (focused_now && - (focused_now->GetClassName() == LabelButton::kViewClassName)) { + !strcmp(focused_now->GetClassName(), LabelButton::kViewClassName)) { new_default_button = static_cast<LabelButton*>(focused_now); } else if (default_button == ui::DIALOG_BUTTON_OK && ok_button_) { new_default_button = ok_button_; diff --git a/ui/views/window/non_client_view.cc b/ui/views/window/non_client_view.cc index d457bde..52ea072 100644 --- a/ui/views/window/non_client_view.cc +++ b/ui/views/window/non_client_view.cc @@ -165,7 +165,7 @@ void NonClientView::GetAccessibleState(ui::AccessibleViewState* state) { state->name = accessible_name_; } -std::string NonClientView::GetClassName() const { +const char* NonClientView::GetClassName() const { return kViewClassName; } @@ -291,7 +291,7 @@ void NonClientFrameView::GetAccessibleState(ui::AccessibleViewState* state) { state->role = ui::AccessibilityTypes::ROLE_CLIENT; } -std::string NonClientFrameView::GetClassName() const { +const char* NonClientFrameView::GetClassName() const { return kViewClassName; } diff --git a/ui/views/window/non_client_view.h b/ui/views/window/non_client_view.h index 67afb6c..abff348 100644 --- a/ui/views/window/non_client_view.h +++ b/ui/views/window/non_client_view.h @@ -71,7 +71,7 @@ class VIEWS_EXPORT NonClientFrameView : public View { // Overridden from View: virtual bool HitTestRect(const gfx::Rect& rect) const OVERRIDE; virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; protected: virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; @@ -210,17 +210,18 @@ class VIEWS_EXPORT NonClientView : public View { virtual gfx::Size GetMaximumSize() OVERRIDE; virtual void Layout() OVERRIDE; virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; - virtual std::string GetClassName() const OVERRIDE; + virtual const char* GetClassName() const OVERRIDE; - virtual views::View* GetEventHandlerForPoint(const gfx::Point& point) - OVERRIDE; - virtual views::View* GetTooltipHandlerForPoint(const gfx::Point& point) - OVERRIDE; + virtual views::View* GetEventHandlerForPoint( + const gfx::Point& point) OVERRIDE; + virtual views::View* GetTooltipHandlerForPoint( + const gfx::Point& point) OVERRIDE; protected: // NonClientView, View overrides: - virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child) - OVERRIDE; + virtual void ViewHierarchyChanged(bool is_add, + View* parent, + View* child) OVERRIDE; private: // A ClientView object or subclass, responsible for sizing the contents view |