| 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 fill_path_->close(); | 186 fill_path_->close(); |
| 187 } | 187 } |
| 188 } | 188 } |
| 189 if (bar_height()) { | 189 if (bar_height()) { |
| 190 fill_path_->addRect(0.0, SkIntToScalar(arrow_height()), | 190 fill_path_->addRect(0.0, SkIntToScalar(arrow_height()), |
| 191 SkIntToScalar(width()), SkIntToScalar(height() - kSeparatorLineHeight)); | 191 SkIntToScalar(width()), SkIntToScalar(height() - kSeparatorLineHeight)); |
| 192 } | 192 } |
| 193 | 193 |
| 194 int start_x = kHorizontalPadding; | 194 int start_x = kHorizontalPadding; |
| 195 if (icon_ != NULL) { | 195 if (icon_ != NULL) { |
| 196 gfx::Size icon_size = icon_->GetPreferredSize(); | 196 gfx::Size icon_size(GetInfoBarIconSizePixels(), GetInfoBarIconSizePixels()); |
| 197 icon_->SetBounds(start_x, OffsetY(icon_size), icon_size.width(), | 197 icon_->SetBounds(start_x, OffsetY(icon_size), icon_size.width(), |
| 198 icon_size.height()); | 198 icon_size.height()); |
| 199 } | 199 } |
| 200 | 200 |
| 201 gfx::Size button_size = close_button_->GetPreferredSize(); | 201 gfx::Size button_size = close_button_->GetPreferredSize(); |
| 202 close_button_->SetBounds(std::max(start_x + ContentMinimumWidth(), | 202 close_button_->SetBounds(std::max(start_x + ContentMinimumWidth(), |
| 203 width() - kHorizontalPadding - button_size.width()), OffsetY(button_size), | 203 width() - kHorizontalPadding - button_size.width()), OffsetY(button_size), |
| 204 button_size.width(), button_size.height()); | 204 button_size.width(), button_size.height()); |
| 205 } | 205 } |
| 206 | 206 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 if (restore_focus) | 364 if (restore_focus) |
| 365 focus_tracker_->FocusLastFocusedExternalView(); | 365 focus_tracker_->FocusLastFocusedExternalView(); |
| 366 focus_tracker_->SetFocusManager(NULL); | 366 focus_tracker_->SetFocusManager(NULL); |
| 367 focus_tracker_.reset(); | 367 focus_tracker_.reset(); |
| 368 } | 368 } |
| 369 } | 369 } |
| 370 | 370 |
| 371 void InfoBarView::DeleteSelf() { | 371 void InfoBarView::DeleteSelf() { |
| 372 delete this; | 372 delete this; |
| 373 } | 373 } |
| OLD | NEW |