summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-30 16:26:54 +0000
committerpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-30 16:26:54 +0000
commit751459731324e2db0b5a04f205c2407ee1fb687d (patch)
treeb98dbc59caae06369e39942a59acd158eacccb54 /ui
parenta439881b91daa0843f0e7fd01dd54b64f4f73799 (diff)
downloadchromium_src-751459731324e2db0b5a04f205c2407ee1fb687d.zip
chromium_src-751459731324e2db0b5a04f205c2407ee1fb687d.tar.gz
chromium_src-751459731324e2db0b5a04f205c2407ee1fb687d.tar.bz2
Revert 112232 - Added hotkey support to 8508009
Alt-L (print layer tree) Added name in RenderWidgetHostViewAura Made Window::SetName update the layer name. Review URL: http://codereview.chromium.org/8585007 TBR=pkotwicz@chromium.org Review URL: http://codereview.chromium.org/8741018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112234 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/aura/desktop.cc2
-rw-r--r--ui/aura/window.cc38
-rw-r--r--ui/aura/window.h5
-rw-r--r--ui/aura_shell/desktop_background_view.cc2
-rw-r--r--ui/aura_shell/launcher/launcher.cc2
-rw-r--r--ui/aura_shell/modal_container_layout_manager.cc2
-rw-r--r--ui/aura_shell/shell_accelerator_controller.cc6
-rw-r--r--ui/aura_shell/status_area_view.cc2
8 files changed, 19 insertions, 40 deletions
diff --git a/ui/aura/desktop.cc b/ui/aura/desktop.cc
index 17e63b9..59cd962 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) {
- SetName("RootWindow");
+ set_name("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 995dd27..6b4c5d2 100644
--- a/ui/aura/window.cc
+++ b/ui/aura/window.cc
@@ -78,7 +78,19 @@ void Window::Init(ui::Layer::LayerType layer_type) {
layer_.reset(new ui::Layer(layer_type));
layer_->SetVisible(false);
layer_->set_delegate(this);
- UpdateLayerName(name_);
+
+#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
Desktop::GetInstance()->WindowInitialized(this);
}
@@ -89,13 +101,6 @@ 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);
}
@@ -538,21 +543,4 @@ 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 ae0ec6f..9e1f05f 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 SetName(const std::string& name);
+ void set_name(const std::string& name) { name_ = name; }
const string16 title() const { return title_; }
void set_title(const string16& title) { title_ = title; }
@@ -297,9 +297,6 @@ 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 25532bb..3f26f36 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()->SetName("DesktopBackgroundView");
+ desktop_widget->GetNativeView()->set_name("DesktopBackgroundView");
return desktop_widget;
}
diff --git a/ui/aura_shell/launcher/launcher.cc b/ui/aura_shell/launcher/launcher.cc
index 8b0ae38..64a6c88 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()->SetName("LauncherView");
+ widget_->GetNativeView()->set_name("LauncherView");
}
Launcher::~Launcher() {
diff --git a/ui/aura_shell/modal_container_layout_manager.cc b/ui/aura_shell/modal_container_layout_manager.cc
index 4ee2d11..7961499 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()->SetName(
+ modal_screen_->GetNativeView()->set_name(
"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 3453931..99f12a4 100644
--- a/ui/aura_shell/shell_accelerator_controller.cc
+++ b/ui/aura_shell/shell_accelerator_controller.cc
@@ -9,7 +9,6 @@
#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"
@@ -25,7 +24,6 @@ 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.
@@ -120,10 +118,6 @@ 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 af95c3a..94d73ab 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()->SetName("StatusAreaView");
+ widget->GetNativeView()->set_name("StatusAreaView");
return widget;
}