| 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 "chrome/browser/ui/global_error/global_error.h" | 5 #include "chrome/browser/ui/global_error/global_error.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/ui/global_error/global_error_bubble_view_base.h" | 8 #include "chrome/browser/ui/global_error/global_error_bubble_view_base.h" |
| 9 #include "grit/theme_resources.h" | 9 #include "grit/theme_resources.h" |
| 10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
| 11 #include "ui/gfx/image/image.h" | 11 #include "ui/gfx/image/image.h" |
| 12 | 12 |
| 13 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) |
| 14 #include "ui/gfx/paint_vector_icon.h" |
| 15 #include "ui/gfx/vector_icons_public.h" |
| 16 #include "ui/native_theme/common_theme.h" |
| 17 #include "ui/native_theme/native_theme.h" |
| 18 #endif |
| 19 |
| 13 // GlobalError --------------------------------------------------------------- | 20 // GlobalError --------------------------------------------------------------- |
| 14 | 21 |
| 15 GlobalError::GlobalError() {} | 22 GlobalError::GlobalError() {} |
| 16 | 23 |
| 17 GlobalError::~GlobalError() {} | 24 GlobalError::~GlobalError() {} |
| 18 | 25 |
| 19 GlobalError::Severity GlobalError::GetSeverity() { return SEVERITY_MEDIUM; } | 26 GlobalError::Severity GlobalError::GetSeverity() { return SEVERITY_MEDIUM; } |
| 20 | 27 |
| 21 int GlobalError::MenuItemIconResourceID() { | 28 gfx::Image GlobalError::MenuItemIcon() { |
| 22 // If you change this make sure to also change the bubble icon and the wrench | 29 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
| 23 // icon color. | 30 return ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
| 24 return IDR_INPUT_ALERT_MENU; | 31 IDR_INPUT_ALERT_MENU); |
| 32 #else |
| 33 SkColor icon_color; |
| 34 ui::CommonThemeGetSystemColor(ui::NativeTheme::kColorId_Amber, &icon_color); |
| 35 return gfx::Image( |
| 36 gfx::CreateVectorIcon(gfx::VectorIconId::WARNING, 18, icon_color)); |
| 37 #endif |
| 25 } | 38 } |
| 26 | 39 |
| 27 // GlobalErrorWithStandardBubble --------------------------------------------- | 40 // GlobalErrorWithStandardBubble --------------------------------------------- |
| 28 | 41 |
| 29 GlobalErrorWithStandardBubble::GlobalErrorWithStandardBubble() | 42 GlobalErrorWithStandardBubble::GlobalErrorWithStandardBubble() |
| 30 : has_shown_bubble_view_(false), bubble_view_(NULL) {} | 43 : has_shown_bubble_view_(false), bubble_view_(NULL) {} |
| 31 | 44 |
| 32 GlobalErrorWithStandardBubble::~GlobalErrorWithStandardBubble() {} | 45 GlobalErrorWithStandardBubble::~GlobalErrorWithStandardBubble() {} |
| 33 | 46 |
| 34 bool GlobalErrorWithStandardBubble::HasBubbleView() { return true; } | 47 bool GlobalErrorWithStandardBubble::HasBubbleView() { return true; } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 82 |
| 70 bool GlobalErrorWithStandardBubble::ShouldAddElevationIconToAcceptButton() { | 83 bool GlobalErrorWithStandardBubble::ShouldAddElevationIconToAcceptButton() { |
| 71 return false; | 84 return false; |
| 72 } | 85 } |
| 73 | 86 |
| 74 void GlobalErrorWithStandardBubble::BubbleViewDidClose(Browser* browser) { | 87 void GlobalErrorWithStandardBubble::BubbleViewDidClose(Browser* browser) { |
| 75 DCHECK(browser); | 88 DCHECK(browser); |
| 76 bubble_view_ = NULL; | 89 bubble_view_ = NULL; |
| 77 OnBubbleViewDidClose(browser); | 90 OnBubbleViewDidClose(browser); |
| 78 } | 91 } |
| OLD | NEW |