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

Side by Side Diff: ash/system/tray/tray_background_view.cc

Issue 2901273003: chromeos: Remove TrayBubbleView::Delegate::OnBeforeBubbleWidgetInit (Closed)
Patch Set: nit Created 3 years, 6 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/system/tray/tray_background_view.h" 5 #include "ash/system/tray/tray_background_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/ash_constants.h" 9 #include "ash/ash_constants.h"
10 #include "ash/public/cpp/shell_window_ids.h"
10 #include "ash/shelf/shelf.h" 11 #include "ash/shelf/shelf.h"
11 #include "ash/shelf/shelf_constants.h" 12 #include "ash/shelf/shelf_constants.h"
12 #include "ash/shell.h" 13 #include "ash/shell.h"
13 #include "ash/system/status_area_widget_delegate.h" 14 #include "ash/system/status_area_widget_delegate.h"
14 #include "ash/system/tray/system_tray_notifier.h" 15 #include "ash/system/tray/system_tray_notifier.h"
15 #include "ash/system/tray/tray_constants.h" 16 #include "ash/system/tray/tray_constants.h"
16 #include "ash/system/tray/tray_container.h" 17 #include "ash/system/tray/tray_container.h"
17 #include "ash/system/tray/tray_event_filter.h" 18 #include "ash/system/tray/tray_event_filter.h"
18 #include "base/memory/ptr_util.h" 19 #include "base/memory/ptr_util.h"
19 #include "ui/accessibility/ax_node_data.h" 20 #include "ui/accessibility/ax_node_data.h"
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 gfx::Insets tray_bg_insets = GetInsets(); 347 gfx::Insets tray_bg_insets = GetInsets();
347 if (GetAnchorAlignment() == TrayBubbleView::ANCHOR_ALIGNMENT_BOTTOM) { 348 if (GetAnchorAlignment() == TrayBubbleView::ANCHOR_ALIGNMENT_BOTTOM) {
348 return gfx::Insets(-tray_bg_insets.top(), anchor_insets.left(), 349 return gfx::Insets(-tray_bg_insets.top(), anchor_insets.left(),
349 -tray_bg_insets.bottom(), anchor_insets.right()); 350 -tray_bg_insets.bottom(), anchor_insets.right());
350 } else { 351 } else {
351 return gfx::Insets(anchor_insets.top(), -tray_bg_insets.left(), 352 return gfx::Insets(anchor_insets.top(), -tray_bg_insets.left(),
352 anchor_insets.bottom(), -tray_bg_insets.right()); 353 anchor_insets.bottom(), -tray_bg_insets.right());
353 } 354 }
354 } 355 }
355 356
357 aura::Window* TrayBackgroundView::GetBubbleWindowContainer() const {
358 return Shell::GetContainer(
359 tray_container()->GetWidget()->GetNativeWindow()->GetRootWindow(),
360 kShellWindowId_SettingBubbleContainer);
361 }
362
356 std::unique_ptr<views::InkDropMask> TrayBackgroundView::CreateInkDropMask() 363 std::unique_ptr<views::InkDropMask> TrayBackgroundView::CreateInkDropMask()
357 const { 364 const {
358 return base::MakeUnique<views::RoundRectInkDropMask>( 365 return base::MakeUnique<views::RoundRectInkDropMask>(
359 size(), GetBackgroundInsets(), kTrayRoundedBorderRadius); 366 size(), GetBackgroundInsets(), kTrayRoundedBorderRadius);
360 } 367 }
361 368
362 bool TrayBackgroundView::ShouldEnterPushedState(const ui::Event& event) { 369 bool TrayBackgroundView::ShouldEnterPushedState(const ui::Event& event) {
363 if (is_active_) 370 if (is_active_)
364 return false; 371 return false;
365 372
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 } 438 }
432 439
433 gfx::Rect TrayBackgroundView::GetBackgroundBounds() const { 440 gfx::Rect TrayBackgroundView::GetBackgroundBounds() const {
434 gfx::Insets insets = GetBackgroundInsets(); 441 gfx::Insets insets = GetBackgroundInsets();
435 gfx::Rect bounds = GetLocalBounds(); 442 gfx::Rect bounds = GetLocalBounds();
436 bounds.Inset(insets); 443 bounds.Inset(insets);
437 return bounds; 444 return bounds;
438 } 445 }
439 446
440 } // namespace ash 447 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/tray/tray_background_view.h ('k') | ash/system/web_notification/web_notification_tray.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698