diff options
author | saintlou@chromium.org <saintlou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-22 18:45:14 +0000 |
---|---|---|
committer | saintlou@chromium.org <saintlou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-22 18:45:14 +0000 |
commit | 37aad15b91c67921d9179898acc3cad9a3349a37 (patch) | |
tree | 21651888d7b4bfb974eaf21556b9b4f2e350323d /chrome | |
parent | 48bda7e38222a5065d4042ca09e35f9d51d4c7ec (diff) | |
download | chromium_src-37aad15b91c67921d9179898acc3cad9a3349a37.zip chromium_src-37aad15b91c67921d9179898acc3cad9a3349a37.tar.gz chromium_src-37aad15b91c67921d9179898acc3cad9a3349a37.tar.bz2 |
Removed TOUCH_UI (mostly constants) from chrome/browser/ui/views.
BUG=105046
TEST=none
Review URL: http://codereview.chromium.org/8632001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111184 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
16 files changed, 7 insertions, 132 deletions
diff --git a/chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc b/chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc index 55d3e5b..37dd4ca 100644 --- a/chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc +++ b/chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc @@ -36,12 +36,7 @@ const char16 kEllipsis[] = { 0x2026, 0x0 }; // The minimum distance between the top and bottom of the {icon|text} and the // top or bottom of the row. const int kMinimumIconVerticalPadding = 2; - -#if defined(TOUCH_UI) -const int kMinimumTextVerticalPadding = 15; -#else const int kMinimumTextVerticalPadding = 3; -#endif } // namespace diff --git a/chrome/browser/ui/views/bubble/bubble.cc b/chrome/browser/ui/views/bubble/bubble.cc index 9467604..6cf7d22 100644 --- a/chrome/browser/ui/views/bubble/bubble.cc +++ b/chrome/browser/ui/views/bubble/bubble.cc @@ -372,10 +372,6 @@ void Bubble::OnActivate(UINT action, BOOL minimized, HWND window) { GetWidget()->GetRootView()->child_at(0)->RequestFocus(); } } -#elif defined(TOUCH_UI) -void Bubble::Deactivate() { - GetWidget()->Close(); -} #elif defined(TOOLKIT_USES_GTK) void Bubble::OnActiveChanged() { if (!GetWidget()->IsActive()) diff --git a/chrome/browser/ui/views/infobars/infobar_view.cc b/chrome/browser/ui/views/infobars/infobar_view.cc index b72c3a3..90ceea7 100644 --- a/chrome/browser/ui/views/infobars/infobar_view.cc +++ b/chrome/browser/ui/views/infobars/infobar_view.cc @@ -50,12 +50,7 @@ const int InfoBar::kDefaultArrowTargetHeight = 9; const int InfoBar::kMaximumArrowTargetHeight = 24; const int InfoBar::kDefaultArrowTargetHalfWidth = kDefaultArrowTargetHeight; const int InfoBar::kMaximumArrowTargetHalfWidth = 14; - -#ifdef TOUCH_UI -const int InfoBar::kDefaultBarTargetHeight = 75; -#else const int InfoBar::kDefaultBarTargetHeight = 36; -#endif const int InfoBarView::kButtonButtonSpacing = 10; const int InfoBarView::kEndOfLabelSpacing = 16; diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc index f5ba3c6..dfbe933 100644 --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc @@ -82,11 +82,7 @@ TabContents* GetTabContentsFromDelegate(LocationBarView::Delegate* delegate) { // static const int LocationBarView::kNormalHorizontalEdgeThickness = 1; const int LocationBarView::kVerticalEdgeThickness = 2; -#if defined(TOUCH_UI) -const int LocationBarView::kItemPadding = 10; -#else const int LocationBarView::kItemPadding = 3; -#endif const int LocationBarView::kIconInternalPadding = 2; const int LocationBarView::kEdgeItemPadding = kItemPadding; const int LocationBarView::kBubbleHorizontalPadding = 1; diff --git a/chrome/browser/ui/views/notifications/balloon_view_host.cc b/chrome/browser/ui/views/notifications/balloon_view_host.cc index 0b88a11..aebef32 100644 --- a/chrome/browser/ui/views/notifications/balloon_view_host.cc +++ b/chrome/browser/ui/views/notifications/balloon_view_host.cc @@ -11,10 +11,6 @@ #include "content/public/browser/content_browser_client.h" #include "ui/views/widget/widget.h" -#if defined(TOUCH_UI) && !defined(USE_AURA) -#include "chrome/browser/renderer_host/render_widget_host_view_views.h" -#endif - class BalloonViewHostView : public views::NativeViewHost { public: explicit BalloonViewHostView(BalloonViewHost* host) @@ -54,11 +50,6 @@ void BalloonViewHost::Init(gfx::NativeView parent_native_view) { RenderWidgetHostView* render_widget_host_view = tab_contents_->render_view_host()->view(); -#if defined(TOUCH_UI) && !defined(USE_AURA) - RenderWidgetHostViewViews* view_views = - static_cast<RenderWidgetHostViewViews*>(render_widget_host_view); - native_host_->AttachToView(view_views); -#else + native_host_->Attach(render_widget_host_view->GetNativeView()); -#endif } diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc index a49bcc2..8defd93 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc @@ -12,6 +12,7 @@ #include "chrome/browser/autocomplete/autocomplete_match.h" #include "chrome/browser/autocomplete/autocomplete_popup_model.h" #include "chrome/browser/command_updater.h" +#include "chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.h" #include "chrome/browser/ui/views/location_bar/location_bar_view.h" #include "chrome/common/chrome_notification_types.h" #include "content/browser/tab_contents/tab_contents.h" @@ -31,12 +32,6 @@ #include "views/border.h" #include "views/controls/textfield/textfield.h" -#if defined(TOUCH_UI) -#include "chrome/browser/ui/views/autocomplete/touch_autocomplete_popup_contents_view.h" -#else -#include "chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.h" -#endif - #if defined(OS_WIN) #include "chrome/browser/ui/views/omnibox/omnibox_view_win.h" #endif @@ -186,11 +181,6 @@ void OmniboxViewViews::Init() { textfield_->SetController(this); textfield_->SetTextInputType(ui::TEXT_INPUT_TYPE_URL); -#if defined(TOUCH_UI) - textfield_->SetFont(ui::ResourceBundle::GetSharedInstance().GetFont( - ResourceBundle::LargeFont)); -#endif - if (popup_window_mode_) textfield_->SetReadOnly(true); @@ -731,11 +721,7 @@ string16 OmniboxViewViews::GetSelectedText() const { AutocompletePopupView* OmniboxViewViews::CreatePopupView( View* location_bar) { -#if defined(TOUCH_UI) - typedef TouchAutocompletePopupContentsView AutocompleteContentsView; -#else typedef AutocompletePopupContentsView AutocompleteContentsView; -#endif return new AutocompleteContentsView(gfx::Font(), this, model_.get(), location_bar); } diff --git a/chrome/browser/ui/views/simple_message_box_views.cc b/chrome/browser/ui/views/simple_message_box_views.cc index cddfd6e..54d16c8 100644 --- a/chrome/browser/ui/views/simple_message_box_views.cc +++ b/chrome/browser/ui/views/simple_message_box_views.cc @@ -14,7 +14,7 @@ #include "ui/views/widget/widget.h" #include "views/controls/message_box_view.h" -#if defined(TOUCH_UI) || defined(USE_AURA) +#if defined(USE_AURA) #include "ui/views/focus/accelerator_handler.h" #endif @@ -158,7 +158,7 @@ bool SimpleMessageBoxViews::Dispatch(const MSG& msg) { DispatchMessage(&msg); return disposition_ == DISPOSITION_UNKNOWN; } -#elif defined(TOUCH_UI) || defined(USE_AURA) +#elif defined(USE_AURA) base::MessagePumpDispatcher::DispatchStatus SimpleMessageBoxViews::Dispatch(XEvent* xev) { if (!views::DispatchXEvent(xev)) diff --git a/chrome/browser/ui/views/simple_message_box_views.h b/chrome/browser/ui/views/simple_message_box_views.h index 5c75ccb..1424885 100644 --- a/chrome/browser/ui/views/simple_message_box_views.h +++ b/chrome/browser/ui/views/simple_message_box_views.h @@ -73,7 +73,7 @@ class SimpleMessageBoxViews : public views::DialogDelegate, // Dispatcher method. This returns true if the menu was canceled, or // if the message is such that the menu should be closed. virtual bool Dispatch(const MSG& msg) OVERRIDE; -#elif defined(TOUCH_UI) || defined(USE_AURA) +#elif defined(USE_AURA) virtual base::MessagePumpDispatcher::DispatchStatus Dispatch( XEvent* xevent) OVERRIDE; #else diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_container_native.cc b/chrome/browser/ui/views/tab_contents/tab_contents_container_native.cc index a657106..f5517aa 100644 --- a/chrome/browser/ui/views/tab_contents/tab_contents_container_native.cc +++ b/chrome/browser/ui/views/tab_contents/tab_contents_container_native.cc @@ -4,10 +4,6 @@ #include "chrome/browser/ui/views/tab_contents/tab_contents_container.h" -#if defined(TOUCH_UI) -#include <X11/extensions/XInput2.h> -#endif - #include "chrome/browser/ui/view_ids.h" #include "chrome/browser/ui/views/tab_contents/native_tab_contents_container.h" #include "content/browser/renderer_host/render_view_host.h" @@ -73,48 +69,6 @@ void TabContentsContainer::Layout() { } } -#if defined(TOUCH_UI) -bool TabContentsContainer::OnMousePressed(const views::MouseEvent& event) { - DCHECK(tab_contents_); - if (event.flags() & (ui::EF_LEFT_BUTTON_DOWN | - ui::EF_RIGHT_BUTTON_DOWN | - ui::EF_MIDDLE_BUTTON_DOWN)) { - return false; - } - // It is necessary to look at the native event to determine what special - // button was pressed. - views::NativeEvent native_event = event.native_event(); - if (!native_event) - return false; - - int button = 0; - switch (native_event->type) { - case ButtonPress: { - button = native_event->xbutton.button; - break; - } - case GenericEvent: { - XIDeviceEvent* xievent = - static_cast<XIDeviceEvent*>(native_event->xcookie.data); - button = xievent->detail; - break; - } - default: - break; - } - switch (button) { - case 8: - tab_contents_->controller().GoBack(); - return true; - case 9: - tab_contents_->controller().GoForward(); - return true; - } - - return false; -} -#endif - void TabContentsContainer::ViewHierarchyChanged(bool is_add, views::View* parent, views::View* child) { diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_container_native.h b/chrome/browser/ui/views/tab_contents/tab_contents_container_native.h index 9e56d32..f4d0edb 100644 --- a/chrome/browser/ui/views/tab_contents/tab_contents_container_native.h +++ b/chrome/browser/ui/views/tab_contents/tab_contents_container_native.h @@ -49,9 +49,6 @@ class TabContentsContainer : public views::View, // Overridden from views::View: virtual void Layout() OVERRIDE; virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; -#if defined(TOUCH_UI) - virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; -#endif protected: // Overridden from views::View: diff --git a/chrome/browser/ui/views/tabs/dragged_tab_controller.cc b/chrome/browser/ui/views/tabs/dragged_tab_controller.cc index 01790b4..d9694c2 100644 --- a/chrome/browser/ui/views/tabs/dragged_tab_controller.cc +++ b/chrome/browser/ui/views/tabs/dragged_tab_controller.cc @@ -505,7 +505,7 @@ void DraggedTabController::Observe( /////////////////////////////////////////////////////////////////////////////// // DraggedTabController, MessageLoop::Observer implementation: -#if defined(OS_WIN) || defined(TOUCH_UI) || defined(USE_AURA) +#if defined(OS_WIN) || defined(USE_AURA) base::EventStatus DraggedTabController::WillProcessEvent( const base::NativeEvent& event) { return base::EVENT_CONTINUE; diff --git a/chrome/browser/ui/views/tabs/dragged_tab_controller.h b/chrome/browser/ui/views/tabs/dragged_tab_controller.h index 910436b..5b06d2c 100644 --- a/chrome/browser/ui/views/tabs/dragged_tab_controller.h +++ b/chrome/browser/ui/views/tabs/dragged_tab_controller.h @@ -157,7 +157,7 @@ class DraggedTabController : public TabContentsDelegate, const content::NotificationDetails& details) OVERRIDE; // Overridden from MessageLoop::Observer: -#if defined(OS_WIN) || defined(TOUCH_UI) || defined(USE_AURA) +#if defined(OS_WIN) || defined(USE_AURA) virtual base::EventStatus WillProcessEvent( const base::NativeEvent& event) OVERRIDE; virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE; diff --git a/chrome/browser/ui/views/tabs/tab.cc b/chrome/browser/ui/views/tabs/tab.cc index 10f02b0..f5f244c 100644 --- a/chrome/browser/ui/views/tabs/tab.cc +++ b/chrome/browser/ui/views/tabs/tab.cc @@ -39,13 +39,8 @@ static const int kFaviconTitleSpacing = 4; static const int kTitleCloseButtonSpacing = 3; static const int kStandardTitleWidth = 175; static const int kCloseButtonVertFuzz = 0; -#if defined(TOUCH_UI) -static const int kTabIconSize = 32; -static const int kCloseButtonHorzFuzz = -10; -#else static const int kTabIconSize = gfx::kFaviconSize; static const int kCloseButtonHorzFuzz = 5; -#endif // Vertical adjustment to the favicon when the tab has a large icon. static const int kAppTapFaviconVerticalAdjustment = 2; diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc index 1897721..457e892 100644 --- a/chrome/browser/ui/views/tabs/tab_strip.cc +++ b/chrome/browser/ui/views/tabs/tab_strip.cc @@ -91,18 +91,6 @@ class NewTabButton : public views::ImageButton { // These values are defined by the shape of the new tab bitmap. Should that // bitmap ever change, these values will need to be updated. They're so // custom it's not really worth defining constants for. -#if defined(TOUCH_UI) - // touch_newtab.png size is different from newtab.png. - // Change the values for TOUCH_UI as per touch_newtab.png. - path->moveTo(0, 1); - path->lineTo(w - 14, 1); - path->lineTo(w - 10, 6); - path->lineTo(w - 7, 28); - path->lineTo(w - 1, 32); - path->lineTo(11, 32); - path->lineTo(7, 28); - path->lineTo(0, 1); -#else path->moveTo(0, 1); path->lineTo(w - 7, 1); path->lineTo(w - 4, 4); @@ -111,7 +99,6 @@ class NewTabButton : public views::ImageButton { path->lineTo(7, 17); path->lineTo(4, 13); path->lineTo(0, 1); -#endif path->close(); } diff --git a/chrome/browser/ui/views/tabs/tab_strip.h b/chrome/browser/ui/views/tabs/tab_strip.h index 0f71a4d..269a2b8 100644 --- a/chrome/browser/ui/views/tabs/tab_strip.h +++ b/chrome/browser/ui/views/tabs/tab_strip.h @@ -258,13 +258,8 @@ class TabStrip : public BaseTabStrip, // able to lay it out before we are able to get its image from the // ui::ThemeProvider. It also makes sense to do this, because the size of the // new tab button should not need to be calculated dynamically. -#if defined(TOUCH_UI) - static const int kNewTabButtonWidth = 66; - static const int kNewTabButtonHeight = 39; -#else static const int kNewTabButtonWidth = 28; static const int kNewTabButtonHeight = 18; -#endif // Valid for the lifetime of a drag over us. scoped_ptr<DropInfo> drop_info_; diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc index 123bbf0..74907b8 100644 --- a/chrome/browser/ui/views/toolbar_view.cc +++ b/chrome/browser/ui/views/toolbar_view.cc @@ -79,11 +79,6 @@ static const int kPopupBottomSpacingGlass = 1; // corner of the wrench menu). static const int kBadgeTopMargin = 2; -#if defined(TOUCH_UI) -// Extra vertical padding above the location bar. -static const int kExtraVerticalPadding = 3; -#endif - static SkBitmap* kPopupBackgroundEdge = NULL; //////////////////////////////////////////////////////////////////////////////// @@ -541,15 +536,8 @@ void ToolbarView::Layout() { int location_x = home_->x() + home_->width() + kStandardSpacing; int available_width = width() - kEdgeSpacing - app_menu_width - browser_actions_width - location_x; - -#if defined(TOUCH_UI) - // Center the location bar vertically. - int location_y = std::min(child_y + kExtraVerticalPadding, height()); - int location_bar_height = std::max(height() - 2 * location_y, 0); -#else int location_y = child_y; int location_bar_height = child_height; -#endif location_bar_->SetBounds(location_x, location_y, std::max(available_width, 0), location_bar_height); |