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/infobars/infobar_tab_helper.h" | 10 #include "chrome/browser/infobars/infobar_tab_helper.h" |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 void CollectedCookiesWin::AddContentException(views::TreeView* tree_view, | 485 void CollectedCookiesWin::AddContentException(views::TreeView* tree_view, |
486 ContentSetting setting) { | 486 ContentSetting setting) { |
487 CookieTreeOriginNode* origin_node = | 487 CookieTreeOriginNode* origin_node = |
488 static_cast<CookieTreeOriginNode*>(tree_view->GetSelectedNode()); | 488 static_cast<CookieTreeOriginNode*>(tree_view->GetSelectedNode()); |
489 Profile* profile = | 489 Profile* profile = |
490 Profile::FromBrowserContext(tab_contents_->browser_context()); | 490 Profile::FromBrowserContext(tab_contents_->browser_context()); |
491 origin_node->CreateContentException(profile->GetHostContentSettingsMap(), | 491 origin_node->CreateContentException(profile->GetHostContentSettingsMap(), |
492 setting); | 492 setting); |
493 infobar_->UpdateVisibility(true, setting, origin_node->GetTitle()); | 493 infobar_->UpdateVisibility(true, setting, origin_node->GetTitle()); |
494 gfx::Rect bounds = GetWidget()->GetClientAreaScreenBounds(); | 494 gfx::Rect bounds = GetWidget()->GetClientAreaScreenBounds(); |
| 495 #if defined(USE_AURA) |
| 496 // TODO(beng): convert the conversion to use views conversion methods. |
| 497 NOTIMPLEMENTED(); |
| 498 #else |
495 // NativeWidgetWin::GetBounds returns the bounds relative to the parent | 499 // NativeWidgetWin::GetBounds returns the bounds relative to the parent |
496 // window, while NativeWidgetWin::SetBounds wants screen coordinates. Do the | 500 // window, while NativeWidgetWin::SetBounds wants screen coordinates. Do the |
497 // translation here until http://crbug.com/52851 is fixed. | 501 // translation here until http://crbug.com/52851 is fixed. |
498 POINT topleft = {bounds.x(), bounds.y()}; | 502 POINT topleft = {bounds.x(), bounds.y()}; |
499 MapWindowPoints(HWND_DESKTOP, tab_contents_->GetNativeView(), &topleft, 1); | 503 MapWindowPoints(HWND_DESKTOP, tab_contents_->GetNativeView(), &topleft, 1); |
500 gfx::Size size = GetWidget()->GetRootView()->GetPreferredSize(); | 504 gfx::Size size = GetWidget()->GetRootView()->GetPreferredSize(); |
501 bounds.SetRect(topleft.x, topleft.y, size.width(), size.height()); | 505 bounds.SetRect(topleft.x, topleft.y, size.width(), size.height()); |
502 GetWidget()->SetBounds(bounds); | 506 GetWidget()->SetBounds(bounds); |
| 507 #endif |
503 status_changed_ = true; | 508 status_changed_ = true; |
504 } | 509 } |
505 | 510 |
506 /////////////////////////////////////////////////////////////////////////////// | 511 /////////////////////////////////////////////////////////////////////////////// |
507 // NotificationObserver implementation. | 512 // NotificationObserver implementation. |
508 | 513 |
509 void CollectedCookiesWin::Observe(int type, | 514 void CollectedCookiesWin::Observe(int type, |
510 const NotificationSource& source, | 515 const NotificationSource& source, |
511 const NotificationDetails& details) { | 516 const NotificationDetails& details) { |
512 DCHECK(type == chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN); | 517 DCHECK(type == chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN); |
513 window_->CloseConstrainedWindow(); | 518 window_->CloseConstrainedWindow(); |
514 } | 519 } |
OLD | NEW |