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/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/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 28 matching lines...) Expand all Loading... | |
| 39 | 39 |
| 40 ContentSettingImageView::ContentSettingImageView( | 40 ContentSettingImageView::ContentSettingImageView( |
| 41 ContentSettingsType content_type, | 41 ContentSettingsType content_type, |
| 42 const int background_images[], | 42 const int background_images[], |
| 43 LocationBarView* parent) | 43 LocationBarView* parent) |
| 44 : LocationBarDecorationView(parent, background_images), | 44 : LocationBarDecorationView(parent, background_images), |
| 45 content_setting_image_model_( | 45 content_setting_image_model_( |
| 46 ContentSettingImageModel::CreateContentSettingImageModel( | 46 ContentSettingImageModel::CreateContentSettingImageModel( |
| 47 content_type)), | 47 content_type)), |
| 48 bubble_widget_(NULL) { | 48 bubble_widget_(NULL) { |
| 49 SetHorizontalAlignment(ImageView::LEADING); | |
| 50 TouchableLocationBarView::Init(this); | |
|
Peter Kasting
2012/09/15 00:23:46
Is killing the touch part here safe?
Greg Billock
2012/09/15 04:58:20
This is in the superclass
| |
| 51 } | 49 } |
| 52 | 50 |
| 53 ContentSettingImageView::~ContentSettingImageView() { | 51 ContentSettingImageView::~ContentSettingImageView() { |
| 54 if (bubble_widget_) { | 52 if (bubble_widget_) { |
| 55 bubble_widget_->RemoveObserver(this); | 53 bubble_widget_->RemoveObserver(this); |
| 56 bubble_widget_ = NULL; | 54 bubble_widget_ = NULL; |
| 57 } | 55 } |
| 58 } | 56 } |
| 59 | 57 |
| 60 void ContentSettingImageView::Update(TabContents* tab_contents) { | 58 void ContentSettingImageView::Update(TabContents* tab_contents) { |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 131 tab_contents, | 129 tab_contents, |
| 132 profile, | 130 profile, |
| 133 content_setting_image_model_->get_content_settings_type()), | 131 content_setting_image_model_->get_content_settings_type()), |
| 134 tab_contents->web_contents(), | 132 tab_contents->web_contents(), |
| 135 this, | 133 this, |
| 136 views::BubbleBorder::TOP_RIGHT); | 134 views::BubbleBorder::TOP_RIGHT); |
| 137 bubble_widget_ = parent->delegate()->CreateViewsBubble(bubble); | 135 bubble_widget_ = parent->delegate()->CreateViewsBubble(bubble); |
| 138 bubble_widget_->AddObserver(this); | 136 bubble_widget_->AddObserver(this); |
| 139 bubble->Show(); | 137 bubble->Show(); |
| 140 } | 138 } |
| OLD | NEW |