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

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

Issue 1762373002: Corrects ContentSettingBubbleContents to show bubble with arrow when animation is paused (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Corrects ContentSettingBubbleContents to show bubble with arrow when animation is paused Created 4 years, 9 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
« 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/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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // This is triggered by an input event, the icon will be in an active state 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. 263 // so the bubble doesn't need an arrow. When animation is paused the anchor
264 if (ui::MaterialDesignController::IsModeMaterial()) 264 // view doesn't show ink drop so the arrow is still shown.
Peter Kasting 2016/03/08 03:16:28 Nit: Grammar. How about: This is triggered by an
265 if (ui::MaterialDesignController::IsModeMaterial() && !pause_animation_)
265 bubble_view_->SetArrowPaintType(views::BubbleBorder::PAINT_TRANSPARENT); 266 bubble_view_->SetArrowPaintType(views::BubbleBorder::PAINT_TRANSPARENT);
266 bubble_widget->Show(); 267 bubble_widget->Show();
267 } 268 }
268 } 269 }
269 270
270 void ContentSettingImageView::UpdateImage() { 271 void ContentSettingImageView::UpdateImage() {
271 SetImage(content_setting_image_model_->GetIcon(GetTextColor()).AsImageSkia()); 272 SetImage(content_setting_image_model_->GetIcon(GetTextColor()).AsImageSkia());
272 image()->SetTooltipText(content_setting_image_model_->get_tooltip()); 273 image()->SetTooltipText(content_setting_image_model_->get_tooltip());
273 } 274 }
274 275
275 bool ContentSettingImageView::IsBubbleShowing() const { 276 bool ContentSettingImageView::IsBubbleShowing() const {
276 return bubble_view_ != nullptr; 277 return bubble_view_ != nullptr;
277 } 278 }
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