| OLD | NEW | 
|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/views/clear_browsing_data.h" | 5 #include "chrome/browser/views/clear_browsing_data.h" | 
| 6 | 6 | 
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" | 
| 8 #include "base/string16.h" | 8 #include "base/string16.h" | 
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" | 
| 10 #include "chrome/browser/browser_window.h" | 10 #include "chrome/browser/browser_window.h" | 
| (...skipping 25 matching lines...) Expand all  Loading... | 
| 36 // The combo box is vertically aligned to the 'time-period' label, which makes | 36 // The combo box is vertically aligned to the 'time-period' label, which makes | 
| 37 // the combo box look a little too close to the check box above it when we use | 37 // the combo box look a little too close to the check box above it when we use | 
| 38 // standard layout to separate them. We therefore add a little extra margin to | 38 // standard layout to separate them. We therefore add a little extra margin to | 
| 39 // the label, giving it a little breathing space. | 39 // the label, giving it a little breathing space. | 
| 40 static const int kExtraMarginForTimePeriodLabel = 3; | 40 static const int kExtraMarginForTimePeriodLabel = 3; | 
| 41 | 41 | 
| 42 namespace browser { | 42 namespace browser { | 
| 43 // Defined in browser_dialogs.h for creation of the view. | 43 // Defined in browser_dialogs.h for creation of the view. | 
| 44 void ShowClearBrowsingDataView(gfx::NativeWindow parent, | 44 void ShowClearBrowsingDataView(gfx::NativeWindow parent, | 
| 45                                Profile* profile) { | 45                                Profile* profile) { | 
| 46 #if defined(OS_WIN) | 46 | 
| 47   views::Window::CreateChromeWindow(parent, gfx::Rect(), |  | 
| 48                                     new ClearDataView(profile))->Show(); |  | 
| 49 #else |  | 
| 50   views::Window::CreateChromeWindow(parent, gfx::Rect(), | 47   views::Window::CreateChromeWindow(parent, gfx::Rect(), | 
| 51                                     new ClearBrowsingDataView(profile))->Show(); | 48                                     new ClearBrowsingDataView(profile))->Show(); | 
| 52 #endif |  | 
| 53 } | 49 } | 
| 54 | 50 | 
| 55 }  // namespace browser | 51 }  // namespace browser | 
| 56 | 52 | 
| 57 | 53 | 
| 58 //////////////////////////////////////////////////////////////////////////////// | 54 //////////////////////////////////////////////////////////////////////////////// | 
| 59 // ClearBrowsingDataView, public: | 55 // ClearBrowsingDataView, public: | 
| 60 | 56 | 
| 61 ClearBrowsingDataView::ClearBrowsingDataView(Profile* profile) | 57 ClearBrowsingDataView::ClearBrowsingDataView(Profile* profile) | 
| 62     : del_history_checkbox_(NULL), | 58     : del_history_checkbox_(NULL), | 
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 463   remover_->AddObserver(this); | 459   remover_->AddObserver(this); | 
| 464   remover_->Remove(remove_mask); | 460   remover_->Remove(remove_mask); | 
| 465 } | 461 } | 
| 466 | 462 | 
| 467 void ClearBrowsingDataView::OnBrowsingDataRemoverDone() { | 463 void ClearBrowsingDataView::OnBrowsingDataRemoverDone() { | 
| 468   // No need to remove ourselves as an observer as BrowsingDataRemover deletes | 464   // No need to remove ourselves as an observer as BrowsingDataRemover deletes | 
| 469   // itself after we return. | 465   // itself after we return. | 
| 470   remover_ = NULL; | 466   remover_ = NULL; | 
| 471   window()->Close(); | 467   window()->Close(); | 
| 472 } | 468 } | 
| OLD | NEW | 
|---|