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

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

Issue 8650001: Move ChromeOS bubble setup code to window.cc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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
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/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"
11 #include "chrome/browser/ui/content_settings/content_setting_image_model.h" 11 #include "chrome/browser/ui/content_settings/content_setting_image_model.h"
12 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 12 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
13 #include "chrome/browser/ui/views/content_setting_bubble_contents.h" 13 #include "chrome/browser/ui/views/content_setting_bubble_contents.h"
14 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" 14 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
15 #include "chrome/browser/ui/views/window.h"
15 #include "content/browser/tab_contents/tab_contents.h" 16 #include "content/browser/tab_contents/tab_contents.h"
16 #include "third_party/skia/include/core/SkShader.h" 17 #include "third_party/skia/include/core/SkShader.h"
17 #include "ui/base/l10n/l10n_util.h" 18 #include "ui/base/l10n/l10n_util.h"
18 #include "ui/base/resource/resource_bundle.h" 19 #include "ui/base/resource/resource_bundle.h"
19 #include "ui/gfx/canvas.h" 20 #include "ui/gfx/canvas.h"
20 #include "ui/gfx/canvas_skia.h" 21 #include "ui/gfx/canvas_skia.h"
21 #include "ui/gfx/skia_util.h" 22 #include "ui/gfx/skia_util.h"
22 #include "views/border.h" 23 #include "views/border.h"
23 24
24 namespace { 25 namespace {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 ContentSettingBubbleContents* bubble = new ContentSettingBubbleContents( 133 ContentSettingBubbleContents* bubble = new ContentSettingBubbleContents(
133 ContentSettingBubbleModel::CreateContentSettingBubbleModel( 134 ContentSettingBubbleModel::CreateContentSettingBubbleModel(
134 parent_->browser(), 135 parent_->browser(),
135 tab_contents, 136 tab_contents,
136 profile, 137 profile,
137 content_setting_image_model_->get_content_settings_type()), 138 content_setting_image_model_->get_content_settings_type()),
138 profile, 139 profile,
139 tab_contents->tab_contents(), 140 tab_contents->tab_contents(),
140 this, 141 this,
141 views::BubbleBorder::TOP_RIGHT); 142 views::BubbleBorder::TOP_RIGHT);
142 views::BubbleDelegateView::CreateBubble(bubble); 143 browser::CreateViewsBubble(bubble);
143 bubble->Show(); 144 bubble->Show();
144 } 145 }
145 146
146 void ContentSettingImageView::OnPaint(gfx::Canvas* canvas) { 147 void ContentSettingImageView::OnPaint(gfx::Canvas* canvas) {
147 gfx::Insets current_insets; 148 gfx::Insets current_insets;
148 if (border()) 149 if (border())
149 border()->GetInsets(&current_insets); 150 border()->GetInsets(&current_insets);
150 // During the animation we draw a border, an icon and the text. The text area 151 // During the animation we draw a border, an icon and the text. The text area
151 // is changing in size during the animation, giving the appearance of the text 152 // is changing in size during the animation, giving the appearance of the text
152 // sliding out and then back in. When the text completely slid out the yellow 153 // sliding out and then back in. When the text completely slid out the yellow
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 kAnimatingFraction); 213 kAnimatingFraction);
213 } else if (state > (1.0 - kAnimatingFraction)) { 214 } else if (state > (1.0 - kAnimatingFraction)) {
214 visible_text_size_ = static_cast<int>(text_size_ * (1.0 - state) / 215 visible_text_size_ = static_cast<int>(text_size_ * (1.0 - state) /
215 kAnimatingFraction); 216 kAnimatingFraction);
216 } else { 217 } else {
217 visible_text_size_ = text_size_; 218 visible_text_size_ = text_size_;
218 } 219 }
219 parent_->Layout(); 220 parent_->Layout();
220 parent_->SchedulePaint(); 221 parent_->SchedulePaint();
221 } 222 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/global_error_bubble_view.cc ('k') | chrome/browser/ui/views/page_info_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698