Chromium Code Reviews| 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 249 slide_animator_.Reset(); | 249 slide_animator_.Reset(); |
| 250 } | 250 } |
| 251 | 251 |
| 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 = bubble_view_->Show(pause_animation_); |
|
Evan Stade
2016/03/07 18:10:37
seems like there is a behavior change here. The ar
varkha
2016/03/07 18:28:51
Yes, since there is no ink ripple active state whe
| |
| 260 parent_->delegate()->CreateViewsBubble(bubble_view_); | |
| 261 bubble_widget->AddObserver(this); | 260 bubble_widget->AddObserver(this); |
| 262 // This is triggered by an input event, the icon will be in an active state | |
| 263 // so the bubble doesn't need an arrow. | |
| 264 if (ui::MaterialDesignController::IsModeMaterial()) | |
| 265 bubble_view_->SetArrowPaintType(views::BubbleBorder::PAINT_TRANSPARENT); | |
| 266 bubble_widget->Show(); | |
| 267 } | 261 } |
| 268 } | 262 } |
| 269 | 263 |
| 270 void ContentSettingImageView::UpdateImage() { | 264 void ContentSettingImageView::UpdateImage() { |
| 271 SetImage(content_setting_image_model_->GetIcon(GetTextColor()).AsImageSkia()); | 265 SetImage(content_setting_image_model_->GetIcon(GetTextColor()).AsImageSkia()); |
| 272 image()->SetTooltipText(content_setting_image_model_->get_tooltip()); | 266 image()->SetTooltipText(content_setting_image_model_->get_tooltip()); |
| 273 } | 267 } |
| 274 | 268 |
| 275 bool ContentSettingImageView::IsBubbleShowing() const { | 269 bool ContentSettingImageView::IsBubbleShowing() const { |
| 276 return bubble_view_ != nullptr; | 270 return bubble_view_ != nullptr; |
| 277 } | 271 } |
| OLD | NEW |