OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/collected_cookies_win.h" | 5 #include "chrome/browser/ui/views/collected_cookies_win.h" |
6 | 6 |
7 #include "chrome/browser/content_settings/host_content_settings_map.h" | 7 #include "chrome/browser/content_settings/host_content_settings_map.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/cookies_tree_model.h" | 9 #include "chrome/browser/cookies_tree_model.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" | 11 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" |
12 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 12 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
13 #include "chrome/browser/ui/views/cookie_info_view.h" | 13 #include "chrome/browser/ui/views/cookie_info_view.h" |
| 14 #include "chrome/common/chrome_notification_types.h" |
14 #include "content/common/notification_details.h" | 15 #include "content/common/notification_details.h" |
15 #include "content/common/notification_source.h" | 16 #include "content/common/notification_source.h" |
16 #include "grit/generated_resources.h" | 17 #include "grit/generated_resources.h" |
17 #include "grit/locale_settings.h" | 18 #include "grit/locale_settings.h" |
18 #include "grit/theme_resources.h" | 19 #include "grit/theme_resources.h" |
19 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
20 #include "ui/base/resource/resource_bundle.h" | 21 #include "ui/base/resource/resource_bundle.h" |
21 #include "ui/gfx/color_utils.h" | 22 #include "ui/gfx/color_utils.h" |
22 #include "views/controls/button/text_button.h" | 23 #include "views/controls/button/text_button.h" |
23 #include "views/controls/image_view.h" | 24 #include "views/controls/image_view.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 allowed_cookies_tree_(NULL), | 169 allowed_cookies_tree_(NULL), |
169 blocked_cookies_tree_(NULL), | 170 blocked_cookies_tree_(NULL), |
170 block_allowed_button_(NULL), | 171 block_allowed_button_(NULL), |
171 allow_blocked_button_(NULL), | 172 allow_blocked_button_(NULL), |
172 for_session_blocked_button_(NULL), | 173 for_session_blocked_button_(NULL), |
173 infobar_(NULL), | 174 infobar_(NULL), |
174 status_changed_(false) { | 175 status_changed_(false) { |
175 TabSpecificContentSettings* content_settings = | 176 TabSpecificContentSettings* content_settings = |
176 TabContentsWrapper::GetCurrentWrapperForContents(tab_contents)-> | 177 TabContentsWrapper::GetCurrentWrapperForContents(tab_contents)-> |
177 content_settings(); | 178 content_settings(); |
178 registrar_.Add(this, NotificationType::COLLECTED_COOKIES_SHOWN, | 179 registrar_.Add(this, chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN, |
179 Source<TabSpecificContentSettings>(content_settings)); | 180 Source<TabSpecificContentSettings>(content_settings)); |
180 | 181 |
181 Init(); | 182 Init(); |
182 | 183 |
183 window_ = tab_contents_->CreateConstrainedDialog(this); | 184 window_ = tab_contents_->CreateConstrainedDialog(this); |
184 } | 185 } |
185 | 186 |
186 CollectedCookiesWin::~CollectedCookiesWin() { | 187 CollectedCookiesWin::~CollectedCookiesWin() { |
187 allowed_cookies_tree_->SetModel(NULL); | 188 allowed_cookies_tree_->SetModel(NULL); |
188 blocked_cookies_tree_->SetModel(NULL); | 189 blocked_cookies_tree_->SetModel(NULL); |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 MapWindowPoints(HWND_DESKTOP, tab_contents_->GetNativeView(), &topleft, 1); | 494 MapWindowPoints(HWND_DESKTOP, tab_contents_->GetNativeView(), &topleft, 1); |
494 gfx::Size size = GetWidget()->GetRootView()->GetPreferredSize(); | 495 gfx::Size size = GetWidget()->GetRootView()->GetPreferredSize(); |
495 bounds.SetRect(topleft.x, topleft.y, size.width(), size.height()); | 496 bounds.SetRect(topleft.x, topleft.y, size.width(), size.height()); |
496 GetWidget()->SetBounds(bounds); | 497 GetWidget()->SetBounds(bounds); |
497 status_changed_ = true; | 498 status_changed_ = true; |
498 } | 499 } |
499 | 500 |
500 /////////////////////////////////////////////////////////////////////////////// | 501 /////////////////////////////////////////////////////////////////////////////// |
501 // NotificationObserver implementation. | 502 // NotificationObserver implementation. |
502 | 503 |
503 void CollectedCookiesWin::Observe(NotificationType type, | 504 void CollectedCookiesWin::Observe(int type, |
504 const NotificationSource& source, | 505 const NotificationSource& source, |
505 const NotificationDetails& details) { | 506 const NotificationDetails& details) { |
506 DCHECK(type == NotificationType::COLLECTED_COOKIES_SHOWN); | 507 DCHECK(type == chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN); |
507 window_->CloseConstrainedWindow(); | 508 window_->CloseConstrainedWindow(); |
508 } | 509 } |
OLD | NEW |