Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(237)

Side by Side Diff: chrome/browser/automation/automation_provider_observers.cc

Issue 10238014: Fix search engine automation hooks to work with multiple profiles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/automation/automation_provider_observers.h" 5 #include "chrome/browser/automation/automation_provider_observers.h"
6 6
7 #include <deque> 7 #include <deque>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after
1522 return; 1522 return;
1523 1523
1524 download_manager_->RemoveObserver(this); 1524 download_manager_->RemoveObserver(this);
1525 if (provider_) 1525 if (provider_)
1526 AutomationJSONReply(provider_, reply_message_.release()).SendSuccess(NULL); 1526 AutomationJSONReply(provider_, reply_message_.release()).SendSuccess(NULL);
1527 delete this; 1527 delete this;
1528 } 1528 }
1529 1529
1530 AutomationProviderSearchEngineObserver::AutomationProviderSearchEngineObserver( 1530 AutomationProviderSearchEngineObserver::AutomationProviderSearchEngineObserver(
1531 AutomationProvider* provider, 1531 AutomationProvider* provider,
1532 Profile* profile,
1532 IPC::Message* reply_message) 1533 IPC::Message* reply_message)
1533 : provider_(provider->AsWeakPtr()), 1534 : provider_(provider->AsWeakPtr()),
1535 profile_(profile),
1534 reply_message_(reply_message) { 1536 reply_message_(reply_message) {
1535 } 1537 }
1536 1538
1537 AutomationProviderSearchEngineObserver:: 1539 AutomationProviderSearchEngineObserver::
1538 ~AutomationProviderSearchEngineObserver() {} 1540 ~AutomationProviderSearchEngineObserver() {}
1539 1541
1540 void AutomationProviderSearchEngineObserver::OnTemplateURLServiceChanged() { 1542 void AutomationProviderSearchEngineObserver::OnTemplateURLServiceChanged() {
1541 if (provider_) { 1543 if (provider_) {
1542 TemplateURLService* url_service = 1544 TemplateURLService* url_service =
1543 TemplateURLServiceFactory::GetForProfile(provider_->profile()); 1545 TemplateURLServiceFactory::GetForProfile(profile_);
1544 url_service->RemoveObserver(this); 1546 url_service->RemoveObserver(this);
1545 AutomationJSONReply(provider_, reply_message_.release()).SendSuccess(NULL); 1547 AutomationJSONReply(provider_, reply_message_.release()).SendSuccess(NULL);
1546 } 1548 }
1547 delete this; 1549 delete this;
1548 } 1550 }
1549 1551
1550 AutomationProviderHistoryObserver::AutomationProviderHistoryObserver( 1552 AutomationProviderHistoryObserver::AutomationProviderHistoryObserver(
1551 AutomationProvider* provider, 1553 AutomationProvider* provider,
1552 IPC::Message* reply_message) 1554 IPC::Message* reply_message)
1553 : provider_(provider->AsWeakPtr()), 1555 : provider_(provider->AsWeakPtr()),
(...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after
3055 } 3057 }
3056 3058
3057 ExtensionHost* host = content::Details<ExtensionHost>(details).ptr(); 3059 ExtensionHost* host = content::Details<ExtensionHost>(details).ptr();
3058 if (host->extension_id() == extension_id_ && 3060 if (host->extension_id() == extension_id_ &&
3059 host->extension_host_type() == chrome::VIEW_TYPE_EXTENSION_POPUP) { 3061 host->extension_host_type() == chrome::VIEW_TYPE_EXTENSION_POPUP) {
3060 AutomationJSONReply(automation_, reply_message_.release()) 3062 AutomationJSONReply(automation_, reply_message_.release())
3061 .SendSuccess(NULL); 3063 .SendSuccess(NULL);
3062 delete this; 3064 delete this;
3063 } 3065 }
3064 } 3066 }
OLDNEW
« no previous file with comments | « chrome/browser/automation/automation_provider_observers.h ('k') | chrome/browser/automation/testing_automation_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698