| 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/options/advanced_page_view.h" | 5 #include "chrome/browser/views/options/advanced_page_view.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/views/options/advanced_contents_view.h" | 10 #include "chrome/browser/views/options/advanced_contents_view.h" |
| 11 #include "chrome/browser/views/standard_layout.h" | 11 #include "chrome/browser/views/standard_layout.h" |
| 12 #include "chrome/common/chrome_constants.h" | 12 #include "chrome/common/chrome_constants.h" |
| 13 #include "chrome/common/l10n_util.h" | 13 #include "chrome/common/l10n_util.h" |
| 14 #include "chrome/common/message_box_flags.h" |
| 14 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
| 15 #include "chrome/common/pref_service.h" | 16 #include "chrome/common/pref_service.h" |
| 16 #include "chrome/views/controls/message_box_view.h" | 17 #include "chrome/views/controls/message_box_view.h" |
| 17 #include "chrome/views/controls/button/native_button.h" | 18 #include "chrome/views/controls/button/native_button.h" |
| 18 #include "chrome/views/controls/scroll_view.h" | 19 #include "chrome/views/controls/scroll_view.h" |
| 19 #include "chrome/views/grid_layout.h" | 20 #include "chrome/views/grid_layout.h" |
| 20 #include "chrome/views/window/dialog_delegate.h" | 21 #include "chrome/views/window/dialog_delegate.h" |
| 21 #include "chrome/views/window/window.h" | 22 #include "chrome/views/window/window.h" |
| 22 #include "grit/chromium_strings.h" | 23 #include "grit/chromium_strings.h" |
| 23 #include "grit/generated_resources.h" | 24 #include "grit/generated_resources.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 virtual void DeleteDelegate() { delete this; } | 62 virtual void DeleteDelegate() { delete this; } |
| 62 virtual bool IsModal() const { return true; } | 63 virtual bool IsModal() const { return true; } |
| 63 virtual views::View* GetContentsView() { return message_box_view_; } | 64 virtual views::View* GetContentsView() { return message_box_view_; } |
| 64 | 65 |
| 65 private: | 66 private: |
| 66 ResetDefaultsConfirmBox(HWND parent_hwnd, AdvancedPageView* page_view) | 67 ResetDefaultsConfirmBox(HWND parent_hwnd, AdvancedPageView* page_view) |
| 67 : advanced_page_view_(page_view) { | 68 : advanced_page_view_(page_view) { |
| 68 const int kDialogWidth = 400; | 69 const int kDialogWidth = 400; |
| 69 // Also deleted when the window closes. | 70 // Also deleted when the window closes. |
| 70 message_box_view_ = new MessageBoxView( | 71 message_box_view_ = new MessageBoxView( |
| 71 MessageBoxView::kFlagHasMessage | MessageBoxView::kFlagHasOKButton, | 72 MessageBox::kFlagHasMessage | MessageBox::kFlagHasOKButton, |
| 72 l10n_util::GetString(IDS_OPTIONS_RESET_MESSAGE).c_str(), | 73 l10n_util::GetString(IDS_OPTIONS_RESET_MESSAGE).c_str(), |
| 73 std::wstring(), | 74 std::wstring(), |
| 74 kDialogWidth); | 75 kDialogWidth); |
| 75 views::Window::CreateChromeWindow(parent_hwnd, gfx::Rect(), this)->Show(); | 76 views::Window::CreateChromeWindow(parent_hwnd, gfx::Rect(), this)->Show(); |
| 76 } | 77 } |
| 77 virtual ~ResetDefaultsConfirmBox() { } | 78 virtual ~ResetDefaultsConfirmBox() { } |
| 78 | 79 |
| 79 MessageBoxView* message_box_view_; | 80 MessageBoxView* message_box_view_; |
| 80 AdvancedPageView* advanced_page_view_; | 81 AdvancedPageView* advanced_page_view_; |
| 81 | 82 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 1, | 181 column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 1, |
| 181 GridLayout::USE_PREF, 0, 0); | 182 GridLayout::USE_PREF, 0, 0); |
| 182 layout->StartRow(1, single_column_view_set_id); | 183 layout->StartRow(1, single_column_view_set_id); |
| 183 layout->AddView(advanced_scroll_view_); | 184 layout->AddView(advanced_scroll_view_); |
| 184 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); | 185 layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); |
| 185 | 186 |
| 186 layout->StartRow(0, single_column_view_set_id); | 187 layout->StartRow(0, single_column_view_set_id); |
| 187 layout->AddView(reset_to_default_button_, 1, 1, | 188 layout->AddView(reset_to_default_button_, 1, 1, |
| 188 GridLayout::TRAILING, GridLayout::CENTER); | 189 GridLayout::TRAILING, GridLayout::CENTER); |
| 189 } | 190 } |
| OLD | NEW |