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

Side by Side Diff: chrome/browser/ui/views/location_bar/content_setting_image_view.cc

Issue 16123010: Fix one straggling call to ClampToMin (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | « no previous file | no next file » | 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) 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 const double kOpenFraction = 147 const double kOpenFraction =
148 static_cast<double>(kOpenTimeMS) / kAnimationDurationMS; 148 static_cast<double>(kOpenTimeMS) / kAnimationDurationMS;
149 double size_fraction = 1.0; 149 double size_fraction = 1.0;
150 if (state < kOpenFraction) 150 if (state < kOpenFraction)
151 size_fraction = state / kOpenFraction; 151 size_fraction = state / kOpenFraction;
152 if (state > (1.0 - kOpenFraction)) 152 if (state > (1.0 - kOpenFraction))
153 size_fraction = (1.0 - state) / kOpenFraction; 153 size_fraction = (1.0 - state) / kOpenFraction;
154 size.Enlarge( 154 size.Enlarge(
155 size_fraction * (text_label_->GetPreferredSize().width() + 155 size_fraction * (text_label_->GetPreferredSize().width() +
156 GetTotalSpacingWhileAnimating()), 0); 156 GetTotalSpacingWhileAnimating()), 0);
157 size.ClampToMin(background_painter_->GetMinimumSize()); 157 size.SetToMax(background_painter_->GetMinimumSize());
158 } 158 }
159 return size; 159 return size;
160 } 160 }
161 161
162 void ContentSettingImageView::Layout() { 162 void ContentSettingImageView::Layout() {
163 const int icon_width = icon_->GetPreferredSize().width(); 163 const int icon_width = icon_->GetPreferredSize().width();
164 icon_->SetBounds( 164 icon_->SetBounds(
165 std::min((width() - icon_width) / 2, kHorizMargin), 0, 165 std::min((width() - icon_width) / 2, kHorizMargin), 0,
166 icon_width, height()); 166 icon_width, height());
167 text_label_->SetBounds( 167 text_label_->SetBounds(
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 parent_->delegate()->CreateViewsBubble(new ContentSettingBubbleContents( 225 parent_->delegate()->CreateViewsBubble(new ContentSettingBubbleContents(
226 ContentSettingBubbleModel::CreateContentSettingBubbleModel( 226 ContentSettingBubbleModel::CreateContentSettingBubbleModel(
227 parent_->delegate()->GetContentSettingBubbleModelDelegate(), 227 parent_->delegate()->GetContentSettingBubbleModelDelegate(),
228 web_contents, parent_->profile(), 228 web_contents, parent_->profile(),
229 content_setting_image_model_->get_content_settings_type()), 229 content_setting_image_model_->get_content_settings_type()),
230 web_contents, this, views::BubbleBorder::TOP_RIGHT)); 230 web_contents, this, views::BubbleBorder::TOP_RIGHT));
231 bubble_widget_->AddObserver(this); 231 bubble_widget_->AddObserver(this);
232 bubble_widget_->Show(); 232 bubble_widget_->Show();
233 } 233 }
234 } 234 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698