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/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/themes/theme_properties.h" | 8 #include "chrome/browser/themes/theme_properties.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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
252 content::WebContents* web_contents = parent_->GetWebContents(); | 252 content::WebContents* web_contents = parent_->GetWebContents(); |
253 if (web_contents && !bubble_view_) { | 253 if (web_contents && !bubble_view_) { |
254 bubble_view_ = new ContentSettingBubbleContents( | 254 bubble_view_ = new ContentSettingBubbleContents( |
255 content_setting_image_model_->CreateBubbleModel( | 255 content_setting_image_model_->CreateBubbleModel( |
256 parent_->delegate()->GetContentSettingBubbleModelDelegate(), | 256 parent_->delegate()->GetContentSettingBubbleModelDelegate(), |
257 web_contents, parent_->profile()), | 257 web_contents, parent_->profile()), |
258 web_contents, this, views::BubbleBorder::TOP_RIGHT); | 258 web_contents, this, views::BubbleBorder::TOP_RIGHT); |
259 views::Widget* bubble_widget = | 259 views::Widget* bubble_widget = |
260 parent_->delegate()->CreateViewsBubble(bubble_view_); | 260 parent_->delegate()->CreateViewsBubble(bubble_view_); |
261 bubble_widget->AddObserver(this); | 261 bubble_widget->AddObserver(this); |
262 if (ui::MaterialDesignController::IsModeMaterial()) | |
Peter Kasting
2016/03/04 02:21:23
Nit: Please add an explanatory comment as was done
varkha
2016/03/04 03:28:57
Done.
| |
263 bubble_view_->SetArrowPaintType(views::BubbleBorder::PAINT_TRANSPARENT); | |
262 bubble_widget->Show(); | 264 bubble_widget->Show(); |
263 } | 265 } |
264 } | 266 } |
265 | 267 |
266 void ContentSettingImageView::UpdateImage() { | 268 void ContentSettingImageView::UpdateImage() { |
267 SetImage(content_setting_image_model_->GetIcon(GetTextColor()).AsImageSkia()); | 269 SetImage(content_setting_image_model_->GetIcon(GetTextColor()).AsImageSkia()); |
268 image()->SetTooltipText(content_setting_image_model_->get_tooltip()); | 270 image()->SetTooltipText(content_setting_image_model_->get_tooltip()); |
269 } | 271 } |
270 | 272 |
271 bool ContentSettingImageView::IsBubbleShowing() const { | 273 bool ContentSettingImageView::IsBubbleShowing() const { |
272 return bubble_view_ != nullptr; | 274 return bubble_view_ != nullptr; |
273 } | 275 } |
OLD | NEW |