| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/views/ash/tab_scrubber.h" | 5 #include "chrome/browser/ui/views/ash/tab_scrubber.h" |
| 6 | 6 |
| 7 #include "ash/display/event_transformation_handler.h" | 7 #include "ash/display/event_transformation_handler.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 namespace { | 34 namespace { |
| 35 | 35 |
| 36 class TabScrubberTest : public InProcessBrowserTest, | 36 class TabScrubberTest : public InProcessBrowserTest, |
| 37 public TabStripModelObserver { | 37 public TabStripModelObserver { |
| 38 public: | 38 public: |
| 39 TabScrubberTest() | 39 TabScrubberTest() |
| 40 : target_index_(-1) { | 40 : target_index_(-1) { |
| 41 } | 41 } |
| 42 | 42 |
| 43 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 43 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 44 #if defined(OS_CHROMEOS) |
| 45 command_line->AppendSwitch(chromeos::switches::kNaturalScrollDefault); |
| 46 #endif |
| 44 command_line->AppendSwitch(switches::kOpenAsh); | 47 command_line->AppendSwitch(switches::kOpenAsh); |
| 45 } | 48 } |
| 46 | 49 |
| 47 virtual void SetUpOnMainThread() OVERRIDE { | 50 virtual void SetUpOnMainThread() OVERRIDE { |
| 48 TabScrubber::GetInstance()->set_activation_delay(0); | 51 TabScrubber::GetInstance()->set_activation_delay(0); |
| 49 | 52 |
| 50 // Disable external monitor scaling of coordinates. | 53 // Disable external monitor scaling of coordinates. |
| 51 ash::Shell* shell = ash::Shell::GetInstance(); | 54 ash::Shell* shell = ash::Shell::GetInstance(); |
| 52 shell->event_transformation_handler()->set_transformation_mode( | 55 shell->event_transformation_handler()->set_transformation_mode( |
| 53 ash::internal::EventTransformationHandler::TRANSFORM_NONE); | 56 ash::internal::EventTransformationHandler::TRANSFORM_NONE); |
| 54 | |
| 55 ui::SetNaturalScroll(true); | |
| 56 } | 57 } |
| 57 | 58 |
| 58 virtual void CleanUpOnMainThread() OVERRIDE { | 59 virtual void CleanUpOnMainThread() OVERRIDE { |
| 59 browser()->tab_strip_model()->RemoveObserver(this); | 60 browser()->tab_strip_model()->RemoveObserver(this); |
| 60 } | 61 } |
| 61 | 62 |
| 62 TabStrip* GetTabStrip(Browser* browser) { | 63 TabStrip* GetTabStrip(Browser* browser) { |
| 63 aura::Window* window = browser->window()->GetNativeWindow(); | 64 aura::Window* window = browser->window()->GetNativeWindow(); |
| 64 return BrowserView::GetBrowserViewForNativeWindow(window)->tabstrip(); | 65 return BrowserView::GetBrowserViewForNativeWindow(window)->tabstrip(); |
| 65 } | 66 } |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 IN_PROC_BROWSER_TEST_F(TabScrubberTest, CloseBrowser) { | 415 IN_PROC_BROWSER_TEST_F(TabScrubberTest, CloseBrowser) { |
| 415 AddTabs(browser(), 1); | 416 AddTabs(browser(), 1); |
| 416 | 417 |
| 417 SendScrubEvent(browser(), 0); | 418 SendScrubEvent(browser(), 0); |
| 418 EXPECT_TRUE(TabScrubber::GetInstance()->IsActivationPending()); | 419 EXPECT_TRUE(TabScrubber::GetInstance()->IsActivationPending()); |
| 419 browser()->window()->Close(); | 420 browser()->window()->Close(); |
| 420 EXPECT_FALSE(TabScrubber::GetInstance()->IsActivationPending()); | 421 EXPECT_FALSE(TabScrubber::GetInstance()->IsActivationPending()); |
| 421 } | 422 } |
| 422 | 423 |
| 423 #endif // OS_CHROMEOS | 424 #endif // OS_CHROMEOS |
| OLD | NEW |