Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: ash/shelf/shelf_tooltip_manager.cc

Issue 413433002: Refactor BubbleDelegateView::use_focuseless() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't reopen the bubble without good reason Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ash/shelf/shelf_tooltip_manager.h" 5 #include "ash/shelf/shelf_tooltip_manager.h"
6 6
7 #include "ash/shelf/shelf_layout_manager.h" 7 #include "ash/shelf/shelf_layout_manager.h"
8 #include "ash/shelf/shelf_view.h" 8 #include "ash/shelf/shelf_view.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 kArrowOffsetTopBottom, 78 kArrowOffsetTopBottom,
79 kArrowOffsetLeftRight); 79 kArrowOffsetLeftRight);
80 // Shelf items can have an asymmetrical border for spacing reasons. 80 // Shelf items can have an asymmetrical border for spacing reasons.
81 // Adjust anchor location for this. 81 // Adjust anchor location for this.
82 if (anchor->border()) 82 if (anchor->border())
83 insets += anchor->border()->GetInsets(); 83 insets += anchor->border()->GetInsets();
84 84
85 set_anchor_view_insets(insets); 85 set_anchor_view_insets(insets);
86 set_close_on_esc(false); 86 set_close_on_esc(false);
87 set_close_on_deactivate(false); 87 set_close_on_deactivate(false);
88 set_use_focusless(true); 88 set_can_activate(false);
89 set_accept_events(false); 89 set_accept_events(false);
90 set_margins(gfx::Insets(kTooltipTopBottomMargin, kTooltipLeftRightMargin, 90 set_margins(gfx::Insets(kTooltipTopBottomMargin, kTooltipLeftRightMargin,
91 kTooltipTopBottomMargin, kTooltipLeftRightMargin)); 91 kTooltipTopBottomMargin, kTooltipLeftRightMargin));
92 set_shadow(views::BubbleBorder::SMALL_SHADOW); 92 set_shadow(views::BubbleBorder::SMALL_SHADOW);
93 SetLayoutManager(new views::FillLayout()); 93 SetLayoutManager(new views::FillLayout());
94 // The anchor may not have the widget in tests. 94 // The anchor may not have the widget in tests.
95 if (anchor->GetWidget() && anchor->GetWidget()->GetNativeView()) { 95 if (anchor->GetWidget() && anchor->GetWidget()->GetNativeView()) {
96 aura::Window* root_window = 96 aura::Window* root_window =
97 anchor->GetWidget()->GetNativeView()->GetRootWindow(); 97 anchor->GetWidget()->GetNativeView()->GetRootWindow();
98 set_parent_window(ash::Shell::GetInstance()->GetContainer( 98 set_parent_window(ash::Shell::GetInstance()->GetContainer(
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 base::OneShotTimer<ShelfTooltipManager>* new_timer = 366 base::OneShotTimer<ShelfTooltipManager>* new_timer =
367 new base::OneShotTimer<ShelfTooltipManager>(); 367 new base::OneShotTimer<ShelfTooltipManager>();
368 new_timer->Start(FROM_HERE, 368 new_timer->Start(FROM_HERE,
369 base::TimeDelta::FromMilliseconds(delay_in_ms), 369 base::TimeDelta::FromMilliseconds(delay_in_ms),
370 this, 370 this,
371 &ShelfTooltipManager::ShowInternal); 371 &ShelfTooltipManager::ShowInternal);
372 timer_.reset(new_timer); 372 timer_.reset(new_timer);
373 } 373 }
374 374
375 } // namespace ash 375 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698