OLD | NEW |
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/webui/options2/search_engine_manager_handler.h" | 5 #include "chrome/browser/ui/webui/options2/search_engine_manager_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 namespace { | 24 namespace { |
25 | 25 |
26 enum EngineInfoIndexes { | 26 enum EngineInfoIndexes { |
27 ENGINE_NAME, | 27 ENGINE_NAME, |
28 ENGINE_KEYWORD, | 28 ENGINE_KEYWORD, |
29 ENGINE_URL, | 29 ENGINE_URL, |
30 }; | 30 }; |
31 | 31 |
32 }; // namespace | 32 }; // namespace |
33 | 33 |
34 namespace options2 { | 34 namespace options { |
35 | 35 |
36 SearchEngineManagerHandler::SearchEngineManagerHandler() { | 36 SearchEngineManagerHandler::SearchEngineManagerHandler() { |
37 } | 37 } |
38 | 38 |
39 SearchEngineManagerHandler::~SearchEngineManagerHandler() { | 39 SearchEngineManagerHandler::~SearchEngineManagerHandler() { |
40 if (list_controller_.get() && list_controller_->table_model()) | 40 if (list_controller_.get() && list_controller_->table_model()) |
41 list_controller_->table_model()->SetObserver(NULL); | 41 list_controller_->table_model()->SetObserver(NULL); |
42 } | 42 } |
43 | 43 |
44 void SearchEngineManagerHandler::InitializeHandler() { | 44 void SearchEngineManagerHandler::InitializeHandler() { |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 return; | 307 return; |
308 } | 308 } |
309 // Recheck validity. It's possible to get here with invalid input if e.g. the | 309 // Recheck validity. It's possible to get here with invalid input if e.g. the |
310 // user calls the right JS functions directly from the web inspector. | 310 // user calls the right JS functions directly from the web inspector. |
311 if (edit_controller_->IsTitleValid(name) && | 311 if (edit_controller_->IsTitleValid(name) && |
312 edit_controller_->IsKeywordValid(keyword) && | 312 edit_controller_->IsKeywordValid(keyword) && |
313 edit_controller_->IsURLValid(url)) | 313 edit_controller_->IsURLValid(url)) |
314 edit_controller_->AcceptAddOrEdit(name, keyword, url); | 314 edit_controller_->AcceptAddOrEdit(name, keyword, url); |
315 } | 315 } |
316 | 316 |
317 } // namespace options2 | 317 } // namespace options |
OLD | NEW |