| 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> |
| 11 | 11 |
| 12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 13 #include "chrome/browser/content_settings/host_content_settings_map.h" | 13 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 14 #include "chrome/browser/profiles/profile.h" | |
| 15 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" | 14 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" |
| 16 #include "chrome/browser/ui/views/browser_dialogs.h" | 15 #include "chrome/browser/ui/views/browser_dialogs.h" |
| 17 #include "content/public/browser/notification_source.h" | 16 #include "content/public/browser/notification_source.h" |
| 18 #include "content/public/browser/notification_types.h" | 17 #include "content/public/browser/notification_types.h" |
| 19 #include "content/public/browser/plugin_service.h" | 18 #include "content/public/browser/plugin_service.h" |
| 20 #include "grit/generated_resources.h" | 19 #include "grit/generated_resources.h" |
| 21 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
| 22 #include "ui/views/controls/button/radio_button.h" | 21 #include "ui/views/controls/button/radio_button.h" |
| 23 #include "ui/views/controls/button/text_button.h" | 22 #include "ui/views/controls/button/text_button.h" |
| 24 #include "ui/views/controls/image_view.h" | 23 #include "ui/views/controls/image_view.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 #if defined(USE_AURA) | 89 #if defined(USE_AURA) |
| 91 return ui::kCursorHand; | 90 return ui::kCursorHand; |
| 92 #elif defined(OS_WIN) | 91 #elif defined(OS_WIN) |
| 93 static HCURSOR g_hand_cursor = LoadCursor(NULL, IDC_HAND); | 92 static HCURSOR g_hand_cursor = LoadCursor(NULL, IDC_HAND); |
| 94 return g_hand_cursor; | 93 return g_hand_cursor; |
| 95 #endif | 94 #endif |
| 96 } | 95 } |
| 97 | 96 |
| 98 ContentSettingBubbleContents::ContentSettingBubbleContents( | 97 ContentSettingBubbleContents::ContentSettingBubbleContents( |
| 99 ContentSettingBubbleModel* content_setting_bubble_model, | 98 ContentSettingBubbleModel* content_setting_bubble_model, |
| 100 Profile* profile, | |
| 101 WebContents* web_contents, | 99 WebContents* web_contents, |
| 102 views::View* anchor_view, | 100 views::View* anchor_view, |
| 103 views::BubbleBorder::ArrowLocation arrow_location) | 101 views::BubbleBorder::ArrowLocation arrow_location) |
| 104 : BubbleDelegateView(anchor_view, arrow_location), | 102 : BubbleDelegateView(anchor_view, arrow_location), |
| 105 content_setting_bubble_model_(content_setting_bubble_model), | 103 content_setting_bubble_model_(content_setting_bubble_model), |
| 106 profile_(profile), | |
| 107 web_contents_(web_contents), | 104 web_contents_(web_contents), |
| 108 custom_link_(NULL), | 105 custom_link_(NULL), |
| 109 manage_link_(NULL), | 106 manage_link_(NULL), |
| 110 close_button_(NULL) { | 107 close_button_(NULL) { |
| 111 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, | 108 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, |
| 112 content::Source<WebContents>(web_contents)); | 109 content::Source<WebContents>(web_contents)); |
| 113 } | 110 } |
| 114 | 111 |
| 115 ContentSettingBubbleContents::~ContentSettingBubbleContents() { | 112 ContentSettingBubbleContents::~ContentSettingBubbleContents() { |
| 116 } | 113 } |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 } | 321 } |
| 325 | 322 |
| 326 void ContentSettingBubbleContents::Observe( | 323 void ContentSettingBubbleContents::Observe( |
| 327 int type, | 324 int type, |
| 328 const content::NotificationSource& source, | 325 const content::NotificationSource& source, |
| 329 const content::NotificationDetails& details) { | 326 const content::NotificationDetails& details) { |
| 330 DCHECK(type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED); | 327 DCHECK(type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED); |
| 331 DCHECK(source == content::Source<WebContents>(web_contents_)); | 328 DCHECK(source == content::Source<WebContents>(web_contents_)); |
| 332 web_contents_ = NULL; | 329 web_contents_ = NULL; |
| 333 } | 330 } |
| OLD | NEW |