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/collected_cookies_views.h" | 5 #include "chrome/browser/ui/views/collected_cookies_views.h" |
6 | 6 |
7 #include "chrome/browser/browsing_data_appcache_helper.h" | 7 #include "chrome/browser/browsing_data_appcache_helper.h" |
8 #include "chrome/browser/browsing_data_cookie_helper.h" | 8 #include "chrome/browser/browsing_data_cookie_helper.h" |
9 #include "chrome/browser/browsing_data_database_helper.h" | 9 #include "chrome/browser/browsing_data_database_helper.h" |
10 #include "chrome/browser/browsing_data_file_system_helper.h" | 10 #include "chrome/browser/browsing_data_file_system_helper.h" |
(...skipping 26 matching lines...) Expand all Loading... | |
37 #include "ui/views/controls/button/text_button.h" | 37 #include "ui/views/controls/button/text_button.h" |
38 #include "ui/views/controls/image_view.h" | 38 #include "ui/views/controls/image_view.h" |
39 #include "ui/views/controls/label.h" | 39 #include "ui/views/controls/label.h" |
40 #include "ui/views/controls/tabbed_pane/tabbed_pane.h" | 40 #include "ui/views/controls/tabbed_pane/tabbed_pane.h" |
41 #include "ui/views/controls/tree/tree_view.h" | 41 #include "ui/views/controls/tree/tree_view.h" |
42 #include "ui/views/layout/box_layout.h" | 42 #include "ui/views/layout/box_layout.h" |
43 #include "ui/views/layout/grid_layout.h" | 43 #include "ui/views/layout/grid_layout.h" |
44 #include "ui/views/layout/layout_constants.h" | 44 #include "ui/views/layout/layout_constants.h" |
45 #include "ui/views/widget/widget.h" | 45 #include "ui/views/widget/widget.h" |
46 | 46 |
47 // TODO(markusheintz): This should be removed once the native windows tabbed | |
48 // pane is not used anymore. | |
msw
2012/07/20 23:50:51
optional nit: include bug # in comment; capitalize
markusheintz_
2012/07/23 12:22:06
Done.
| |
49 #if defined(OS_WIN) && !defined(USE_AURA) | |
50 #include "ui/views/controls/tabbed_pane/native_tabbed_pane_win.h" | |
51 #endif | |
52 | |
47 namespace chrome { | 53 namespace chrome { |
48 | 54 |
49 // Declared in browser_dialogs.h so others don't have to depend on our header. | 55 // Declared in browser_dialogs.h so others don't have to depend on our header. |
50 void ShowCollectedCookiesDialog(TabContents* tab_contents) { | 56 void ShowCollectedCookiesDialog(TabContents* tab_contents) { |
51 // Deletes itself on close. | 57 // Deletes itself on close. |
52 new CollectedCookiesViews(tab_contents); | 58 new CollectedCookiesViews(tab_contents); |
53 } | 59 } |
54 | 60 |
55 } // namespace chrome | 61 } // namespace chrome |
56 | 62 |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
289 | 295 |
290 const int single_column_with_padding_layout_id = 1; | 296 const int single_column_with_padding_layout_id = 1; |
291 views::ColumnSet* column_set_with_padding = layout->AddColumnSet( | 297 views::ColumnSet* column_set_with_padding = layout->AddColumnSet( |
292 single_column_with_padding_layout_id); | 298 single_column_with_padding_layout_id); |
293 column_set_with_padding->AddColumn(GridLayout::FILL, GridLayout::FILL, 1, | 299 column_set_with_padding->AddColumn(GridLayout::FILL, GridLayout::FILL, 1, |
294 GridLayout::USE_PREF, 0, 0); | 300 GridLayout::USE_PREF, 0, 0); |
295 column_set_with_padding->AddPaddingColumn(0, 2); | 301 column_set_with_padding->AddPaddingColumn(0, 2); |
296 | 302 |
297 layout->StartRow(0, single_column_layout_id); | 303 layout->StartRow(0, single_column_layout_id); |
298 views::TabbedPane* tabbed_pane = new views::TabbedPane(); | 304 views::TabbedPane* tabbed_pane = new views::TabbedPane(); |
305 #if defined(OS_WIN) && !defined(USE_AURA) | |
306 tabbed_pane->set_use_native_win_control(true); | |
307 #endif | |
299 layout->AddView(tabbed_pane); | 308 layout->AddView(tabbed_pane); |
300 // NOTE: the panes need to be added after the tabbed_pane has been added to | 309 // NOTE: the panes need to be added after the tabbed_pane has been added to |
301 // its parent. | 310 // its parent. |
302 string16 label_allowed = l10n_util::GetStringUTF16( | 311 string16 label_allowed = l10n_util::GetStringUTF16( |
303 IDS_COLLECTED_COOKIES_ALLOWED_COOKIES_TAB_LABEL); | 312 IDS_COLLECTED_COOKIES_ALLOWED_COOKIES_TAB_LABEL); |
304 string16 label_blocked = l10n_util::GetStringUTF16( | 313 string16 label_blocked = l10n_util::GetStringUTF16( |
305 IDS_COLLECTED_COOKIES_BLOCKED_COOKIES_TAB_LABEL); | 314 IDS_COLLECTED_COOKIES_BLOCKED_COOKIES_TAB_LABEL); |
306 tabbed_pane->AddTab(label_allowed, CreateAllowedPane()); | 315 tabbed_pane->AddTab(label_allowed, CreateAllowedPane()); |
307 tabbed_pane->AddTab(label_blocked, CreateBlockedPane()); | 316 tabbed_pane->AddTab(label_blocked, CreateBlockedPane()); |
308 tabbed_pane->SelectTabAt(0); | 317 tabbed_pane->SelectTabAt(0); |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
531 /////////////////////////////////////////////////////////////////////////////// | 540 /////////////////////////////////////////////////////////////////////////////// |
532 // CollectedCookiesViews, content::NotificationObserver implementation: | 541 // CollectedCookiesViews, content::NotificationObserver implementation: |
533 | 542 |
534 void CollectedCookiesViews::Observe( | 543 void CollectedCookiesViews::Observe( |
535 int type, | 544 int type, |
536 const content::NotificationSource& source, | 545 const content::NotificationSource& source, |
537 const content::NotificationDetails& details) { | 546 const content::NotificationDetails& details) { |
538 DCHECK(type == chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN); | 547 DCHECK(type == chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN); |
539 window_->CloseConstrainedWindow(); | 548 window_->CloseConstrainedWindow(); |
540 } | 549 } |
OLD | NEW |