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/views/location_bar/content_setting_image_view.h" | 5 #include "chrome/browser/ui/views/location_bar/content_setting_image_view.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
9 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" | 9 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" |
10 #include "chrome/browser/ui/content_settings/content_setting_image_model.h" | 10 #include "chrome/browser/ui/content_settings/content_setting_image_model.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 bubble_widget_ = NULL; | 66 bubble_widget_ = NULL; |
67 } | 67 } |
68 } | 68 } |
69 | 69 |
70 void ContentSettingImageView::UpdateFromWebContents(WebContents* web_contents) { | 70 void ContentSettingImageView::UpdateFromWebContents(WebContents* web_contents) { |
71 content_setting_image_model_->UpdateFromWebContents(web_contents); | 71 content_setting_image_model_->UpdateFromWebContents(web_contents); |
72 if (!content_setting_image_model_->is_visible()) { | 72 if (!content_setting_image_model_->is_visible()) { |
73 SetVisible(false); | 73 SetVisible(false); |
74 return; | 74 return; |
75 } | 75 } |
76 SetImage(ui::ResourceBundle::GetSharedInstance().GetBitmapNamed( | 76 SetImage(ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
77 content_setting_image_model_->get_icon())); | 77 content_setting_image_model_->get_icon())); |
78 SetTooltipText(UTF8ToUTF16(content_setting_image_model_->get_tooltip())); | 78 SetTooltipText(UTF8ToUTF16(content_setting_image_model_->get_tooltip())); |
79 SetVisible(true); | 79 SetVisible(true); |
80 | 80 |
81 TabSpecificContentSettings* content_settings = NULL; | 81 TabSpecificContentSettings* content_settings = NULL; |
82 if (web_contents) { | 82 if (web_contents) { |
83 content_settings = TabContentsWrapper::GetCurrentWrapperForContents( | 83 content_settings = TabContentsWrapper::GetCurrentWrapperForContents( |
84 web_contents)->content_settings(); | 84 web_contents)->content_settings(); |
85 } | 85 } |
86 if (!content_settings || content_settings->IsBlockageIndicated( | 86 if (!content_settings || content_settings->IsBlockageIndicated( |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 bubble_widget_->RemoveObserver(this); | 256 bubble_widget_->RemoveObserver(this); |
257 bubble_widget_ = NULL; | 257 bubble_widget_ = NULL; |
258 } | 258 } |
259 if (pause_animation_) { | 259 if (pause_animation_) { |
260 slide_animator_->Reset( | 260 slide_animator_->Reset( |
261 1.0 - (visible_text_size_ * kAnimatingFraction) / text_size_); | 261 1.0 - (visible_text_size_ * kAnimatingFraction) / text_size_); |
262 pause_animation_ = false; | 262 pause_animation_ = false; |
263 slide_animator_->Show(); | 263 slide_animator_->Show(); |
264 } | 264 } |
265 } | 265 } |
OLD | NEW |