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

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

Issue 1870533002: Convert ContentSettingBubbleContents to a BubbleDialogDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix mac views Created 4 years, 8 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
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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 } 266 }
267 267
268 content::WebContents* web_contents = parent_->GetWebContents(); 268 content::WebContents* web_contents = parent_->GetWebContents();
269 if (web_contents && !bubble_view_) { 269 if (web_contents && !bubble_view_) {
270 bubble_view_ = new ContentSettingBubbleContents( 270 bubble_view_ = new ContentSettingBubbleContents(
271 content_setting_image_model_->CreateBubbleModel( 271 content_setting_image_model_->CreateBubbleModel(
272 parent_->delegate()->GetContentSettingBubbleModelDelegate(), 272 parent_->delegate()->GetContentSettingBubbleModelDelegate(),
273 web_contents, parent_->profile()), 273 web_contents, parent_->profile()),
274 web_contents, this, views::BubbleBorder::TOP_RIGHT); 274 web_contents, this, views::BubbleBorder::TOP_RIGHT);
275 views::Widget* bubble_widget = 275 views::Widget* bubble_widget =
276 parent_->delegate()->CreateViewsBubble(bubble_view_); 276 views::BubbleDialogDelegateView::CreateBubble(bubble_view_);
277 bubble_widget->AddObserver(this); 277 bubble_widget->AddObserver(this);
278 // This is triggered by an input event. If the user clicks the icon while 278 // This is triggered by an input event. If the user clicks the icon while
279 // it's not animating, the icon will be placed in an active state, so the 279 // it's not animating, the icon will be placed in an active state, so the
280 // bubble doesn't need an arrow. If the user clicks during an animation, 280 // bubble doesn't need an arrow. If the user clicks during an animation,
281 // the animation simply pauses and no other visible state change occurs, so 281 // the animation simply pauses and no other visible state change occurs, so
282 // show the arrow in this case. 282 // show the arrow in this case.
283 if (ui::MaterialDesignController::IsModeMaterial() && !pause_animation_) { 283 if (ui::MaterialDesignController::IsModeMaterial() && !pause_animation_) {
284 ink_drop_delegate_->OnAction(views::InkDropState::ACTIVATED); 284 ink_drop_delegate_->OnAction(views::InkDropState::ACTIVATED);
285 bubble_view_->SetArrowPaintType(views::BubbleBorder::PAINT_TRANSPARENT); 285 bubble_view_->SetArrowPaintType(views::BubbleBorder::PAINT_TRANSPARENT);
286 } 286 }
287 bubble_widget->Show(); 287 bubble_widget->Show();
288 } 288 }
289 } 289 }
290 290
291 void ContentSettingImageView::UpdateImage() { 291 void ContentSettingImageView::UpdateImage() {
292 SetImage(content_setting_image_model_->GetIcon(GetTextColor()).AsImageSkia()); 292 SetImage(content_setting_image_model_->GetIcon(GetTextColor()).AsImageSkia());
293 image()->SetTooltipText(content_setting_image_model_->get_tooltip()); 293 image()->SetTooltipText(content_setting_image_model_->get_tooltip());
294 } 294 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698