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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 SetVisible(false); | 73 SetVisible(false); |
74 return; | 74 return; |
75 } | 75 } |
76 SetImage(ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 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 = TabContents::GetOwningTabContentsForWebContents( | 83 content_settings = |
84 web_contents)->content_settings(); | 84 TabContents::FromWebContents(web_contents)->content_settings(); |
85 } | 85 } |
86 if (!content_settings || content_settings->IsBlockageIndicated( | 86 if (!content_settings || content_settings->IsBlockageIndicated( |
87 content_setting_image_model_->get_content_settings_type())) | 87 content_setting_image_model_->get_content_settings_type())) |
88 return; | 88 return; |
89 | 89 |
90 // The content blockage was not yet indicated to the user. Start indication | 90 // The content blockage was not yet indicated to the user. Start indication |
91 // animation and clear "not yet shown" flag. | 91 // animation and clear "not yet shown" flag. |
92 content_settings->SetBlockageHasBeenIndicated( | 92 content_settings->SetBlockageHasBeenIndicated( |
93 content_setting_image_model_->get_content_settings_type()); | 93 content_setting_image_model_->get_content_settings_type()); |
94 | 94 |
(...skipping 161 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 |