diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-17 20:50:43 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-17 20:50:43 +0000 |
commit | e4cc6eb80a8359cba5c9f150ac13800b8fc75d36 (patch) | |
tree | 0a223e43de9039644a945316b11249ec1eebb2d8 /chrome | |
parent | f190829779ea89e1303ebbc18ff56bc2fb8eb862 (diff) | |
download | chromium_src-e4cc6eb80a8359cba5c9f150ac13800b8fc75d36.zip chromium_src-e4cc6eb80a8359cba5c9f150ac13800b8fc75d36.tar.gz chromium_src-e4cc6eb80a8359cba5c9f150ac13800b8fc75d36.tar.bz2 |
Remove compact navbar: 1st step.
Remove menu, accelerator and tests.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/2812007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50135 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
5 files changed, 1 insertions, 174 deletions
diff --git a/chrome/browser/chromeos/compact_location_bar_host_browsertest.cc b/chrome/browser/chromeos/compact_location_bar_host_browsertest.cc deleted file mode 100644 index 7c4c4af..0000000 --- a/chrome/browser/chromeos/compact_location_bar_host_browsertest.cc +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) 2010 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. - -#include "chrome/browser/automation/ui_controls.h" -#include "chrome/browser/browser.h" -#include "chrome/browser/browser_process.h" -#include "chrome/browser/chromeos/compact_location_bar_host.h" -#include "chrome/browser/chromeos/frame/browser_view.h" -#include "chrome/browser/chromeos/view_ids.h" -#include "chrome/test/in_process_browser_test.h" -#include "chrome/test/ui_test_utils.h" -#include "views/widget/widget.h" -#include "views/window/window.h" - -namespace chromeos { - -class CompactLocationBarHostTest : public InProcessBrowserTest { - public: - CompactLocationBarHostTest() { - } - - virtual void SetUp() { - // Don't animate during the test. - DropdownBarHost::disable_animations_during_testing_ = true; - InProcessBrowserTest::SetUp(); - } - - BrowserView* browser_view() const { - return static_cast<BrowserView*>(browser()->window()); - } - - gfx::NativeWindow window() const { - return browser_view()->GetNativeHandle(); - } - - CompactLocationBarHost* clb_host() const { - return browser_view()->compact_location_bar_host(); - } - - bool IsViewIdVisible(int id) const { - return browser_view()->GetViewByID(id)->IsVisible(); - } - - bool IsCurrentTabIndex(int index) { - return clb_host()->IsCurrentTabIndex(index); - } - - private: - DISALLOW_COPY_AND_ASSIGN(CompactLocationBarHostTest); -}; - -IN_PROC_BROWSER_TEST_F(CompactLocationBarHostTest, TestCtrlLOpen) { - // ctrl-l should not open compact location bar in normal mode. - ui_controls::SendKeyPress(window(), base::VKEY_L, true, false, false, false); - ui_test_utils::RunAllPendingInMessageLoop(); - EXPECT_TRUE(IsCurrentTabIndex(-1)); - EXPECT_FALSE(clb_host()->IsVisible()); - - browser()->ToggleCompactNavigationBar(); - ui_test_utils::RunAllPendingInMessageLoop(); - EXPECT_TRUE(IsCurrentTabIndex(-1)); - EXPECT_FALSE(clb_host()->IsVisible()); - - // ctrl-l should not open compact location bar in compact nav mode. - ui_controls::SendKeyPress(window(), base::VKEY_L, true, false, false, false); - ui_test_utils::RunAllPendingInMessageLoop(); - EXPECT_TRUE(IsCurrentTabIndex(0)); - EXPECT_TRUE(clb_host()->IsVisible()); - - // Esc to close it. - ui_controls::SendKeyPress(window(), base::VKEY_ESCAPE, - false, false, false, false); - ui_test_utils::RunAllPendingInMessageLoop(); - EXPECT_TRUE(IsCurrentTabIndex(0)); - EXPECT_FALSE(clb_host()->IsVisible()); -} - -IN_PROC_BROWSER_TEST_F(CompactLocationBarHostTest, TestOnNewTab) { - browser()->ToggleCompactNavigationBar(); - ui_controls::SendKeyPress(window(), base::VKEY_L, true, false, false, false); - ui_test_utils::RunAllPendingInMessageLoop(); - EXPECT_TRUE(IsCurrentTabIndex(0)); - EXPECT_TRUE(clb_host()->IsVisible()); - - browser()->NewTab(); - ui_test_utils::RunAllPendingInMessageLoop(); - - // See http://crbug.com/39858 for details. - //EXPECT_FALSE(clb_host()->IsVisible()); - - ui_controls::SendKeyPress(window(), base::VKEY_L, true, false, false, false); - ui_test_utils::RunAllPendingInMessageLoop(); - EXPECT_TRUE(IsCurrentTabIndex(1)); - EXPECT_TRUE(clb_host()->IsVisible()); -} - -} // namespace chromeos diff --git a/chrome/browser/chromeos/compact_navigation_bar_browsertest.cc b/chrome/browser/chromeos/compact_navigation_bar_browsertest.cc deleted file mode 100644 index 5194b2fb9..0000000 --- a/chrome/browser/chromeos/compact_navigation_bar_browsertest.cc +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) 2010 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. - -#include "chrome/browser/automation/ui_controls.h" -#include "chrome/browser/browser.h" -#include "chrome/browser/browser_process.h" -#include "chrome/browser/chromeos/frame/browser_view.h" -#include "chrome/browser/chromeos/view_ids.h" -#include "chrome/test/in_process_browser_test.h" -#include "chrome/test/ui_test_utils.h" -#include "views/widget/widget.h" -#include "views/window/window.h" - -namespace chromeos { - -class CompactNavigationBarTest : public InProcessBrowserTest { - public: - CompactNavigationBarTest() { - } - - BrowserView* browser_view() const { - return static_cast<BrowserView*>(browser()->window()); - } - - bool IsViewIdVisible(int id) const { - return browser_view()->GetViewByID(id)->IsVisible(); - } - - private: - DISALLOW_COPY_AND_ASSIGN(CompactNavigationBarTest); -}; - -IN_PROC_BROWSER_TEST_F(CompactNavigationBarTest, TestBasic) { - EXPECT_FALSE(IsViewIdVisible(VIEW_ID_COMPACT_NAV_BAR)); - EXPECT_TRUE(IsViewIdVisible(VIEW_ID_TOOLBAR)); - - browser()->ToggleCompactNavigationBar(); - EXPECT_TRUE(IsViewIdVisible(VIEW_ID_COMPACT_NAV_BAR)); - EXPECT_FALSE(IsViewIdVisible(VIEW_ID_TOOLBAR)); - - browser()->ToggleCompactNavigationBar(); - EXPECT_FALSE(IsViewIdVisible(VIEW_ID_COMPACT_NAV_BAR)); - EXPECT_TRUE(IsViewIdVisible(VIEW_ID_TOOLBAR)); -} - -IN_PROC_BROWSER_TEST_F(CompactNavigationBarTest, TestAccelerator) { - EXPECT_FALSE(IsViewIdVisible(VIEW_ID_COMPACT_NAV_BAR)); - - gfx::NativeWindow window = browser()->window()->GetNativeHandle(); - - // ctrl-shift-c should toggle compact navigation bar. - ui_controls::SendKeyPress(window, base::VKEY_C, true, true, false, false); - ui_test_utils::RunAllPendingInMessageLoop(); - EXPECT_TRUE(IsViewIdVisible(VIEW_ID_COMPACT_NAV_BAR)); - - ui_controls::SendKeyPress(window, base::VKEY_C, true, true, false, false); - ui_test_utils::RunAllPendingInMessageLoop(); - EXPECT_FALSE(IsViewIdVisible(VIEW_ID_COMPACT_NAV_BAR)); - - // but ctrl-alt-c should not. - ui_controls::SendKeyPress(window, base::VKEY_C, true, false, true, false); - ui_test_utils::RunAllPendingInMessageLoop(); - EXPECT_FALSE(IsViewIdVisible(VIEW_ID_COMPACT_NAV_BAR)); -} - -} // namespace chromeos diff --git a/chrome/browser/chromeos/status/browser_status_area_view.cc b/chrome/browser/chromeos/status/browser_status_area_view.cc index 2f39e08..9518fc1 100644 --- a/chrome/browser/chromeos/status/browser_status_area_view.cc +++ b/chrome/browser/chromeos/status/browser_status_area_view.cc @@ -43,7 +43,6 @@ class OptionsMenuModel : public menus::SimpleMenuModel, browser_view_(browser_view) { AddCheckItemWithStringId(IDC_TOGGLE_VERTICAL_TABS, IDS_TAB_CXMENU_USE_VERTICAL_TABS); - AddCheckItemWithStringId(IDC_COMPACT_NAVBAR, IDS_COMPACT_NAVBAR); AddSeparator(); AddCheckItem(static_cast<int>(StatusAreaView::OPEN_TABS_ON_LEFT), @@ -60,8 +59,6 @@ class OptionsMenuModel : public menus::SimpleMenuModel, virtual bool IsCommandIdChecked(int command_id) const { if (command_id == IDC_TOGGLE_VERTICAL_TABS) return browser_view_->UseVerticalTabs(); - if (command_id == IDC_COMPACT_NAVBAR) - return browser_view_->is_compact_style(); return StatusAreaView::GetOpenTabsMode() == command_id; } virtual bool IsCommandIdEnabled(int command_id) const { @@ -70,13 +67,11 @@ class OptionsMenuModel : public menus::SimpleMenuModel, virtual bool GetAcceleratorForCommandId( int command_id, menus::Accelerator* accelerator) { - return command_id == IDC_COMPACT_NAVBAR ? - browser_view_->GetAccelerator(command_id, accelerator) : false; + return false; } virtual void ExecuteCommand(int command_id) { switch (command_id) { case IDC_TOGGLE_VERTICAL_TABS: - case IDC_COMPACT_NAVBAR: browser_view_->browser()->ExecuteCommand(command_id); break; case StatusAreaView::OPEN_TABS_ON_LEFT: diff --git a/chrome/browser/views/accelerator_table_gtk.cc b/chrome/browser/views/accelerator_table_gtk.cc index 3edd0e9..f755de7 100644 --- a/chrome/browser/views/accelerator_table_gtk.cc +++ b/chrome/browser/views/accelerator_table_gtk.cc @@ -136,7 +136,6 @@ const AcceleratorMapping kAcceleratorMap[] = { { base::VKEY_F, false, false, true, IDC_SHOW_APP_MENU}, { base::VKEY_E, false, false, true, IDC_SHOW_PAGE_MENU}, #if defined(OS_CHROMEOS) - { base::VKEY_C, true, true, false, IDC_COMPACT_NAVBAR }, { base::VKEY_F, false, true, true, IDC_FULLSCREEN }, { base::VKEY_LWIN, false, false, false, IDC_SEARCH }, #endif diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index 19dc485..ccbed6b 100755 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -1460,8 +1460,6 @@ }], ['OS=="linux" and chromeos==1', { 'sources': [ - 'browser/chromeos/compact_location_bar_host_browsertest.cc', - 'browser/chromeos/compact_navigation_bar_browsertest.cc', 'browser/chromeos/cros/cros_in_process_browser_test.cc', 'browser/chromeos/cros/cros_in_process_browser_test.h', 'browser/chromeos/cros/mock_cros_library.h', |