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

Side by Side Diff: ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc

Issue 1849623002: Remove unused ash::SHELF_ALIGNMENT_TOP (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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/system/chromeos/screen_security/screen_tray_item.cc ('k') | ash/system/date/tray_date.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/chromeos/virtual_keyboard/virtual_keyboard_tray.h" 5 #include "ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h"
6 6
7 #include "ash/keyboard/keyboard_ui.h" 7 #include "ash/keyboard/keyboard_ui.h"
8 #include "ash/shelf/shelf.h" 8 #include "ash/shelf/shelf.h"
9 #include "ash/shelf/shelf_constants.h" 9 #include "ash/shelf/shelf_constants.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 const gfx::ImageSkia image = button_->GetImage( 53 const gfx::ImageSkia image = button_->GetImage(
54 views::CustomButton::STATE_NORMAL); 54 views::CustomButton::STATE_NORMAL);
55 int top_padding = (kTrayBarButtonWidth - image.height()) / 2; 55 int top_padding = (kTrayBarButtonWidth - image.height()) / 2;
56 int left_padding = (kTrayBarButtonWidth - image.width()) / 2; 56 int left_padding = (kTrayBarButtonWidth - image.width()) / 2;
57 int bottom_padding = kTrayBarButtonWidth - image.height() - top_padding; 57 int bottom_padding = kTrayBarButtonWidth - image.height() - top_padding;
58 int right_padding = kTrayBarButtonWidth - image.width() - left_padding; 58 int right_padding = kTrayBarButtonWidth - image.width() - left_padding;
59 59
60 // Square up the padding if horizontally aligned. Avoid extra padding when 60 // Square up the padding if horizontally aligned. Avoid extra padding when
61 // vertically aligned as the button would violate the width constraint on the 61 // vertically aligned as the button would violate the width constraint on the
62 // shelf. 62 // shelf.
63 if (alignment == SHELF_ALIGNMENT_BOTTOM || alignment == SHELF_ALIGNMENT_TOP) { 63 if (alignment == SHELF_ALIGNMENT_BOTTOM) {
64 gfx::Insets insets = button_->GetInsets(); 64 gfx::Insets insets = button_->GetInsets();
65 int additional_padding = std::max(0, top_padding - left_padding); 65 int additional_padding = std::max(0, top_padding - left_padding);
66 left_padding += additional_padding; 66 left_padding += additional_padding;
67 right_padding += additional_padding; 67 right_padding += additional_padding;
68 } 68 }
69 69
70 button_->SetBorder(views::Border::CreateEmptyBorder( 70 button_->SetBorder(views::Border::CreateEmptyBorder(
71 top_padding, 71 top_padding,
72 left_padding, 72 left_padding,
73 bottom_padding, 73 bottom_padding,
(...skipping 22 matching lines...) Expand all
96 const ui::Event& event) { 96 const ui::Event& event) {
97 DCHECK_EQ(button_, sender); 97 DCHECK_EQ(button_, sender);
98 PerformAction(event); 98 PerformAction(event);
99 } 99 }
100 100
101 void VirtualKeyboardTray::OnKeyboardEnabledStateChanged(bool new_value) { 101 void VirtualKeyboardTray::OnKeyboardEnabledStateChanged(bool new_value) {
102 SetVisible(Shell::GetInstance()->keyboard_ui()->IsEnabled()); 102 SetVisible(Shell::GetInstance()->keyboard_ui()->IsEnabled());
103 } 103 }
104 104
105 } // namespace ash 105 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/screen_security/screen_tray_item.cc ('k') | ash/system/date/tray_date.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698