| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/default_search_view.h" | 5 #include "chrome/browser/ui/views/default_search_view.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/message_box_flags.h" | |
| 11 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| 12 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/search_engines/template_url.h" | 13 #include "chrome/browser/search_engines/template_url.h" |
| 15 #include "chrome/browser/search_engines/template_url_model.h" | 14 #include "chrome/browser/search_engines/template_url_model.h" |
| 16 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" | 15 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" |
| 17 #include "chrome/browser/tab_contents/tab_contents.h" | 16 #include "chrome/browser/tab_contents/tab_contents.h" |
| 18 #include "gfx/canvas.h" | 17 #include "gfx/canvas.h" |
| 19 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" |
| 20 #include "grit/locale_settings.h" | 19 #include "grit/locale_settings.h" |
| 21 #include "grit/theme_resources.h" | 20 #include "grit/theme_resources.h" |
| 21 #include "ui/base/message_box_flags.h" |
| 22 #include "views/controls/button/native_button.h" | 22 #include "views/controls/button/native_button.h" |
| 23 #include "views/controls/image_view.h" | 23 #include "views/controls/image_view.h" |
| 24 #include "views/controls/label.h" | 24 #include "views/controls/label.h" |
| 25 #include "views/grid_layout.h" | 25 #include "views/grid_layout.h" |
| 26 #include "views/standard_layout.h" | 26 #include "views/standard_layout.h" |
| 27 #include "views/window/dialog_client_view.h" | 27 #include "views/window/dialog_client_view.h" |
| 28 #include "views/window/window.h" | 28 #include "views/window/window.h" |
| 29 | 29 |
| 30 namespace { | 30 namespace { |
| 31 | 31 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 149 |
| 150 views::View* DefaultSearchView::GetInitiallyFocusedView() { | 150 views::View* DefaultSearchView::GetInitiallyFocusedView() { |
| 151 return default_provider_button_; | 151 return default_provider_button_; |
| 152 } | 152 } |
| 153 | 153 |
| 154 views::View* DefaultSearchView::GetContentsView() { | 154 views::View* DefaultSearchView::GetContentsView() { |
| 155 return this; | 155 return this; |
| 156 } | 156 } |
| 157 | 157 |
| 158 int DefaultSearchView::GetDialogButtons() const { | 158 int DefaultSearchView::GetDialogButtons() const { |
| 159 return MessageBoxFlags::DIALOGBUTTON_NONE; | 159 return ui::MessageBoxFlags::DIALOGBUTTON_NONE; |
| 160 } | 160 } |
| 161 | 161 |
| 162 bool DefaultSearchView::Accept() { | 162 bool DefaultSearchView::Accept() { |
| 163 // Check this again in case the default became managed while this dialog was | 163 // Check this again in case the default became managed while this dialog was |
| 164 // displayed. | 164 // displayed. |
| 165 TemplateURL* set_as_default = proposed_turl_.get(); | 165 TemplateURL* set_as_default = proposed_turl_.get(); |
| 166 if (!template_url_model_->CanMakeDefault(set_as_default)) | 166 if (!template_url_model_->CanMakeDefault(set_as_default)) |
| 167 return true; | 167 return true; |
| 168 | 168 |
| 169 template_url_model_->Add(proposed_turl_.release()); | 169 template_url_model_->Add(proposed_turl_.release()); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 this, | 292 this, |
| 293 IDS_DEFAULT_SEARCH_PROMPT_CURRENT, | 293 IDS_DEFAULT_SEARCH_PROMPT_CURRENT, |
| 294 default_short_name); | 294 default_short_name); |
| 295 layout->AddView(default_provider_button_); | 295 layout->AddView(default_provider_button_); |
| 296 proposed_provider_button_ = CreateProviderChoiceButton( | 296 proposed_provider_button_ = CreateProviderChoiceButton( |
| 297 this, | 297 this, |
| 298 IDS_DEFAULT_SEARCH_PROMPT_PROPOSED, | 298 IDS_DEFAULT_SEARCH_PROMPT_PROPOSED, |
| 299 proposed_short_name); | 299 proposed_short_name); |
| 300 layout->AddView(proposed_provider_button_); | 300 layout->AddView(proposed_provider_button_); |
| 301 } | 301 } |
| OLD | NEW |