| OLD | NEW | 
|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/views/infobars/infobar_view.h" | 5 #include "chrome/browser/ui/views/infobars/infobar_view.h" | 
| 6 | 6 | 
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" | 
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" | 
| 9 #include "chrome/browser/tab_contents/infobar_delegate.h" | 9 #include "chrome/browser/tab_contents/infobar_delegate.h" | 
| 10 #include "chrome/browser/ui/views/infobars/infobar_background.h" | 10 #include "chrome/browser/ui/views/infobars/infobar_background.h" | 
| 11 #include "chrome/browser/ui/views/infobars/infobar_button_border.h" | 11 #include "chrome/browser/ui/views/infobars/infobar_button_border.h" | 
| 12 #include "grit/generated_resources.h" | 12 #include "grit/generated_resources.h" | 
| 13 #include "grit/theme_resources.h" | 13 #include "grit/theme_resources.h" | 
|  | 14 #include "grit/theme_resources_standard.h" | 
| 14 #include "third_party/skia/include/effects/SkGradientShader.h" | 15 #include "third_party/skia/include/effects/SkGradientShader.h" | 
| 15 #include "ui/base/accessibility/accessible_view_state.h" | 16 #include "ui/base/accessibility/accessible_view_state.h" | 
| 16 #include "ui/base/animation/slide_animation.h" | 17 #include "ui/base/animation/slide_animation.h" | 
| 17 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" | 
| 18 #include "ui/base/resource/resource_bundle.h" | 19 #include "ui/base/resource/resource_bundle.h" | 
| 19 #include "ui/gfx/canvas_skia_paint.h" | 20 #include "ui/gfx/canvas_skia_paint.h" | 
| 20 #include "ui/gfx/image.h" | 21 #include "ui/gfx/image.h" | 
| 21 #include "views/controls/button/image_button.h" | 22 #include "views/controls/button/image_button.h" | 
| 22 #include "views/controls/button/menu_button.h" | 23 #include "views/controls/button/menu_button.h" | 
| 23 #include "views/controls/button/text_button.h" | 24 #include "views/controls/button/text_button.h" | 
| (...skipping 13 matching lines...) Expand all  Loading... | 
| 37 #include "ui/gfx/icon_util.h" | 38 #include "ui/gfx/icon_util.h" | 
| 38 #endif | 39 #endif | 
| 39 | 40 | 
| 40 // static | 41 // static | 
| 41 const int InfoBar::kSeparatorLineHeight = | 42 const int InfoBar::kSeparatorLineHeight = | 
| 42     views::NonClientFrameView::kClientEdgeThickness; | 43     views::NonClientFrameView::kClientEdgeThickness; | 
| 43 const int InfoBar::kDefaultArrowTargetHeight = 9; | 44 const int InfoBar::kDefaultArrowTargetHeight = 9; | 
| 44 const int InfoBar::kMaximumArrowTargetHeight = 24; | 45 const int InfoBar::kMaximumArrowTargetHeight = 24; | 
| 45 const int InfoBar::kDefaultArrowTargetHalfWidth = kDefaultArrowTargetHeight; | 46 const int InfoBar::kDefaultArrowTargetHalfWidth = kDefaultArrowTargetHeight; | 
| 46 const int InfoBar::kMaximumArrowTargetHalfWidth = 14; | 47 const int InfoBar::kMaximumArrowTargetHalfWidth = 14; | 
|  | 48 | 
|  | 49 #ifdef TOUCH_UI | 
|  | 50 const int InfoBar::kDefaultBarTargetHeight = 75; | 
|  | 51 #else | 
| 47 const int InfoBar::kDefaultBarTargetHeight = 36; | 52 const int InfoBar::kDefaultBarTargetHeight = 36; | 
|  | 53 #endif | 
| 48 | 54 | 
| 49 const int InfoBarView::kButtonButtonSpacing = 10; | 55 const int InfoBarView::kButtonButtonSpacing = 10; | 
| 50 const int InfoBarView::kEndOfLabelSpacing = 16; | 56 const int InfoBarView::kEndOfLabelSpacing = 16; | 
| 51 const int InfoBarView::kHorizontalPadding = 6; | 57 const int InfoBarView::kHorizontalPadding = 6; | 
| 52 | 58 | 
| 53 InfoBarView::InfoBarView(InfoBarDelegate* delegate) | 59 InfoBarView::InfoBarView(InfoBarDelegate* delegate) | 
| 54     : InfoBar(delegate), | 60     : InfoBar(delegate), | 
| 55       icon_(NULL), | 61       icon_(NULL), | 
| 56       close_button_(NULL), | 62       close_button_(NULL), | 
| 57       ALLOW_THIS_IN_INITIALIZER_LIST(delete_factory_(this)), | 63       ALLOW_THIS_IN_INITIALIZER_LIST(delete_factory_(this)), | 
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 363     if (restore_focus) | 369     if (restore_focus) | 
| 364       focus_tracker_->FocusLastFocusedExternalView(); | 370       focus_tracker_->FocusLastFocusedExternalView(); | 
| 365     focus_tracker_->SetFocusManager(NULL); | 371     focus_tracker_->SetFocusManager(NULL); | 
| 366     focus_tracker_.reset(); | 372     focus_tracker_.reset(); | 
| 367   } | 373   } | 
| 368 } | 374 } | 
| 369 | 375 | 
| 370 void InfoBarView::DeleteSelf() { | 376 void InfoBarView::DeleteSelf() { | 
| 371   delete this; | 377   delete this; | 
| 372 } | 378 } | 
| OLD | NEW | 
|---|