OLD | NEW |
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/system_tray.h" | 5 #include "ash/system/tray/system_tray.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell/panel_window.h" | 8 #include "ash/shell/panel_window.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/system/tray/tray_constants.h" | 10 #include "ash/system/tray/tray_constants.h" |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 // Draw a line first. | 210 // Draw a line first. |
211 int y = owner_->height() + 1; | 211 int y = owner_->height() + 1; |
212 canvas->FillRect(gfx::Rect(kLeftPadding, y, owner_->width(), | 212 canvas->FillRect(gfx::Rect(kLeftPadding, y, owner_->width(), |
213 kBottomLineHeight), kBorderDarkColor); | 213 kBottomLineHeight), kBorderDarkColor); |
214 | 214 |
215 // Now, draw a shadow. | 215 // Now, draw a shadow. |
216 canvas->FillRect(gfx::Rect(kLeftPadding + kShadowOffset, y, | 216 canvas->FillRect(gfx::Rect(kLeftPadding + kShadowOffset, y, |
217 owner_->width() - kShadowOffset, kShadowHeight), | 217 owner_->width() - kShadowOffset, kShadowHeight), |
218 kShadowColor); | 218 kShadowColor); |
219 | 219 |
220 // Draw the arrow. | 220 if (Shell::GetInstance()->shelf()->IsVisible()) { |
221 int left_base_x = owner_->width() - kArrowPaddingFromRight - kArrowWidth; | 221 // Draw the arrow. |
222 int left_base_y = y; | 222 int left_base_x = owner_->width() - kArrowPaddingFromRight - kArrowWidth; |
223 int tip_x = left_base_x + kArrowWidth / 2; | 223 int left_base_y = y; |
224 int tip_y = left_base_y + kArrowHeight; | 224 int tip_x = left_base_x + kArrowWidth / 2; |
225 SkPath path; | 225 int tip_y = left_base_y + kArrowHeight; |
226 path.incReserve(4); | 226 SkPath path; |
227 path.moveTo(SkIntToScalar(left_base_x), SkIntToScalar(left_base_y)); | 227 path.incReserve(4); |
228 path.lineTo(SkIntToScalar(tip_x), SkIntToScalar(tip_y)); | 228 path.moveTo(SkIntToScalar(left_base_x), SkIntToScalar(left_base_y)); |
229 path.lineTo(SkIntToScalar(left_base_x + kArrowWidth), | 229 path.lineTo(SkIntToScalar(tip_x), SkIntToScalar(tip_y)); |
230 SkIntToScalar(left_base_y)); | 230 path.lineTo(SkIntToScalar(left_base_x + kArrowWidth), |
| 231 SkIntToScalar(left_base_y)); |
231 | 232 |
232 SkPaint paint; | 233 SkPaint paint; |
233 paint.setStyle(SkPaint::kFill_Style); | 234 paint.setStyle(SkPaint::kFill_Style); |
234 paint.setColor(kBackgroundColor); | 235 paint.setColor(kBackgroundColor); |
235 canvas->sk_canvas()->drawPath(path, paint); | 236 canvas->sk_canvas()->drawPath(path, paint); |
236 | 237 |
237 // Now the draw the outline. | 238 // Now the draw the outline. |
238 paint.setStyle(SkPaint::kStroke_Style); | 239 paint.setStyle(SkPaint::kStroke_Style); |
239 paint.setColor(kBorderDarkColor); | 240 paint.setColor(kBorderDarkColor); |
240 canvas->sk_canvas()->drawPath(path, paint); | 241 canvas->sk_canvas()->drawPath(path, paint); |
| 242 } |
241 } | 243 } |
242 | 244 |
243 virtual void GetInsets(gfx::Insets* insets) const OVERRIDE { | 245 virtual void GetInsets(gfx::Insets* insets) const OVERRIDE { |
244 insets->Set(0, 0, kArrowHeight, 0); | 246 insets->Set(0, 0, kArrowHeight, 0); |
245 } | 247 } |
246 | 248 |
247 views::View* owner_; | 249 views::View* owner_; |
248 | 250 |
249 DISALLOW_COPY_AND_ASSIGN(SystemTrayBubbleBorder); | 251 DISALLOW_COPY_AND_ASSIGN(SystemTrayBubbleBorder); |
250 }; | 252 }; |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 popup_->Hide(); | 662 popup_->Hide(); |
661 } | 663 } |
662 } | 664 } |
663 return base::EVENT_CONTINUE; | 665 return base::EVENT_CONTINUE; |
664 } | 666 } |
665 | 667 |
666 void SystemTray::DidProcessEvent(const base::NativeEvent& event) { | 668 void SystemTray::DidProcessEvent(const base::NativeEvent& event) { |
667 } | 669 } |
668 | 670 |
669 } // namespace ash | 671 } // namespace ash |
OLD | NEW |