Skip to content

Commit

Permalink
[win] Make app launcher border not steal mouse clicks
Browse files Browse the repository at this point in the history
Now clicking on the shadowy bit will go through to whatever is underneath.

TBR=sky for trivial ash change
BUG=166975, 170073

Review URL: https://chromiumcodereview.appspot.com/12335124

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185097 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
benwells@chromium.org committed Feb 28, 2013
1 parent 67d94f4 commit 88d2d18
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 4 deletions.
3 changes: 2 additions & 1 deletion ash/wm/app_list_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ void AppListController::SetVisible(bool visible, aura::Window* window) {
pagination_model_.get(),
Launcher::ForWindow(container)->GetAppListButtonView(),
gfx::Point(),
GetBubbleArrowLocation(container));
GetBubbleArrowLocation(container),
true /* border_accepts_events */);
SetView(view);
}
}
Expand Down
3 changes: 2 additions & 1 deletion chrome/browser/ui/views/app_list/app_list_controller_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,8 @@ void AppListController::PopulateViewFromProfile(Profile* profile) {
&pagination_model_,
NULL,
cursor,
views::BubbleBorder::BOTTOM_LEFT);
views::BubbleBorder::FLOAT,
false /* border_accepts_events */);
HWND hwnd = GetAppListHWND();

ui::win::SetAppIdForWindow(GetAppModelId(), hwnd);
Expand Down
4 changes: 3 additions & 1 deletion ui/app_list/views/app_list_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ void AppListView::InitAsBubble(
PaginationModel* pagination_model,
views::View* anchor,
const gfx::Point& anchor_point,
views::BubbleBorder::ArrowLocation arrow_location) {
views::BubbleBorder::ArrowLocation arrow_location,
bool border_accepts_events) {

app_list_main_view_ = new AppListMainView(delegate_.get(),
model_.get(),
Expand Down Expand Up @@ -87,6 +88,7 @@ void AppListView::InitAsBubble(
set_close_on_esc(false);
set_anchor_insets(gfx::Insets(kArrowOffset, kArrowOffset,
kArrowOffset, kArrowOffset));
set_border_accepts_events(border_accepts_events);
set_shadow(views::BubbleBorder::BIG_SHADOW);
views::BubbleDelegateView::CreateBubble(this);
SetBubbleArrowLocation(arrow_location);
Expand Down
3 changes: 2 additions & 1 deletion ui/app_list/views/app_list_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ class APP_LIST_EXPORT AppListView : public views::BubbleDelegateView,
PaginationModel* pagination_model,
views::View* anchor,
const gfx::Point& anchor_point,
views::BubbleBorder::ArrowLocation arrow_location);
views::BubbleBorder::ArrowLocation arrow_location,
bool border_accepts_events);

void SetBubbleArrowLocation(
views::BubbleBorder::ArrowLocation arrow_location);
Expand Down
3 changes: 3 additions & 0 deletions ui/views/bubble/bubble_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ Widget* CreateBorderWidget(BubbleDelegateView* bubble) {
border_params.transparent = true;
border_params.parent = bubble->GetWidget()->GetNativeView();
border_params.can_activate = false;
border_params.accept_events = bubble->border_accepts_events();
border_widget->Init(border_params);
border_widget->set_focus_on_creation(false);
return border_widget;
Expand All @@ -113,6 +114,7 @@ BubbleDelegateView::BubbleDelegateView()
border_widget_(NULL),
use_focusless_(false),
accept_events_(true),
border_accepts_events_(true),
adjust_if_offscreen_(true),
parent_window_(NULL) {
AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE));
Expand All @@ -135,6 +137,7 @@ BubbleDelegateView::BubbleDelegateView(
border_widget_(NULL),
use_focusless_(false),
accept_events_(true),
border_accepts_events_(true),
adjust_if_offscreen_(true),
parent_window_(NULL) {
AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE));
Expand Down
9 changes: 9 additions & 0 deletions ui/views/bubble/bubble_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView,
bool accept_events() const { return accept_events_; }
void set_accept_events(bool accept_events) { accept_events_ = accept_events; }

bool border_accepts_events() const { return border_accepts_events_; }
void set_border_accepts_events(bool accept) {
border_accepts_events_ = accept;
}

bool adjust_if_offscreen() const { return adjust_if_offscreen_; }
void set_adjust_if_offscreen(bool adjust) { adjust_if_offscreen_ = adjust; }

Expand Down Expand Up @@ -212,6 +217,10 @@ class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView,
// Specifies whether the popup accepts events or lets them pass through.
bool accept_events_;

// Specifies whether the bubble border accepts events or lets them pass
// through.
bool border_accepts_events_;

// If true (defaults to true), the arrow may be mirrored and moved to fit the
// bubble on screen better. It would be a no-op if the bubble has no arrow.
bool adjust_if_offscreen_;
Expand Down

0 comments on commit 88d2d18

Please sign in to comment.