summaryrefslogtreecommitdiff
path: root/www/chromium-uc/patches/extra/ungoogled-chromium/add-suggestions-url-field.patch
diff options
context:
space:
mode:
Diffstat (limited to 'www/chromium-uc/patches/extra/ungoogled-chromium/add-suggestions-url-field.patch')
-rw-r--r--www/chromium-uc/patches/extra/ungoogled-chromium/add-suggestions-url-field.patch116
1 files changed, 56 insertions, 60 deletions
diff --git a/www/chromium-uc/patches/extra/ungoogled-chromium/add-suggestions-url-field.patch b/www/chromium-uc/patches/extra/ungoogled-chromium/add-suggestions-url-field.patch
index 9ff8cfa..1b30554 100644
--- a/www/chromium-uc/patches/extra/ungoogled-chromium/add-suggestions-url-field.patch
+++ b/www/chromium-uc/patches/extra/ungoogled-chromium/add-suggestions-url-field.patch
@@ -1,8 +1,8 @@
1# Add suggestions URL text field to the search engine editing dialog 1# Add suggestions URL text field to the search engine editing dialog
2# (chrome://settings/searchEngines). 2# (chrome://settings/searchEngines).
3 3
4--- chrome/browser/resources/settings/search_engines_page/search_engine_dialog.html.orig 4--- a/chrome/browser/resources/settings/search_engines_page/search_engine_edit_dialog.html
5+++ chrome/browser/resources/settings/search_engines_page/search_engine_dialog.html 5+++ b/chrome/browser/resources/settings/search_engines_page/search_engine_edit_dialog.html
6@@ -20,6 +20,13 @@ 6@@ -20,6 +20,13 @@
7 value="{{queryUrl_}}" on-focus="validate_" on-input="validate_" 7 value="{{queryUrl_}}" on-focus="validate_" on-input="validate_"
8 disabled$="[[model.urlLocked]]"> 8 disabled$="[[model.urlLocked]]">
@@ -17,9 +17,9 @@
17 </div> 17 </div>
18 <div slot="button-container"> 18 <div slot="button-container">
19 <cr-button class="cancel-button" on-click="cancel_" id="cancel"> 19 <cr-button class="cancel-button" on-click="cancel_" id="cancel">
20--- chrome/browser/resources/settings/search_engines_page/search_engine_dialog.ts.orig 20--- a/chrome/browser/resources/settings/search_engines_page/search_engine_edit_dialog.ts
21+++ chrome/browser/resources/settings/search_engines_page/search_engine_dialog.ts 21+++ b/chrome/browser/resources/settings/search_engines_page/search_engine_edit_dialog.ts
22@@ -26,6 +26,7 @@ interface SettingsSearchEngineDialogElem 22@@ -28,6 +28,7 @@ export interface SettingsSearchEngineEdi
23 dialog: CrDialogElement, 23 dialog: CrDialogElement,
24 keyword: CrInputElement, 24 keyword: CrInputElement,
25 queryUrl: CrInputElement, 25 queryUrl: CrInputElement,
@@ -27,23 +27,23 @@
27 searchEngine: CrInputElement, 27 searchEngine: CrInputElement,
28 }; 28 };
29 } 29 }
30@@ -54,6 +55,7 @@ class SettingsSearchEngineDialogElement 30@@ -56,6 +57,7 @@ export class SettingsSearchEngineEditDia
31 searchEngine_: String, 31 searchEngine_: String,
32 keyword_: String, 32 keyword_: String,
33 queryUrl_: String, 33 queryUrl_: String,
34+ suggestionsUrl_: String, 34+ suggestionsUrl_: String,
35 dialogTitle_: String, 35 dialogTitle_: String,
36 keywordFieldLabel_: String,
36 actionButtonText_: String, 37 actionButtonText_: String,
37 }; 38@@ -72,6 +74,7 @@ export class SettingsSearchEngineEditDia
38@@ -63,6 +65,7 @@ class SettingsSearchEngineDialogElement
39 private searchEngine_: string; 39 private searchEngine_: string;
40 private keyword_: string; 40 private keyword_: string;
41 private queryUrl_: string; 41 private queryUrl_: string;
42+ private suggestionsUrl_: string; 42+ private suggestionsUrl_: string;
43 private dialogTitle_: string; 43 private dialogTitle_: string;
44 private keywordFieldLabel_: string;
44 private actionButtonText_: string; 45 private actionButtonText_: string;
45 private browserProxy_: SearchEnginesBrowserProxy = 46@@ -103,6 +106,7 @@ export class SettingsSearchEngineEditDia
46@@ -92,6 +95,7 @@ class SettingsSearchEngineDialogElement
47 this.searchEngine_ = this.model.name; 47 this.searchEngine_ = this.model.name;
48 this.keyword_ = this.model.keyword; 48 this.keyword_ = this.model.keyword;
49 this.queryUrl_ = this.model.url; 49 this.queryUrl_ = this.model.url;
@@ -51,7 +51,7 @@
51 } else { 51 } else {
52 this.dialogTitle_ = 52 this.dialogTitle_ =
53 loadTimeData.getString('searchEnginesAddSearchEngine'); 53 loadTimeData.getString('searchEnginesAddSearchEngine');
54@@ -127,8 +131,12 @@ class SettingsSearchEngineDialogElement 54@@ -142,8 +146,12 @@ export class SettingsSearchEngineEditDia
55 } 55 }
56 } 56 }
57 57
@@ -66,7 +66,7 @@
66 } 66 }
67 67
68 private cancel_() { 68 private cancel_() {
69@@ -137,7 +145,8 @@ class SettingsSearchEngineDialogElement 69@@ -152,7 +160,8 @@ export class SettingsSearchEngineEditDia
70 70
71 private onActionButtonTap_() { 71 private onActionButtonTap_() {
72 this.browserProxy_.searchEngineEditCompleted( 72 this.browserProxy_.searchEngineEditCompleted(
@@ -76,7 +76,7 @@
76 this.$.dialog.close(); 76 this.$.dialog.close();
77 } 77 }
78 78
79@@ -165,9 +174,11 @@ class SettingsSearchEngineDialogElement 79@@ -180,9 +189,11 @@ export class SettingsSearchEngineEditDia
80 80
81 private updateActionButtonState_() { 81 private updateActionButtonState_() {
82 const allValid = [ 82 const allValid = [
@@ -90,17 +90,17 @@
90 }); 90 });
91 this.$.actionButton.disabled = !allValid; 91 this.$.actionButton.disabled = !allValid;
92 } 92 }
93--- chrome/browser/resources/settings/search_engines_page/search_engines_browser_proxy.ts.orig 93--- a/chrome/browser/resources/settings/search_engines_page/search_engines_browser_proxy.ts
94+++ chrome/browser/resources/settings/search_engines_page/search_engines_browser_proxy.ts 94+++ b/chrome/browser/resources/settings/search_engines_page/search_engines_browser_proxy.ts
95@@ -30,6 +30,7 @@ export type SearchEngine = { 95@@ -31,6 +31,7 @@ export type SearchEngine = {
96 modelIndex: number,
97 name: string, 96 name: string,
97 shouldConfirmDeletion: boolean,
98 url: string, 98 url: string,
99+ suggestionsUrl: string, 99+ suggestionsUrl: string,
100 urlLocked: boolean, 100 urlLocked: boolean,
101 }; 101 };
102 102
103@@ -53,7 +54,7 @@ export interface SearchEnginesBrowserPro 103@@ -73,7 +74,7 @@ export interface SearchEnginesBrowserPro
104 searchEngineEditCancelled(): void; 104 searchEngineEditCancelled(): void;
105 105
106 searchEngineEditCompleted( 106 searchEngineEditCompleted(
@@ -109,7 +109,7 @@
109 109
110 getSearchEnginesList(): Promise<SearchEnginesInfo>; 110 getSearchEnginesList(): Promise<SearchEnginesInfo>;
111 111
112@@ -84,11 +85,12 @@ export class SearchEnginesBrowserProxyIm 112@@ -114,11 +115,12 @@ export class SearchEnginesBrowserProxyIm
113 } 113 }
114 114
115 searchEngineEditCompleted( 115 searchEngineEditCompleted(
@@ -123,8 +123,8 @@
123 ]); 123 ]);
124 } 124 }
125 125
126--- chrome/browser/ui/search_engines/edit_search_engine_controller.cc.orig 126--- a/chrome/browser/ui/search_engines/edit_search_engine_controller.cc
127+++ chrome/browser/ui/search_engines/edit_search_engine_controller.cc 127+++ b/chrome/browser/ui/search_engines/edit_search_engine_controller.cc
128@@ -67,6 +67,15 @@ bool EditSearchEngineController::IsURLVa 128@@ -67,6 +67,15 @@ bool EditSearchEngineController::IsURLVa
129 .is_valid(); 129 .is_valid();
130 } 130 }
@@ -165,8 +165,8 @@
165 } 165 }
166 } 166 }
167 167
168--- chrome/browser/ui/search_engines/edit_search_engine_controller.h.orig 168--- a/chrome/browser/ui/search_engines/edit_search_engine_controller.h
169+++ chrome/browser/ui/search_engines/edit_search_engine_controller.h 169+++ b/chrome/browser/ui/search_engines/edit_search_engine_controller.h
170@@ -23,7 +23,8 @@ class EditSearchEngineControllerDelegate 170@@ -23,7 +23,8 @@ class EditSearchEngineControllerDelegate
171 virtual void OnEditedKeyword(TemplateURL* template_url, 171 virtual void OnEditedKeyword(TemplateURL* template_url,
172 const std::u16string& title, 172 const std::u16string& title,
@@ -196,8 +196,8 @@
196 196
197 // Deletes an unused TemplateURL, if its add was cancelled and it's not 197 // Deletes an unused TemplateURL, if its add was cancelled and it's not
198 // already owned by the TemplateURLService. 198 // already owned by the TemplateURLService.
199--- chrome/browser/ui/search_engines/keyword_editor_controller.cc.orig 199--- a/chrome/browser/ui/search_engines/keyword_editor_controller.cc
200+++ chrome/browser/ui/search_engines/keyword_editor_controller.cc 200+++ b/chrome/browser/ui/search_engines/keyword_editor_controller.cc
201@@ -21,23 +21,27 @@ KeywordEditorController::KeywordEditorCo 201@@ -21,23 +21,27 @@ KeywordEditorController::KeywordEditorCo
202 KeywordEditorController::~KeywordEditorController() { 202 KeywordEditorController::~KeywordEditorController() {
203 } 203 }
@@ -249,8 +249,8 @@
249 249
250 base::RecordAction(UserMetricsAction("KeywordEditor_ModifiedKeyword")); 250 base::RecordAction(UserMetricsAction("KeywordEditor_ModifiedKeyword"));
251 } 251 }
252--- chrome/browser/ui/search_engines/keyword_editor_controller.h.orig 252--- a/chrome/browser/ui/search_engines/keyword_editor_controller.h
253+++ chrome/browser/ui/search_engines/keyword_editor_controller.h 253+++ b/chrome/browser/ui/search_engines/keyword_editor_controller.h
254@@ -29,14 +29,16 @@ class KeywordEditorController { 254@@ -29,14 +29,16 @@ class KeywordEditorController {
255 // model. Returns the index of the added URL. 255 // model. Returns the index of the added URL.
256 int AddTemplateURL(const std::u16string& title, 256 int AddTemplateURL(const std::u16string& title,
@@ -270,9 +270,9 @@
270 270
271 // Return true if the given |url| can be edited. 271 // Return true if the given |url| can be edited.
272 bool CanEdit(const TemplateURL* url) const; 272 bool CanEdit(const TemplateURL* url) const;
273--- chrome/browser/ui/search_engines/template_url_table_model.cc.orig 273--- a/chrome/browser/ui/search_engines/template_url_table_model.cc
274+++ chrome/browser/ui/search_engines/template_url_table_model.cc 274+++ b/chrome/browser/ui/search_engines/template_url_table_model.cc
275@@ -109,21 +109,25 @@ void TemplateURLTableModel::Remove(int i 275@@ -108,21 +108,25 @@ void TemplateURLTableModel::Remove(int i
276 void TemplateURLTableModel::Add(int index, 276 void TemplateURLTableModel::Add(int index,
277 const std::u16string& short_name, 277 const std::u16string& short_name,
278 const std::u16string& keyword, 278 const std::u16string& keyword,
@@ -303,7 +303,7 @@
303 DCHECK(index >= 0 && index <= RowCount()); 303 DCHECK(index >= 0 && index <= RowCount());
304 DCHECK(!url.empty()); 304 DCHECK(!url.empty());
305 TemplateURL* template_url = GetTemplateURL(index); 305 TemplateURL* template_url = GetTemplateURL(index);
306@@ -132,7 +136,8 @@ void TemplateURLTableModel::ModifyTempla 306@@ -131,7 +135,8 @@ void TemplateURLTableModel::ModifyTempla
307 DCHECK(template_url_service_->GetDefaultSearchProvider() != template_url || 307 DCHECK(template_url_service_->GetDefaultSearchProvider() != template_url ||
308 template_url->SupportsReplacement( 308 template_url->SupportsReplacement(
309 template_url_service_->search_terms_data())); 309 template_url_service_->search_terms_data()));
@@ -313,9 +313,9 @@
313 } 313 }
314 314
315 TemplateURL* TemplateURLTableModel::GetTemplateURL(int index) { 315 TemplateURL* TemplateURLTableModel::GetTemplateURL(int index) {
316--- chrome/browser/ui/search_engines/template_url_table_model.h.orig 316--- a/chrome/browser/ui/search_engines/template_url_table_model.h
317+++ chrome/browser/ui/search_engines/template_url_table_model.h 317+++ b/chrome/browser/ui/search_engines/template_url_table_model.h
318@@ -54,13 +54,15 @@ class TemplateURLTableModel : public ui: 318@@ -53,13 +53,15 @@ class TemplateURLTableModel : public ui:
319 void Add(int index, 319 void Add(int index,
320 const std::u16string& short_name, 320 const std::u16string& short_name,
321 const std::u16string& keyword, 321 const std::u16string& keyword,
@@ -333,8 +333,8 @@
333 333
334 // Reloads the icon at the specified index. 334 // Reloads the icon at the specified index.
335 void ReloadIcon(int index); 335 void ReloadIcon(int index);
336--- chrome/browser/ui/webui/settings/search_engines_handler.cc.orig 336--- a/chrome/browser/ui/webui/settings/search_engines_handler.cc
337+++ chrome/browser/ui/webui/settings/search_engines_handler.cc 337+++ b/chrome/browser/ui/webui/settings/search_engines_handler.cc
338@@ -37,6 +37,7 @@ namespace { 338@@ -37,6 +37,7 @@ namespace {
339 const char kSearchEngineField[] = "searchEngine"; 339 const char kSearchEngineField[] = "searchEngine";
340 const char kKeywordField[] = "keyword"; 340 const char kKeywordField[] = "keyword";
@@ -345,12 +345,12 @@
345 const int kNewSearchEngineIndex = -1; 345 const int kNewSearchEngineIndex = -1;
346@@ -212,6 +213,9 @@ SearchEnginesHandler::CreateDictionaryFo 346@@ -212,6 +213,9 @@ SearchEnginesHandler::CreateDictionaryFo
347 Profile* profile = Profile::FromWebUI(web_ui()); 347 Profile* profile = Profile::FromWebUI(web_ui());
348 dict->SetString( 348 dict->SetStringKey(
349 "url", template_url->url_ref().DisplayURL(UIThreadSearchTermsData())); 349 "url", template_url->url_ref().DisplayURL(UIThreadSearchTermsData()));
350+ dict->SetString("suggestionsUrl", 350+ dict->SetStringKey("suggestionsUrl",
351+ template_url->suggestions_url_ref().DisplayURL( 351+ template_url->suggestions_url_ref().DisplayURL(
352+ UIThreadSearchTermsData())); 352+ UIThreadSearchTermsData()));
353 dict->SetBoolean("urlLocked", template_url->prepopulate_id() > 0); 353 dict->SetBoolKey("urlLocked", template_url->prepopulate_id() > 0);
354 GURL icon_url = template_url->favicon_url(); 354 GURL icon_url = template_url->favicon_url();
355 if (icon_url.is_valid()) 355 if (icon_url.is_valid())
356@@ -325,12 +329,14 @@ void SearchEnginesHandler::HandleSearchE 356@@ -325,12 +329,14 @@ void SearchEnginesHandler::HandleSearchE
@@ -371,7 +371,7 @@
371 371
372 edit_controller_.reset(); 372 edit_controller_.reset();
373 } 373 }
374@@ -361,6 +367,8 @@ bool SearchEnginesHandler::CheckFieldVal 374@@ -358,6 +364,8 @@ bool SearchEnginesHandler::CheckFieldVal
375 is_valid = edit_controller_->IsKeywordValid(base::UTF8ToUTF16(field_value)); 375 is_valid = edit_controller_->IsKeywordValid(base::UTF8ToUTF16(field_value));
376 else if (field_name.compare(kQueryUrlField) == 0) 376 else if (field_name.compare(kQueryUrlField) == 0)
377 is_valid = edit_controller_->IsURLValid(field_value); 377 is_valid = edit_controller_->IsURLValid(field_value);
@@ -380,15 +380,11 @@
380 else 380 else
381 NOTREACHED(); 381 NOTREACHED();
382 382
383@@ -382,17 +390,21 @@ void SearchEnginesHandler::HandleSearchE 383@@ -379,14 +387,17 @@ void SearchEnginesHandler::HandleSearchE
384 std::string search_engine; 384 const std::string& search_engine = args[0].GetString();
385 std::string keyword; 385 const std::string& keyword = args[1].GetString();
386 std::string query_url; 386 const std::string& query_url = args[2].GetString();
387+ std::string suggestions_url; 387+ const std::string& suggestions_url = args[3].GetString();
388 CHECK(args->GetString(0, &search_engine));
389 CHECK(args->GetString(1, &keyword));
390 CHECK(args->GetString(2, &query_url));
391+ CHECK(args->GetString(3, &suggestions_url));
392 388
393 // Recheck validity. It's possible to get here with invalid input if e.g. the 389 // Recheck validity. It's possible to get here with invalid input if e.g. the
394 // user calls the right JS functions directly from the web inspector. 390 // user calls the right JS functions directly from the web inspector.
@@ -404,9 +400,9 @@
404 } 400 }
405 } 401 }
406 402
407--- chrome/browser/ui/webui/settings/search_engines_handler.h.orig 403--- a/chrome/browser/ui/webui/settings/search_engines_handler.h
408+++ chrome/browser/ui/webui/settings/search_engines_handler.h 404+++ b/chrome/browser/ui/webui/settings/search_engines_handler.h
409@@ -50,7 +50,8 @@ class SearchEnginesHandler : public Sett 405@@ -45,7 +45,8 @@ class SearchEnginesHandler : public Sett
410 void OnEditedKeyword(TemplateURL* template_url, 406 void OnEditedKeyword(TemplateURL* template_url,
411 const std::u16string& title, 407 const std::u16string& title,
412 const std::u16string& keyword, 408 const std::u16string& keyword,
@@ -416,9 +412,9 @@
416 412
417 // SettingsPageUIHandler implementation. 413 // SettingsPageUIHandler implementation.
418 void RegisterMessages() override; 414 void RegisterMessages() override;
419@@ -82,8 +83,8 @@ class SearchEnginesHandler : public Sett 415@@ -77,8 +78,8 @@ class SearchEnginesHandler : public Sett
420 // to WebUI. Called from WebUI. 416 // to WebUI. Called from WebUI.
421 void HandleValidateSearchEngineInput(const base::ListValue* args); 417 void HandleValidateSearchEngineInput(base::Value::ConstListView args);
422 418
423- // Checks whether the given user input field (searchEngine, keyword, queryUrl) 419- // Checks whether the given user input field (searchEngine, keyword, queryUrl)
424- // is populated with a valid value. 420- // is populated with a valid value.
@@ -427,9 +423,9 @@
427 bool CheckFieldValidity(const std::string& field_name, 423 bool CheckFieldValidity(const std::string& field_name,
428 const std::string& field_value); 424 const std::string& field_value);
429 425
430--- components/search_engines/template_url_service.cc.orig 426--- a/components/search_engines/template_url_service.cc
431+++ components/search_engines/template_url_service.cc 427+++ b/components/search_engines/template_url_service.cc
432@@ -641,7 +641,8 @@ void TemplateURLService::IncrementUsageC 428@@ -643,7 +643,8 @@ void TemplateURLService::IncrementUsageC
433 void TemplateURLService::ResetTemplateURL(TemplateURL* url, 429 void TemplateURLService::ResetTemplateURL(TemplateURL* url,
434 const std::u16string& title, 430 const std::u16string& title,
435 const std::u16string& keyword, 431 const std::u16string& keyword,
@@ -439,7 +435,7 @@
439 DCHECK(!IsCreatedByExtension(url)); 435 DCHECK(!IsCreatedByExtension(url));
440 DCHECK(!keyword.empty()); 436 DCHECK(!keyword.empty());
441 DCHECK(!search_url.empty()); 437 DCHECK(!search_url.empty());
442@@ -656,6 +657,7 @@ void TemplateURLService::ResetTemplateUR 438@@ -658,6 +659,7 @@ void TemplateURLService::ResetTemplateUR
443 data.safe_for_autoreplace = false; 439 data.safe_for_autoreplace = false;
444 data.last_modified = clock_->Now(); 440 data.last_modified = clock_->Now();
445 data.is_active = TemplateURLData::ActiveStatus::kTrue; 441 data.is_active = TemplateURLData::ActiveStatus::kTrue;
@@ -447,8 +443,8 @@
447 443
448 Update(url, TemplateURL(data)); 444 Update(url, TemplateURL(data));
449 } 445 }
450--- components/search_engines/template_url_service.h.orig 446--- a/components/search_engines/template_url_service.h
451+++ components/search_engines/template_url_service.h 447+++ b/components/search_engines/template_url_service.h
452@@ -253,7 +253,8 @@ class TemplateURLService : public WebDat 448@@ -253,7 +253,8 @@ class TemplateURLService : public WebDat
453 void ResetTemplateURL(TemplateURL* url, 449 void ResetTemplateURL(TemplateURL* url,
454 const std::u16string& title, 450 const std::u16string& title,