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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 views::Event& event) { |
290 if (sender == close_button_) { | 290 if (sender == close_button_) { |
| 291 content_setting_bubble_model_->OnDoneClicked(); |
291 StartFade(false); | 292 StartFade(false); |
292 return; | 293 return; |
293 } | 294 } |
294 | 295 |
295 for (RadioGroup::const_iterator i(radio_group_.begin()); | 296 for (RadioGroup::const_iterator i(radio_group_.begin()); |
296 i != radio_group_.end(); ++i) { | 297 i != radio_group_.end(); ++i) { |
297 if (sender == *i) { | 298 if (sender == *i) { |
298 content_setting_bubble_model_->OnRadioClicked(i - radio_group_.begin()); | 299 content_setting_bubble_model_->OnRadioClicked(i - radio_group_.begin()); |
299 return; | 300 return; |
300 } | 301 } |
(...skipping 22 matching lines...) Expand all Loading... |
323 } | 324 } |
324 | 325 |
325 void ContentSettingBubbleContents::Observe( | 326 void ContentSettingBubbleContents::Observe( |
326 int type, | 327 int type, |
327 const content::NotificationSource& source, | 328 const content::NotificationSource& source, |
328 const content::NotificationDetails& details) { | 329 const content::NotificationDetails& details) { |
329 DCHECK(type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED); | 330 DCHECK(type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED); |
330 DCHECK(source == content::Source<WebContents>(web_contents_)); | 331 DCHECK(source == content::Source<WebContents>(web_contents_)); |
331 web_contents_ = NULL; | 332 web_contents_ = NULL; |
332 } | 333 } |
OLD | NEW |