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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 manage_link_ = new views::Link(UTF8ToUTF16(bubble_content.manage_link)); | 279 manage_link_ = new views::Link(UTF8ToUTF16(bubble_content.manage_link)); |
280 manage_link_->set_listener(this); | 280 manage_link_->set_listener(this); |
281 layout->AddView(manage_link_); | 281 layout->AddView(manage_link_); |
282 | 282 |
283 close_button_ = new views::NativeTextButton( | 283 close_button_ = new views::NativeTextButton( |
284 this, l10n_util::GetStringUTF16(IDS_DONE)); | 284 this, l10n_util::GetStringUTF16(IDS_DONE)); |
285 layout->AddView(close_button_); | 285 layout->AddView(close_button_); |
286 } | 286 } |
287 | 287 |
288 void ContentSettingBubbleContents::ButtonPressed(views::Button* sender, | 288 void ContentSettingBubbleContents::ButtonPressed(views::Button* sender, |
289 const views::Event& event) { | 289 const ui::Event& event) { |
290 if (sender == close_button_) { | 290 if (sender == close_button_) { |
291 content_setting_bubble_model_->OnDoneClicked(); | 291 content_setting_bubble_model_->OnDoneClicked(); |
292 StartFade(false); | 292 StartFade(false); |
293 return; | 293 return; |
294 } | 294 } |
295 | 295 |
296 for (RadioGroup::const_iterator i(radio_group_.begin()); | 296 for (RadioGroup::const_iterator i(radio_group_.begin()); |
297 i != radio_group_.end(); ++i) { | 297 i != radio_group_.end(); ++i) { |
298 if (sender == *i) { | 298 if (sender == *i) { |
299 content_setting_bubble_model_->OnRadioClicked(i - radio_group_.begin()); | 299 content_setting_bubble_model_->OnRadioClicked(i - radio_group_.begin()); |
(...skipping 24 matching lines...) Expand all 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 |