Commit 37aad15b authored by saintlou@chromium.org's avatar saintlou@chromium.org

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
parent 48bda7e3
......@@ -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
......
......@@ -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())
......
......@@ -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;
......
......@@ -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;
......
......@@ -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
}
......@@ -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);
}
......
......@@ -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))
......
......@@ -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
......
......@@ -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) {
......
......@@ -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:
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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();
}
......
......@@ -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_;
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment