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 26 matching lines...) Expand all Loading... |
37 #include "ui/views/controls/button/menu_button.h" | 37 #include "ui/views/controls/button/menu_button.h" |
38 #include "ui/views/controls/button/radio_button.h" | 38 #include "ui/views/controls/button/radio_button.h" |
39 #include "ui/views/controls/combobox/combobox.h" | 39 #include "ui/views/controls/combobox/combobox.h" |
40 #include "ui/views/controls/image_view.h" | 40 #include "ui/views/controls/image_view.h" |
41 #include "ui/views/controls/label.h" | 41 #include "ui/views/controls/label.h" |
42 #include "ui/views/controls/link.h" | 42 #include "ui/views/controls/link.h" |
43 #include "ui/views/controls/menu/menu_config.h" | 43 #include "ui/views/controls/menu/menu_config.h" |
44 #include "ui/views/controls/menu/menu_runner.h" | 44 #include "ui/views/controls/menu/menu_runner.h" |
45 #include "ui/views/controls/separator.h" | 45 #include "ui/views/controls/separator.h" |
46 #include "ui/views/layout/grid_layout.h" | 46 #include "ui/views/layout/grid_layout.h" |
47 #include "ui/views/layout/layout_constants.h" | |
48 #include "ui/views/native_cursor.h" | 47 #include "ui/views/native_cursor.h" |
49 #include "ui/views/window/dialog_client_view.h" | 48 #include "ui/views/window/dialog_client_view.h" |
50 | 49 |
51 namespace { | 50 namespace { |
52 | 51 |
53 // If we don't clamp the maximum width, then very long URLs and titles can make | 52 // If we don't clamp the maximum width, then very long URLs and titles can make |
54 // the bubble arbitrarily wide. | 53 // the bubble arbitrarily wide. |
55 const int kMaxContentsWidth = 500; | 54 const int kMaxContentsWidth = 500; |
56 | 55 |
57 // The new default width for the content settings bubble. The review process to | 56 // The new default width for the content settings bubble. The review process to |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 DCHECK(i != list_item_links_.end()); | 511 DCHECK(i != list_item_links_.end()); |
513 content_setting_bubble_model_->OnListItemClicked(i->second); | 512 content_setting_bubble_model_->OnListItemClicked(i->second); |
514 } | 513 } |
515 | 514 |
516 void ContentSettingBubbleContents::OnPerformAction(views::Combobox* combobox) { | 515 void ContentSettingBubbleContents::OnPerformAction(views::Combobox* combobox) { |
517 MediaComboboxModel* model = | 516 MediaComboboxModel* model = |
518 static_cast<MediaComboboxModel*>(combobox->model()); | 517 static_cast<MediaComboboxModel*>(combobox->model()); |
519 content_setting_bubble_model_->OnMediaMenuClicked( | 518 content_setting_bubble_model_->OnMediaMenuClicked( |
520 model->type(), model->GetDevices()[combobox->selected_index()].id); | 519 model->type(), model->GetDevices()[combobox->selected_index()].id); |
521 } | 520 } |
OLD | NEW |