OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/website_settings/chooser_bubble_ui_view.h" | 5 #include "chrome/browser/ui/views/website_settings/chooser_bubble_ui_view.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 const int kBubbleOuterMargin = 5; | 47 const int kBubbleOuterMargin = 5; |
48 | 48 |
49 // Spacing between major items should be 9px. | 49 // Spacing between major items should be 9px. |
50 const int kItemMajorSpacing = 9; | 50 const int kItemMajorSpacing = 9; |
51 | 51 |
52 // Button border size, draws inside the spacing distance. | 52 // Button border size, draws inside the spacing distance. |
53 const int kButtonBorderSize = 2; | 53 const int kButtonBorderSize = 2; |
54 | 54 |
55 } // namespace | 55 } // namespace |
56 | 56 |
| 57 // static |
| 58 scoped_ptr<BubbleUi> ChooserBubbleDelegate::CreateBubbleUi( |
| 59 Browser* browser, |
| 60 ChooserOptions* chooser_options, |
| 61 ChooserBubbleDelegate* chooser_bubble_delegate) { |
| 62 scoped_ptr<BubbleUi> bubble_ui(new ChooserBubbleUiView( |
| 63 browser, chooser_options, chooser_bubble_delegate)); |
| 64 return bubble_ui.Pass(); |
| 65 } |
| 66 |
57 class ChooserTableModel; | 67 class ChooserTableModel; |
58 | 68 |
59 /////////////////////////////////////////////////////////////////////////////// | 69 /////////////////////////////////////////////////////////////////////////////// |
60 // View implementation for the chooser bubble. | 70 // View implementation for the chooser bubble. |
61 class ChooserBubbleUiViewDelegate : public views::BubbleDelegateView, | 71 class ChooserBubbleUiViewDelegate : public views::BubbleDelegateView, |
62 public views::ButtonListener, | 72 public views::ButtonListener, |
63 public views::TableViewObserver { | 73 public views::TableViewObserver { |
64 public: | 74 public: |
65 ChooserBubbleUiViewDelegate(views::View* anchor_view, | 75 ChooserBubbleUiViewDelegate(views::View* anchor_view, |
66 views::BubbleBorder::Arrow anchor_arrow, | 76 views::BubbleBorder::Arrow anchor_arrow, |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 return browser_view->exclusive_access_bubble()->GetView(); | 412 return browser_view->exclusive_access_bubble()->GetView(); |
403 | 413 |
404 return browser_view->top_container(); | 414 return browser_view->top_container(); |
405 } | 415 } |
406 | 416 |
407 views::BubbleBorder::Arrow ChooserBubbleUiView::GetAnchorArrow() { | 417 views::BubbleBorder::Arrow ChooserBubbleUiView::GetAnchorArrow() { |
408 if (browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR)) | 418 if (browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR)) |
409 return views::BubbleBorder::TOP_LEFT; | 419 return views::BubbleBorder::TOP_LEFT; |
410 return views::BubbleBorder::NONE; | 420 return views::BubbleBorder::NONE; |
411 } | 421 } |
OLD | NEW |