Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(537)

Side by Side Diff: chrome/browser/ui/views/collected_cookies_views.cc

Issue 10797046: (Views only): Allow choosing between NativeTabbedPaneView and NativeTabbedPaneWin on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make CreateNativeWrapper a function in an anonymous namespace. Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/browsing_data_appcache_helper.h" 7 #include "chrome/browser/browsing_data/browsing_data_appcache_helper.h"
8 #include "chrome/browser/browsing_data/browsing_data_cookie_helper.h" 8 #include "chrome/browser/browsing_data/browsing_data_cookie_helper.h"
9 #include "chrome/browser/browsing_data/browsing_data_database_helper.h" 9 #include "chrome/browser/browsing_data/browsing_data_database_helper.h"
10 #include "chrome/browser/browsing_data/browsing_data_file_system_helper.h" 10 #include "chrome/browser/browsing_data/browsing_data_file_system_helper.h"
(...skipping 27 matching lines...) Expand all
38 #include "ui/views/controls/button/text_button.h" 38 #include "ui/views/controls/button/text_button.h"
39 #include "ui/views/controls/image_view.h" 39 #include "ui/views/controls/image_view.h"
40 #include "ui/views/controls/label.h" 40 #include "ui/views/controls/label.h"
41 #include "ui/views/controls/tabbed_pane/tabbed_pane.h" 41 #include "ui/views/controls/tabbed_pane/tabbed_pane.h"
42 #include "ui/views/controls/tree/tree_view.h" 42 #include "ui/views/controls/tree/tree_view.h"
43 #include "ui/views/layout/box_layout.h" 43 #include "ui/views/layout/box_layout.h"
44 #include "ui/views/layout/grid_layout.h" 44 #include "ui/views/layout/grid_layout.h"
45 #include "ui/views/layout/layout_constants.h" 45 #include "ui/views/layout/layout_constants.h"
46 #include "ui/views/widget/widget.h" 46 #include "ui/views/widget/widget.h"
47 47
48 // TODO(markusheintz): This should be removed once the native Windows tabbed
49 // pane is not used anymore (http://crbug.com/138059)
50 #if defined(OS_WIN) && !defined(USE_AURA)
51 #include "ui/views/controls/tabbed_pane/native_tabbed_pane_win.h"
52 #endif
53
48 namespace chrome { 54 namespace chrome {
49 55
50 // Declared in browser_dialogs.h so others don't have to depend on our header. 56 // Declared in browser_dialogs.h so others don't have to depend on our header.
51 void ShowCollectedCookiesDialog(TabContents* tab_contents) { 57 void ShowCollectedCookiesDialog(TabContents* tab_contents) {
52 // Deletes itself on close. 58 // Deletes itself on close.
53 new CollectedCookiesViews(tab_contents); 59 new CollectedCookiesViews(tab_contents);
54 } 60 }
55 61
56 } // namespace chrome 62 } // namespace chrome
57 63
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 296
291 const int single_column_with_padding_layout_id = 1; 297 const int single_column_with_padding_layout_id = 1;
292 views::ColumnSet* column_set_with_padding = layout->AddColumnSet( 298 views::ColumnSet* column_set_with_padding = layout->AddColumnSet(
293 single_column_with_padding_layout_id); 299 single_column_with_padding_layout_id);
294 column_set_with_padding->AddColumn(GridLayout::FILL, GridLayout::FILL, 1, 300 column_set_with_padding->AddColumn(GridLayout::FILL, GridLayout::FILL, 1,
295 GridLayout::USE_PREF, 0, 0); 301 GridLayout::USE_PREF, 0, 0);
296 column_set_with_padding->AddPaddingColumn(0, 2); 302 column_set_with_padding->AddPaddingColumn(0, 2);
297 303
298 layout->StartRow(0, single_column_layout_id); 304 layout->StartRow(0, single_column_layout_id);
299 views::TabbedPane* tabbed_pane = new views::TabbedPane(); 305 views::TabbedPane* tabbed_pane = new views::TabbedPane();
306 #if defined(OS_WIN) && !defined(USE_AURA)
307 // "set_use_native_win_control" must be called before the first tab is added.
308 tabbed_pane->set_use_native_win_control(true);
309 #endif
300 layout->AddView(tabbed_pane); 310 layout->AddView(tabbed_pane);
301 // NOTE: the panes need to be added after the tabbed_pane has been added to 311 // NOTE: the panes need to be added after the tabbed_pane has been added to
302 // its parent. 312 // its parent.
303 string16 label_allowed = l10n_util::GetStringUTF16( 313 string16 label_allowed = l10n_util::GetStringUTF16(
304 IDS_COLLECTED_COOKIES_ALLOWED_COOKIES_TAB_LABEL); 314 IDS_COLLECTED_COOKIES_ALLOWED_COOKIES_TAB_LABEL);
305 string16 label_blocked = l10n_util::GetStringUTF16( 315 string16 label_blocked = l10n_util::GetStringUTF16(
306 IDS_COLLECTED_COOKIES_BLOCKED_COOKIES_TAB_LABEL); 316 IDS_COLLECTED_COOKIES_BLOCKED_COOKIES_TAB_LABEL);
307 tabbed_pane->AddTab(label_allowed, CreateAllowedPane()); 317 tabbed_pane->AddTab(label_allowed, CreateAllowedPane());
308 tabbed_pane->AddTab(label_blocked, CreateBlockedPane()); 318 tabbed_pane->AddTab(label_blocked, CreateBlockedPane());
309 tabbed_pane->SelectTabAt(0); 319 tabbed_pane->SelectTabAt(0);
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 /////////////////////////////////////////////////////////////////////////////// 542 ///////////////////////////////////////////////////////////////////////////////
533 // CollectedCookiesViews, content::NotificationObserver implementation: 543 // CollectedCookiesViews, content::NotificationObserver implementation:
534 544
535 void CollectedCookiesViews::Observe( 545 void CollectedCookiesViews::Observe(
536 int type, 546 int type,
537 const content::NotificationSource& source, 547 const content::NotificationSource& source,
538 const content::NotificationDetails& details) { 548 const content::NotificationDetails& details) {
539 DCHECK(type == chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN); 549 DCHECK(type == chrome::NOTIFICATION_COLLECTED_COOKIES_SHOWN);
540 window_->CloseConstrainedWindow(); 550 window_->CloseConstrainedWindow();
541 } 551 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698