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/content_setting_bubble_contents.h" | 5 #include "chrome/browser/ui/views/content_setting_bubble_contents.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 | 183 |
184 for (std::vector<ContentSettingBubbleModel::PopupItem>::const_iterator | 184 for (std::vector<ContentSettingBubbleModel::PopupItem>::const_iterator |
185 i(bubble_content.popup_items.begin()); | 185 i(bubble_content.popup_items.begin()); |
186 i != bubble_content.popup_items.end(); ++i) { | 186 i != bubble_content.popup_items.end(); ++i) { |
187 if (!bubble_content_empty) | 187 if (!bubble_content_empty) |
188 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 188 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
189 layout->StartRow(0, popup_column_set_id); | 189 layout->StartRow(0, popup_column_set_id); |
190 | 190 |
191 views::Link* link = new views::Link(UTF8ToUTF16(i->title)); | 191 views::Link* link = new views::Link(UTF8ToUTF16(i->title)); |
192 link->set_listener(this); | 192 link->set_listener(this); |
193 link->SetElideInMiddle(true); | 193 link->SetElideBehavior(views::Label::ELIDE_IN_MIDDLE); |
194 popup_links_[link] = i - bubble_content.popup_items.begin(); | 194 popup_links_[link] = i - bubble_content.popup_items.begin(); |
195 layout->AddView(new Favicon(i->bitmap, this, link)); | 195 layout->AddView(new Favicon(i->bitmap, this, link)); |
196 layout->AddView(link); | 196 layout->AddView(link); |
197 bubble_content_empty = false; | 197 bubble_content_empty = false; |
198 } | 198 } |
199 } | 199 } |
200 | 200 |
201 const ContentSettingBubbleModel::RadioGroup& radio_group = | 201 const ContentSettingBubbleModel::RadioGroup& radio_group = |
202 bubble_content.radio_group; | 202 bubble_content.radio_group; |
203 if (!radio_group.radio_items.empty()) { | 203 if (!radio_group.radio_items.empty()) { |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 } | 324 } |
325 | 325 |
326 void ContentSettingBubbleContents::Observe( | 326 void ContentSettingBubbleContents::Observe( |
327 int type, | 327 int type, |
328 const content::NotificationSource& source, | 328 const content::NotificationSource& source, |
329 const content::NotificationDetails& details) { | 329 const content::NotificationDetails& details) { |
330 DCHECK(type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED); | 330 DCHECK(type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED); |
331 DCHECK(source == content::Source<WebContents>(web_contents_)); | 331 DCHECK(source == content::Source<WebContents>(web_contents_)); |
332 web_contents_ = NULL; | 332 web_contents_ = NULL; |
333 } | 333 } |
OLD | NEW |