diff options
-rw-r--r-- | chrome/browser/chromeos/login/webui_login_display_host.cc | 2 | ||||
-rw-r--r-- | chrome/browser/ui/views/aura/status_area_host_aura.cc | 2 | ||||
-rw-r--r-- | content/browser/renderer_host/render_widget_host_view_aura.cc | 3 | ||||
-rw-r--r-- | ui/aura/desktop.cc | 2 | ||||
-rw-r--r-- | ui/aura/window.cc | 38 | ||||
-rw-r--r-- | ui/aura/window.h | 5 | ||||
-rw-r--r-- | ui/aura_shell/desktop_background_view.cc | 2 | ||||
-rw-r--r-- | ui/aura_shell/launcher/launcher.cc | 2 | ||||
-rw-r--r-- | ui/aura_shell/modal_container_layout_manager.cc | 2 | ||||
-rw-r--r-- | ui/aura_shell/shell_accelerator_controller.cc | 6 | ||||
-rw-r--r-- | ui/aura_shell/status_area_view.cc | 2 |
11 files changed, 45 insertions, 21 deletions
diff --git a/chrome/browser/chromeos/login/webui_login_display_host.cc b/chrome/browser/chromeos/login/webui_login_display_host.cc index e0d4298..60dc6c2 100644 --- a/chrome/browser/chromeos/login/webui_login_display_host.cc +++ b/chrome/browser/chromeos/login/webui_login_display_host.cc @@ -139,7 +139,7 @@ void WebUILoginDisplayHost::LoadURL(const GURL& url) { login_window_->Show(); #if defined(USE_AURA) - login_window_->GetNativeView()->set_name("WebUILoginView"); + login_window_->GetNativeView()->SetName("WebUILoginView"); #endif login_view_->OnWindowCreated(); } diff --git a/chrome/browser/ui/views/aura/status_area_host_aura.cc b/chrome/browser/ui/views/aura/status_area_host_aura.cc index 7daad39..24be266 100644 --- a/chrome/browser/ui/views/aura/status_area_host_aura.cc +++ b/chrome/browser/ui/views/aura/status_area_host_aura.cc @@ -74,7 +74,7 @@ views::Widget* StatusAreaHostAura::CreateStatusArea() { status_area_widget_->Init(params); status_area_widget_->SetContentsView(status_area_view_); status_area_widget_->Show(); - status_area_widget_->GetNativeView()->set_name("StatusAreaView"); + status_area_widget_->GetNativeView()->SetName("StatusAreaView"); return status_area_widget_; } diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index 5ce7855..7302b2b 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -106,6 +106,7 @@ RenderWidgetHostViewAura::~RenderWidgetHostViewAura() { void RenderWidgetHostViewAura::InitAsChild() { window_->Init(ui::Layer::LAYER_HAS_TEXTURE); + window_->SetName("RenderWidgetHostViewAura"); } //////////////////////////////////////////////////////////////////////////////// @@ -118,6 +119,7 @@ void RenderWidgetHostViewAura::InitAsPopup( static_cast<RenderWidgetHostViewAura*>(parent_host_view); window_->SetType(aura::WINDOW_TYPE_MENU); window_->Init(ui::Layer::LAYER_HAS_TEXTURE); + window_->SetName("RenderWidgetHostViewAura"); window_->SetParent(NULL); Show(); @@ -136,6 +138,7 @@ void RenderWidgetHostViewAura::InitAsFullscreen( is_fullscreen_ = true; window_->SetType(aura::WINDOW_TYPE_NORMAL); window_->Init(ui::Layer::LAYER_HAS_TEXTURE); + window_->SetName("RenderWidgetHostViewAura"); window_->SetIntProperty(aura::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); window_->SetParent(NULL); Show(); diff --git a/ui/aura/desktop.cc b/ui/aura/desktop.cc index 59cd962..17e63b9 100644 --- a/ui/aura/desktop.cc +++ b/ui/aura/desktop.cc @@ -414,7 +414,7 @@ Desktop::Desktop() mouse_moved_handler_(NULL), focused_window_(NULL), touch_event_handler_(NULL) { - set_name("RootWindow"); + SetName("RootWindow"); gfx::Screen::SetInstance(screen_); host_->SetDesktop(this); last_mouse_location_ = host_->QueryMouseLocation(); diff --git a/ui/aura/window.cc b/ui/aura/window.cc index 6b4c5d2..995dd27 100644 --- a/ui/aura/window.cc +++ b/ui/aura/window.cc @@ -78,19 +78,7 @@ void Window::Init(ui::Layer::LayerType layer_type) { layer_.reset(new ui::Layer(layer_type)); layer_->SetVisible(false); layer_->set_delegate(this); - -#if !defined(NDEBUG) - std::string layer_name(name_); - if (layer_name.empty()) - layer_name.append("Unnamed Window"); - - if (id_ != -1) { - char id_buf[10]; - base::snprintf(id_buf, sizeof(id_buf), " %d", id_); - layer_name.append(id_buf); - } - layer_->set_name(layer_name); -#endif + UpdateLayerName(name_); Desktop::GetInstance()->WindowInitialized(this); } @@ -101,6 +89,13 @@ void Window::SetType(WindowType type) { type_ = type; } +void Window::SetName(const std::string& name) { + name_ = name; + + if (layer()) + UpdateLayerName(name_); +} + void Window::Show() { SetVisible(true); } @@ -543,4 +538,21 @@ void Window::OnPaintLayer(gfx::Canvas* canvas) { delegate_->OnPaint(canvas); } +void Window::UpdateLayerName(const std::string& name) { +#if !defined(NDEBUG) + DCHECK(layer()); + + std::string layer_name(name_); + if (layer_name.empty()) + layer_name.append("Unnamed Window"); + + if (id_ != -1) { + char id_buf[10]; + base::snprintf(id_buf, sizeof(id_buf), " %d", id_); + layer_name.append(id_buf); + } + layer()->set_name(layer_name); +#endif +} + } // namespace aura diff --git a/ui/aura/window.h b/ui/aura/window.h index 9e1f05f..ae0ec6f 100644 --- a/ui/aura/window.h +++ b/ui/aura/window.h @@ -64,7 +64,7 @@ class AURA_EXPORT Window : public ui::LayerDelegate { void set_id(int id) { id_ = id; } const std::string& name() const { return name_; } - void set_name(const std::string& name) { name_ = name; } + void SetName(const std::string& name); const string16 title() const { return title_; } void set_title(const string16& title) { title_ = title; } @@ -297,6 +297,9 @@ class AURA_EXPORT Window : public ui::LayerDelegate { // Overridden from ui::LayerDelegate: virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE; + // Updates the layer name with a name based on the window's name and id. + void UpdateLayerName(const std::string& name); + WindowType type_; WindowDelegate* delegate_; diff --git a/ui/aura_shell/desktop_background_view.cc b/ui/aura_shell/desktop_background_view.cc index 3f26f36..25532bb 100644 --- a/ui/aura_shell/desktop_background_view.cc +++ b/ui/aura_shell/desktop_background_view.cc @@ -55,7 +55,7 @@ views::Widget* CreateDesktopBackground() { AddChild(desktop_widget->GetNativeView()); desktop_widget->SetContentsView(view); desktop_widget->Show(); - desktop_widget->GetNativeView()->set_name("DesktopBackgroundView"); + desktop_widget->GetNativeView()->SetName("DesktopBackgroundView"); return desktop_widget; } diff --git a/ui/aura_shell/launcher/launcher.cc b/ui/aura_shell/launcher/launcher.cc index 64a6c88..8b0ae38 100644 --- a/ui/aura_shell/launcher/launcher.cc +++ b/ui/aura_shell/launcher/launcher.cc @@ -38,7 +38,7 @@ Launcher::Launcher(aura::Window* window_container) widget_->SetBounds(gfx::Rect(0, 0, pref.width(), pref.height())); widget_->SetContentsView(launcher_view); widget_->Show(); - widget_->GetNativeView()->set_name("LauncherView"); + widget_->GetNativeView()->SetName("LauncherView"); } Launcher::~Launcher() { diff --git a/ui/aura_shell/modal_container_layout_manager.cc b/ui/aura_shell/modal_container_layout_manager.cc index 7961499..4ee2d11 100644 --- a/ui/aura_shell/modal_container_layout_manager.cc +++ b/ui/aura_shell/modal_container_layout_manager.cc @@ -160,7 +160,7 @@ void ModalContainerLayoutManager::CreateModalScreen() { params.bounds = gfx::Rect(0, 0, container_->bounds().width(), container_->bounds().height()); modal_screen_->Init(params); - modal_screen_->GetNativeView()->set_name( + modal_screen_->GetNativeView()->SetName( "ModalContainerLayoutManager.ModalScreen"); modal_screen_->SetContentsView(new ScreenView); modal_screen_->GetNativeView()->layer()->SetOpacity(0.0f); diff --git a/ui/aura_shell/shell_accelerator_controller.cc b/ui/aura_shell/shell_accelerator_controller.cc index 99f12a4..3453931 100644 --- a/ui/aura_shell/shell_accelerator_controller.cc +++ b/ui/aura_shell/shell_accelerator_controller.cc @@ -9,6 +9,7 @@ #include "ui/aura_shell/shell.h" #include "ui/base/accelerators/accelerator.h" #include "ui/base/accelerators/accelerator_manager.h" +#include "ui/gfx/compositor/debug_utils.h" #include "ui/gfx/compositor/layer_animation_sequence.h" #include "ui/gfx/compositor/layer_animator.h" #include "ui/gfx/compositor/screen_rotation.h" @@ -24,6 +25,7 @@ struct AcceleratorData { } kAcceleratorData[] = { { ui::VKEY_F11, false, false, false }, { ui::VKEY_HOME, false, true, false }, + { ui::VKEY_L, false, false, true }, }; // Registers the accelerators with ShellAcceleratorController. @@ -118,6 +120,10 @@ bool ShellAcceleratorController::AcceleratorPressed( accelerator.IsCtrlDown()) { RotateScreen(); return true; + } else if (accelerator.key_code() == ui::VKEY_L && + accelerator.IsAltDown()) { + ui::PrintLayerHierarchy(aura::Desktop::GetInstance()->layer()); + return true; } #endif return false; diff --git a/ui/aura_shell/status_area_view.cc b/ui/aura_shell/status_area_view.cc index 94d73ab..af95c3a 100644 --- a/ui/aura_shell/status_area_view.cc +++ b/ui/aura_shell/status_area_view.cc @@ -45,7 +45,7 @@ AURA_SHELL_EXPORT views::Widget* CreateStatusArea() { widget->Init(params); widget->SetContentsView(status_area_view); widget->Show(); - widget->GetNativeView()->set_name("StatusAreaView"); + widget->GetNativeView()->SetName("StatusAreaView"); return widget; } |