Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Side by Side Diff: chrome/browser/ui/views/infobars/translate_infobar_base.cc

Issue 6249010: Cleanup: de-inline a bunch of classes, rename and move "PluginInstaller" to "... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/views/infobars/infobars.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/translate_infobar_base.h" 5 #include "chrome/browser/ui/views/infobars/translate_infobar_base.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/translate/translate_infobar_delegate.h" 8 #include "chrome/browser/translate/translate_infobar_delegate.h"
9 #include "chrome/browser/ui/views/infobars/after_translate_infobar.h" 9 #include "chrome/browser/ui/views/infobars/after_translate_infobar.h"
10 #include "chrome/browser/ui/views/infobars/before_translate_infobar.h" 10 #include "chrome/browser/ui/views/infobars/before_translate_infobar.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 "chrome/browser/ui/views/infobars/translate_message_infobar.h" 12 #include "chrome/browser/ui/views/infobars/translate_message_infobar.h"
13 #include "gfx/canvas_skia.h" 13 #include "gfx/canvas_skia.h"
14 #include "grit/theme_resources.h" 14 #include "grit/theme_resources.h"
15 #include "ui/base/animation/slide_animation.h" 15 #include "ui/base/animation/slide_animation.h"
16 #include "ui/base/resource/resource_bundle.h" 16 #include "ui/base/resource/resource_bundle.h"
17 #include "views/controls/button/menu_button.h" 17 #include "views/controls/button/menu_button.h"
18 #include "views/controls/image_view.h" 18 #include "views/controls/image_view.h"
19 19
20 TranslateInfoBarBase::TranslateInfoBarBase( 20 TranslateInfoBarBase::TranslateInfoBarBase(
21 TranslateInfoBarDelegate* delegate) 21 TranslateInfoBarDelegate* delegate)
22 : InfoBar(delegate), 22 : InfoBar(delegate),
23 normal_background_(InfoBarDelegate::PAGE_ACTION_TYPE), 23 normal_background_(InfoBarDelegate::PAGE_ACTION_TYPE),
24 error_background_(InfoBarDelegate::WARNING_TYPE) { 24 error_background_(InfoBarDelegate::WARNING_TYPE) {
25 icon_ = new views::ImageView; 25 icon_ = new views::ImageView;
26 SkBitmap* image = delegate->GetIcon(); 26 SkBitmap* image = static_cast<InfoBarDelegate*>(delegate)->GetIcon();
27 if (image) 27 if (image)
28 icon_->SetImage(image); 28 icon_->SetImage(image);
29 AddChildView(icon_); 29 AddChildView(icon_);
30 30
31 TranslateInfoBarDelegate::BackgroundAnimationType animation = 31 TranslateInfoBarDelegate::BackgroundAnimationType animation =
32 delegate->background_animation_type(); 32 delegate->background_animation_type();
33 if (animation != TranslateInfoBarDelegate::NONE) { 33 if (animation != TranslateInfoBarDelegate::NONE) {
34 background_color_animation_.reset(new ui::SlideAnimation(this)); 34 background_color_animation_.reset(new ui::SlideAnimation(this));
35 background_color_animation_->SetTweenType(ui::Tween::LINEAR); 35 background_color_animation_->SetTweenType(ui::Tween::LINEAR);
36 background_color_animation_->SetSlideDuration(500); 36 background_color_animation_->SetSlideDuration(500);
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 infobar = new TranslateMessageInfoBar(this); 169 infobar = new TranslateMessageInfoBar(this);
170 break; 170 break;
171 default: 171 default:
172 NOTREACHED(); 172 NOTREACHED();
173 } 173 }
174 // Set |infobar_view_| so that the model can notify the infobar when it 174 // Set |infobar_view_| so that the model can notify the infobar when it
175 // changes. 175 // changes.
176 infobar_view_ = infobar; 176 infobar_view_ = infobar;
177 return infobar; 177 return infobar;
178 } 178 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/infobars/infobars.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698