| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/browser/profile.h" | 8 #include "chrome/browser/profile.h" |
| 9 #include "chrome/browser/search_engines/template_url_model.h" | 9 #include "chrome/browser/search_engines/template_url_model.h" |
| 10 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 // The combo box is vertically aligned to the 'time-period' label, which makes | 23 // The combo box is vertically aligned to the 'time-period' label, which makes |
| 24 // the combo box look a little too close to the check box above it when we use | 24 // the combo box look a little too close to the check box above it when we use |
| 25 // standard layout to separate them. We therefore add a little extra margin to | 25 // standard layout to separate them. We therefore add a little extra margin to |
| 26 // the label, giving it a little breathing space. | 26 // the label, giving it a little breathing space. |
| 27 static const int kExtraMarginForTimePeriodLabel = 3; | 27 static const int kExtraMarginForTimePeriodLabel = 3; |
| 28 | 28 |
| 29 namespace browser { | 29 namespace browser { |
| 30 | 30 |
| 31 // Defined in browser_dialogs.h for creation of the view. | 31 // Defined in browser_dialogs.h for creation of the view. |
| 32 void ShowClearBrowsingDataView(views::Widget* parent, | 32 void ShowClearBrowsingDataView(gfx::NativeWindow parent, |
| 33 Profile* profile) { | 33 Profile* profile) { |
| 34 views::Window::CreateChromeWindow( | 34 views::Window::CreateChromeWindow(parent, gfx::Rect(), |
| 35 parent->GetNativeView(), gfx::Rect(), | 35 new ClearBrowsingDataView(profile))->Show(); |
| 36 new ClearBrowsingDataView(profile))->Show(); | |
| 37 } | 36 } |
| 38 | 37 |
| 39 } // namespace browser | 38 } // namespace browser |
| 40 | 39 |
| 41 //////////////////////////////////////////////////////////////////////////////// | 40 //////////////////////////////////////////////////////////////////////////////// |
| 42 // ClearBrowsingDataView, public: | 41 // ClearBrowsingDataView, public: |
| 43 | 42 |
| 44 ClearBrowsingDataView::ClearBrowsingDataView(Profile* profile) | 43 ClearBrowsingDataView::ClearBrowsingDataView(Profile* profile) |
| 45 : del_history_checkbox_(NULL), | 44 : del_history_checkbox_(NULL), |
| 46 del_downloads_checkbox_(NULL), | 45 del_downloads_checkbox_(NULL), |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 remover_->AddObserver(this); | 434 remover_->AddObserver(this); |
| 436 remover_->Remove(remove_mask); | 435 remover_->Remove(remove_mask); |
| 437 } | 436 } |
| 438 | 437 |
| 439 void ClearBrowsingDataView::OnBrowsingDataRemoverDone() { | 438 void ClearBrowsingDataView::OnBrowsingDataRemoverDone() { |
| 440 // No need to remove ourselves as an observer as BrowsingDataRemover deletes | 439 // No need to remove ourselves as an observer as BrowsingDataRemover deletes |
| 441 // itself after we return. | 440 // itself after we return. |
| 442 remover_ = NULL; | 441 remover_ = NULL; |
| 443 window()->Close(); | 442 window()->Close(); |
| 444 } | 443 } |
| OLD | NEW |