Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(262)

Unified Diff: ash/launcher/launcher.cc

Issue 9817026: Changes how we detect whether the launcher should be shown when (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comment Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/system/tray/system_tray.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/launcher/launcher.cc
diff --git a/ash/launcher/launcher.cc b/ash/launcher/launcher.cc
index 2094fc5b775f093e084fa129522c058b076407f6..a38b5367c3d7574fb34d0aa85e26e5b987664b02 100644
--- a/ash/launcher/launcher.cc
+++ b/ash/launcher/launcher.cc
@@ -12,7 +12,6 @@
#include "ash/shell_delegate.h"
#include "ash/shell_window_ids.h"
#include "ash/wm/shelf_layout_manager.h"
-#include "base/timer.h"
#include "ui/aura/window.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/compositor/layer.h"
@@ -26,9 +25,6 @@ namespace ash {
namespace {
-// Delay before showing the launcher after the mouse enters the view.
-const int kShowDelayMS = 300;
-
// Max alpha of the background.
const int kBackgroundAlpha = 128;
@@ -52,8 +48,6 @@ class Launcher::DelegateView : public views::WidgetDelegate,
// views::View overrides
virtual gfx::Size GetPreferredSize() OVERRIDE;
virtual void Layout() OVERRIDE;
- virtual void OnMouseEntered(const views::MouseEvent& event) OVERRIDE;
- virtual void OnMouseExited(const views::MouseEvent& event) OVERRIDE;
// views::WidgetDelegateView overrides:
virtual views::Widget* GetWidget() OVERRIDE {
@@ -69,9 +63,6 @@ class Launcher::DelegateView : public views::WidgetDelegate,
}
private:
- // Shows the launcher.
- void ShowLauncher();
-
Launcher* launcher_;
// Width of the status area.
@@ -79,8 +70,6 @@ class Launcher::DelegateView : public views::WidgetDelegate,
const internal::FocusCycler* focus_cycler_;
- base::OneShotTimer<DelegateView> show_timer_;
-
DISALLOW_COPY_AND_ASSIGN(DelegateView);
};
@@ -88,7 +77,6 @@ Launcher::DelegateView::DelegateView(Launcher* launcher)
: launcher_(launcher),
status_width_(0),
focus_cycler_(NULL) {
- set_notify_enter_exit_on_child(true);
}
Launcher::DelegateView::~DelegateView() {
@@ -112,31 +100,6 @@ void Launcher::DelegateView::Layout() {
child_at(0)->SetBounds(0, 0, std::max(0, width() - status_width_), height());
}
-void Launcher::DelegateView::OnMouseEntered(const views::MouseEvent& event) {
- if (!show_timer_.IsRunning()) {
- // The user may be trying to target a button near the bottom of the screen
- // and accidentally moved into the launcher area. Delay showing.
- show_timer_.Start(FROM_HERE,
- base::TimeDelta::FromMilliseconds(kShowDelayMS),
- this, &DelegateView::ShowLauncher);
- }
-}
-
-void Launcher::DelegateView::OnMouseExited(const views::MouseEvent& event) {
- show_timer_.Stop();
- internal::ShelfLayoutManager* shelf = Shell::GetInstance()->shelf();
- shelf->SetState(shelf->visibility_state(),
- internal::ShelfLayoutManager::AUTO_HIDE_HIDDEN);
-}
-
-void Launcher::DelegateView::ShowLauncher() {
- show_timer_.Stop();
- internal::ShelfLayoutManager* shelf = Shell::GetInstance()->shelf();
- shelf->SetState(shelf->visibility_state(),
- internal::ShelfLayoutManager::AUTO_HIDE_SHOWN);
-}
-
-
// Launcher --------------------------------------------------------------------
Launcher::Launcher(aura::Window* window_container)
« no previous file with comments | « no previous file | ash/system/tray/system_tray.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698