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

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

Issue 1743493002: Cleanup ash shelf accessor functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert ash/shelf/shelf_widget.cc for browser_tests crash... Created 4 years, 9 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
« no previous file with comments | « ash/shelf/shelf_layout_manager_unittest.cc ('k') | ash/shelf/shelf_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.h"
7 #include "ash/shelf/shelf_layout_manager.h" 8 #include "ash/shelf/shelf_layout_manager.h"
8 #include "ash/shelf/shelf_view.h" 9 #include "ash/shelf/shelf_view.h"
9 #include "ash/shell.h" 10 #include "ash/shell.h"
10 #include "ash/shell_window_ids.h" 11 #include "ash/shell_window_ids.h"
11 #include "ash/wm/window_animations.h" 12 #include "ash/wm/window_animations.h"
12 #include "base/bind.h" 13 #include "base/bind.h"
13 #include "base/thread_task_runner_handle.h" 14 #include "base/thread_task_runner_handle.h"
14 #include "base/time/time.h" 15 #include "base/time/time.h"
15 #include "base/timer/timer.h" 16 #include "base/timer/timer.h"
16 #include "ui/aura/window.h" 17 #include "ui/aura/window.h"
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 338
338 timer_.reset(); 339 timer_.reset();
339 } 340 }
340 341
341 void ShelfTooltipManager::CreateBubble(views::View* anchor, 342 void ShelfTooltipManager::CreateBubble(views::View* anchor,
342 const base::string16& text) { 343 const base::string16& text) {
343 DCHECK(!view_); 344 DCHECK(!view_);
344 345
345 anchor_ = anchor; 346 anchor_ = anchor;
346 text_ = text; 347 text_ = text;
347 views::BubbleBorder::Arrow arrow = 348 Shelf* shelf = shelf_layout_manager_->shelf_widget()->shelf();
348 shelf_layout_manager_->SelectValueForShelfAlignment( 349 views::BubbleBorder::Arrow arrow = shelf->SelectValueForShelfAlignment(
349 views::BubbleBorder::BOTTOM_CENTER, 350 views::BubbleBorder::BOTTOM_CENTER, views::BubbleBorder::LEFT_CENTER,
350 views::BubbleBorder::LEFT_CENTER, 351 views::BubbleBorder::RIGHT_CENTER, views::BubbleBorder::TOP_CENTER);
351 views::BubbleBorder::RIGHT_CENTER,
352 views::BubbleBorder::TOP_CENTER);
353 352
354 view_ = new ShelfTooltipBubble(anchor, arrow, this); 353 view_ = new ShelfTooltipBubble(anchor, arrow, this);
355 widget_ = view_->GetWidget(); 354 widget_ = view_->GetWidget();
356 view_->SetText(text_); 355 view_->SetText(text_);
357 356
358 gfx::NativeView native_view = widget_->GetNativeView(); 357 gfx::NativeView native_view = widget_->GetNativeView();
359 wm::SetWindowVisibilityAnimationType( 358 wm::SetWindowVisibilityAnimationType(
360 native_view, wm::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL); 359 native_view, wm::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL);
361 wm::SetWindowVisibilityAnimationTransition( 360 wm::SetWindowVisibilityAnimationTransition(
362 native_view, wm::ANIMATE_HIDE); 361 native_view, wm::ANIMATE_HIDE);
363 } 362 }
364 363
365 void ShelfTooltipManager::CreateTimer(int delay_in_ms) { 364 void ShelfTooltipManager::CreateTimer(int delay_in_ms) {
366 base::OneShotTimer* new_timer = new base::OneShotTimer(); 365 base::OneShotTimer* new_timer = new base::OneShotTimer();
367 new_timer->Start(FROM_HERE, 366 new_timer->Start(FROM_HERE,
368 base::TimeDelta::FromMilliseconds(delay_in_ms), 367 base::TimeDelta::FromMilliseconds(delay_in_ms),
369 this, 368 this,
370 &ShelfTooltipManager::ShowInternal); 369 &ShelfTooltipManager::ShowInternal);
371 timer_.reset(new_timer); 370 timer_.reset(new_timer);
372 } 371 }
373 372
374 } // namespace ash 373 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/shelf_layout_manager_unittest.cc ('k') | ash/shelf/shelf_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698