diff options
author | miletus@chromium.org <miletus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-02 21:32:47 +0000 |
---|---|---|
committer | miletus@chromium.org <miletus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-02 21:32:47 +0000 |
commit | 66753957b436fff34ca3476e21b01c655c0c090e (patch) | |
tree | aee786a1f25c9de94c4ec3f853ac1e8ea8b0edf5 | |
parent | aa64c98f489e66d17342b7cb7e42c621b31cbbc7 (diff) | |
download | chromium_src-66753957b436fff34ca3476e21b01c655c0c090e.zip chromium_src-66753957b436fff34ca3476e21b01c655c0c090e.tar.gz chromium_src-66753957b436fff34ca3476e21b01c655c0c090e.tar.bz2 |
Add some view class name to better debug view hierarchy
BUG=None
TEST=None
R=
Review URL: http://codereview.chromium.org/6976053
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87689 0039d316-1c4b-4281-b951-d872f2087c98
10 files changed, 65 insertions, 3 deletions
diff --git a/chrome/browser/ui/views/frame/contents_container.cc b/chrome/browser/ui/views/frame/contents_container.cc index f39ab6b..b54a386 100644 --- a/chrome/browser/ui/views/frame/contents_container.cc +++ b/chrome/browser/ui/views/frame/contents_container.cc @@ -14,6 +14,10 @@ static const int kMinOpacity = 0; static const int kMaxOpacity = 192; +// static +const char ContentsContainer::kViewClassName[] = + "browser/ui/views/frame/ContentsContainer"; + // View used to track when the overlay widget is destroyed. If the // ContentsContainer is still valid when the destructor is invoked this invokes // |OverlayViewDestroyed| on the ContentsContainer. @@ -149,6 +153,10 @@ void ContentsContainer::Layout() { views::View::Layout(); } +std::string ContentsContainer::GetClassName() const { + return kViewClassName; +} + void ContentsContainer::CreateOverlay(int initial_opacity) { DCHECK(!active_overlay_); gfx::Point screen_origin; diff --git a/chrome/browser/ui/views/frame/contents_container.h b/chrome/browser/ui/views/frame/contents_container.h index 55ad53b..0059fd2 100644 --- a/chrome/browser/ui/views/frame/contents_container.h +++ b/chrome/browser/ui/views/frame/contents_container.h @@ -25,6 +25,9 @@ class Widget; // TabContents and one for instant's TabContents. class ContentsContainer : public views::View, public ui::AnimationDelegate { public: + // Internal class name + static const char kViewClassName[]; + explicit ContentsContainer(views::View* active); virtual ~ContentsContainer(); @@ -55,7 +58,8 @@ class ContentsContainer : public views::View, public ui::AnimationDelegate { void RemoveFade(); // View overrides: - virtual void Layout(); + virtual void Layout() OVERRIDE; + virtual std::string GetClassName() const OVERRIDE; // ui::AnimationDelegate overrides: virtual void AnimationProgressed(const ui::Animation* animation); diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_container_views.cc b/chrome/browser/ui/views/tab_contents/tab_contents_container_views.cc index ebb872b..9fb7749 100644 --- a/chrome/browser/ui/views/tab_contents/tab_contents_container_views.cc +++ b/chrome/browser/ui/views/tab_contents/tab_contents_container_views.cc @@ -16,6 +16,10 @@ #include "content/common/notification_source.h" #include "views/layout/fill_layout.h" +// static +const char TabContentsContainer::kViewClassName[] = + "browser/ui/views/tab_contents/TabContentsContainer"; + // Some of this class is implemented in tab_contents_container.cc, where // the implementation doesn't vary between a pure views approach and a // native view host approach. See the header file for details. @@ -54,6 +58,10 @@ void TabContentsContainer::ChangeTabContents(TabContents* contents) { } } +std::string TabContentsContainer::GetClassName() const { + return kViewClassName; +} + void TabContentsContainer::TabContentsFocused(TabContents* tab_contents) { } diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_container_views.h b/chrome/browser/ui/views/tab_contents/tab_contents_container_views.h index 5bbd473..f0bf995 100644 --- a/chrome/browser/ui/views/tab_contents/tab_contents_container_views.h +++ b/chrome/browser/ui/views/tab_contents/tab_contents_container_views.h @@ -18,6 +18,9 @@ class TabContents; class TabContentsContainer : public views::View, public NotificationObserver { public: + // Internal class name + static const char kViewClassName[]; + TabContentsContainer(); virtual ~TabContentsContainer(); @@ -47,6 +50,9 @@ class TabContentsContainer : public views::View, virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; + // Overridden from views::View. + virtual std::string GetClassName() const OVERRIDE; + private: // Add or remove observers for events that we care about. void AddObservers(); diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_view_touch.cc b/chrome/browser/ui/views/tab_contents/tab_contents_view_touch.cc index 74ebe0e..7fe0ac0 100644 --- a/chrome/browser/ui/views/tab_contents/tab_contents_view_touch.cc +++ b/chrome/browser/ui/views/tab_contents/tab_contents_view_touch.cc @@ -30,6 +30,10 @@ using WebKit::WebDragOperationsMask; using WebKit::WebInputEvent; // static +const char TabContentsViewTouch::kViewClassName[] = + "browser/ui/views/tab_contents/TabContentsViewTouch"; + +// static TabContentsView* TabContentsView::Create(TabContents* tab_contents) { return new TabContentsViewTouch(tab_contents); } @@ -232,6 +236,10 @@ void TabContentsViewTouch::OnBoundsChanged(const gfx::Rect& previous_bounds) { void TabContentsViewTouch::OnPaint(gfx::Canvas* canvas) { } +std::string TabContentsViewTouch::GetClassName() const { + return kViewClassName; +} + void TabContentsViewTouch::UpdateDragCursor(WebDragOperation operation) { NOTIMPLEMENTED(); // It's not even clear a drag cursor will make sense for touch. diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_view_touch.h b/chrome/browser/ui/views/tab_contents/tab_contents_view_touch.h index a28489c..1ae1e05 100644 --- a/chrome/browser/ui/views/tab_contents/tab_contents_view_touch.h +++ b/chrome/browser/ui/views/tab_contents/tab_contents_view_touch.h @@ -32,6 +32,9 @@ class NativeViewHost; // Touch-specific implementation of the TabContentsView for the touch UI. class TabContentsViewTouch : public TabContentsView, public views::View { public: + // Internal class name + static const char kViewClassName[]; + // The corresponding TabContents is passed in the constructor, and manages our // lifetime. This doesn't need to be the case, but is this way currently // because that's what was easiest when they were split. @@ -64,6 +67,7 @@ class TabContentsViewTouch : public TabContentsView, public views::View { // views::View implementation virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; + virtual std::string GetClassName() const OVERRIDE; // Backend implementation of RenderViewHostDelegate::View. virtual void ShowContextMenu(const ContextMenuParams& params); diff --git a/views/controls/single_split_view.cc b/views/controls/single_split_view.cc index 1d2c8a9..0397810 100644 --- a/views/controls/single_split_view.cc +++ b/views/controls/single_split_view.cc @@ -19,6 +19,10 @@ namespace views { +// static +const char SingleSplitView::kViewClassName[] = + "views/controls/SingleSplitView"; + // Size of the divider in pixels. static const int kDividerSize = 4; @@ -59,6 +63,10 @@ void SingleSplitView::Layout() { View::Layout(); } +std::string SingleSplitView::GetClassName() const { + return kViewClassName; +} + void SingleSplitView::GetAccessibleState(ui::AccessibleViewState* state) { state->role = ui::AccessibilityTypes::ROLE_GROUPING; state->name = accessible_name_; diff --git a/views/controls/single_split_view.h b/views/controls/single_split_view.h index ab6bedf..d325fd0 100644 --- a/views/controls/single_split_view.h +++ b/views/controls/single_split_view.h @@ -23,6 +23,9 @@ class SingleSplitView : public views::View { VERTICAL_SPLIT }; + // Internal class name + static const char kViewClassName[]; + class Observer { public: // Invoked when split handle is moved by the user. |source|'s divider_offset @@ -40,6 +43,7 @@ class SingleSplitView : public views::View { Observer* observer); virtual void Layout() OVERRIDE; + virtual std::string GetClassName() const OVERRIDE; virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; diff --git a/views/window/client_view.cc b/views/window/client_view.cc index cb52607..c91a6ae 100644 --- a/views/window/client_view.cc +++ b/views/window/client_view.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -13,6 +13,10 @@ namespace views { +// static +const char ClientView::kViewClassName[] = + "views/window/ClientView"; + /////////////////////////////////////////////////////////////////////////////// // ClientView, public: @@ -54,6 +58,10 @@ void ClientView::Layout() { contents_view_->SetBounds(0, 0, width(), height()); } +std::string ClientView::GetClassName() const { + return kViewClassName; +} + void ClientView::ViewHierarchyChanged(bool is_add, View* parent, View* child) { if (is_add && child == this) { DCHECK(GetWidget()); diff --git a/views/window/client_view.h b/views/window/client_view.h index 052037f..cbfc3a6 100644 --- a/views/window/client_view.h +++ b/views/window/client_view.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -23,6 +23,9 @@ class Window; // "DialogClientView". class ClientView : public View { public: + // Internal class name + static const char kViewClassName[]; + // Constructs a ClientView object for the specified window with the specified // contents. Since this object is created during the process of creating // |window|, |contents_view| must be valid if you want the initial size of @@ -57,6 +60,7 @@ class ClientView : public View { // Overridden from View: virtual gfx::Size GetPreferredSize() OVERRIDE; virtual void Layout() OVERRIDE; + virtual std::string GetClassName() const OVERRIDE; protected: // Overridden from View: |