| 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/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/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" | 10 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 screen_bounds.set_origin(origin); | 137 screen_bounds.set_origin(origin); |
| 138 Profile* profile = parent_->browser()->profile(); | 138 Profile* profile = parent_->browser()->profile(); |
| 139 ContentSettingBubbleContents* bubble_contents = | 139 ContentSettingBubbleContents* bubble_contents = |
| 140 new ContentSettingBubbleContents( | 140 new ContentSettingBubbleContents( |
| 141 ContentSettingBubbleModel::CreateContentSettingBubbleModel( | 141 ContentSettingBubbleModel::CreateContentSettingBubbleModel( |
| 142 parent_->browser(), tab_contents, profile, | 142 parent_->browser(), tab_contents, profile, |
| 143 content_setting_image_model_->get_content_settings_type()), | 143 content_setting_image_model_->get_content_settings_type()), |
| 144 profile, tab_contents->tab_contents()); | 144 profile, tab_contents->tab_contents()); |
| 145 bubble_ = Bubble::Show(GetWidget(), screen_bounds, | 145 bubble_ = Bubble::Show(GetWidget(), screen_bounds, |
| 146 views::BubbleBorder::TOP_RIGHT, | 146 views::BubbleBorder::TOP_RIGHT, |
| 147 views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR, |
| 147 bubble_contents, this); | 148 bubble_contents, this); |
| 148 bubble_contents->set_bubble(bubble_); | 149 bubble_contents->set_bubble(bubble_); |
| 149 } | 150 } |
| 150 | 151 |
| 151 void ContentSettingImageView::VisibilityChanged(View* starting_from, | 152 void ContentSettingImageView::VisibilityChanged(View* starting_from, |
| 152 bool is_visible) { | 153 bool is_visible) { |
| 153 if (!is_visible && bubble_) | 154 if (!is_visible && bubble_) |
| 154 bubble_->Close(); | 155 bubble_->Close(); |
| 155 } | 156 } |
| 156 | 157 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 kAnimatingFraction); | 237 kAnimatingFraction); |
| 237 } else if (state > (1.0 - kAnimatingFraction)) { | 238 } else if (state > (1.0 - kAnimatingFraction)) { |
| 238 visible_text_size_ = static_cast<int>(text_size_ * (1.0 - state) / | 239 visible_text_size_ = static_cast<int>(text_size_ * (1.0 - state) / |
| 239 kAnimatingFraction); | 240 kAnimatingFraction); |
| 240 } else { | 241 } else { |
| 241 visible_text_size_ = text_size_; | 242 visible_text_size_ = text_size_; |
| 242 } | 243 } |
| 243 parent_->Layout(); | 244 parent_->Layout(); |
| 244 parent_->SchedulePaint(); | 245 parent_->SchedulePaint(); |
| 245 } | 246 } |
| OLD | NEW |