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" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 #ifdef TOUCH_UI | 49 #ifdef TOUCH_UI |
50 const int InfoBar::kDefaultBarTargetHeight = 75; | 50 const int InfoBar::kDefaultBarTargetHeight = 75; |
51 #else | 51 #else |
52 const int InfoBar::kDefaultBarTargetHeight = 36; | 52 const int InfoBar::kDefaultBarTargetHeight = 36; |
53 #endif | 53 #endif |
54 | 54 |
55 const int InfoBarView::kButtonButtonSpacing = 10; | 55 const int InfoBarView::kButtonButtonSpacing = 10; |
56 const int InfoBarView::kEndOfLabelSpacing = 16; | 56 const int InfoBarView::kEndOfLabelSpacing = 16; |
57 const int InfoBarView::kHorizontalPadding = 6; | 57 const int InfoBarView::kHorizontalPadding = 6; |
58 | 58 |
59 InfoBarView::InfoBarView(InfoBarDelegate* delegate) | 59 InfoBarView::InfoBarView(TabContentsWrapper* owner, InfoBarDelegate* delegate) |
60 : InfoBar(delegate), | 60 : InfoBar(owner, delegate), |
61 icon_(NULL), | 61 icon_(NULL), |
62 close_button_(NULL), | 62 close_button_(NULL), |
63 ALLOW_THIS_IN_INITIALIZER_LIST(delete_factory_(this)), | 63 ALLOW_THIS_IN_INITIALIZER_LIST(delete_factory_(this)), |
64 fill_path_(new SkPath), | 64 fill_path_(new SkPath), |
65 stroke_path_(new SkPath) { | 65 stroke_path_(new SkPath) { |
66 set_parent_owned(false); // InfoBar deletes itself at the appropriate time. | 66 set_parent_owned(false); // InfoBar deletes itself at the appropriate time. |
67 set_background(new InfoBarBackground(delegate->GetInfoBarType())); | 67 set_background(new InfoBarBackground(delegate->GetInfoBarType())); |
68 } | 68 } |
69 | 69 |
70 InfoBarView::~InfoBarView() { | 70 InfoBarView::~InfoBarView() { |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 if (restore_focus) | 369 if (restore_focus) |
370 focus_tracker_->FocusLastFocusedExternalView(); | 370 focus_tracker_->FocusLastFocusedExternalView(); |
371 focus_tracker_->SetFocusManager(NULL); | 371 focus_tracker_->SetFocusManager(NULL); |
372 focus_tracker_.reset(); | 372 focus_tracker_.reset(); |
373 } | 373 } |
374 } | 374 } |
375 | 375 |
376 void InfoBarView::DeleteSelf() { | 376 void InfoBarView::DeleteSelf() { |
377 delete this; | 377 delete this; |
378 } | 378 } |
OLD | NEW |