| 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 11 matching lines...) Expand all Loading... |
| 22 #include "ui/views/controls/button/radio_button.h" | 22 #include "ui/views/controls/button/radio_button.h" |
| 23 #include "ui/views/controls/button/text_button.h" | 23 #include "ui/views/controls/button/text_button.h" |
| 24 #include "ui/views/controls/image_view.h" | 24 #include "ui/views/controls/image_view.h" |
| 25 #include "ui/views/controls/label.h" | 25 #include "ui/views/controls/label.h" |
| 26 #include "ui/views/controls/link.h" | 26 #include "ui/views/controls/link.h" |
| 27 #include "ui/views/controls/separator.h" | 27 #include "ui/views/controls/separator.h" |
| 28 #include "ui/views/layout/grid_layout.h" | 28 #include "ui/views/layout/grid_layout.h" |
| 29 #include "ui/views/layout/layout_constants.h" | 29 #include "ui/views/layout/layout_constants.h" |
| 30 | 30 |
| 31 #if defined(USE_AURA) | 31 #if defined(USE_AURA) |
| 32 #include "ui/aura/cursor.h" | 32 #include "ui/base/cursor/cursor.h" |
| 33 #endif | 33 #endif |
| 34 | 34 |
| 35 // If we don't clamp the maximum width, then very long URLs and titles can make | 35 // If we don't clamp the maximum width, then very long URLs and titles can make |
| 36 // the bubble arbitrarily wide. | 36 // the bubble arbitrarily wide. |
| 37 const int kMaxContentsWidth = 500; | 37 const int kMaxContentsWidth = 500; |
| 38 | 38 |
| 39 // When we have multiline labels, we should set a minimum width lest we get very | 39 // When we have multiline labels, we should set a minimum width lest we get very |
| 40 // narrow bubbles with lots of line-wrapping. | 40 // narrow bubbles with lots of line-wrapping. |
| 41 const int kMinMultiLineContentsWidth = 250; | 41 const int kMinMultiLineContentsWidth = 250; |
| 42 | 42 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 const views::MouseEvent& event) { | 81 const views::MouseEvent& event) { |
| 82 if ((event.IsLeftMouseButton() || event.IsMiddleMouseButton()) && | 82 if ((event.IsLeftMouseButton() || event.IsMiddleMouseButton()) && |
| 83 HitTest(event.location())) { | 83 HitTest(event.location())) { |
| 84 parent_->LinkClicked(link_, event.flags()); | 84 parent_->LinkClicked(link_, event.flags()); |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 | 87 |
| 88 gfx::NativeCursor ContentSettingBubbleContents::Favicon::GetCursor( | 88 gfx::NativeCursor ContentSettingBubbleContents::Favicon::GetCursor( |
| 89 const views::MouseEvent& event) { | 89 const views::MouseEvent& event) { |
| 90 #if defined(USE_AURA) | 90 #if defined(USE_AURA) |
| 91 return aura::kCursorHand; | 91 return ui::kCursorHand; |
| 92 #elif defined(OS_WIN) | 92 #elif defined(OS_WIN) |
| 93 static HCURSOR g_hand_cursor = LoadCursor(NULL, IDC_HAND); | 93 static HCURSOR g_hand_cursor = LoadCursor(NULL, IDC_HAND); |
| 94 return g_hand_cursor; | 94 return g_hand_cursor; |
| 95 #endif | 95 #endif |
| 96 } | 96 } |
| 97 | 97 |
| 98 ContentSettingBubbleContents::ContentSettingBubbleContents( | 98 ContentSettingBubbleContents::ContentSettingBubbleContents( |
| 99 ContentSettingBubbleModel* content_setting_bubble_model, | 99 ContentSettingBubbleModel* content_setting_bubble_model, |
| 100 Profile* profile, | 100 Profile* profile, |
| 101 WebContents* web_contents, | 101 WebContents* web_contents, |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 } | 323 } |
| 324 | 324 |
| 325 void ContentSettingBubbleContents::Observe( | 325 void ContentSettingBubbleContents::Observe( |
| 326 int type, | 326 int type, |
| 327 const content::NotificationSource& source, | 327 const content::NotificationSource& source, |
| 328 const content::NotificationDetails& details) { | 328 const content::NotificationDetails& details) { |
| 329 DCHECK(type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED); | 329 DCHECK(type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED); |
| 330 DCHECK(source == content::Source<WebContents>(web_contents_)); | 330 DCHECK(source == content::Source<WebContents>(web_contents_)); |
| 331 web_contents_ = NULL; | 331 web_contents_ = NULL; |
| 332 } | 332 } |
| OLD | NEW |