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/extensions/app_notify_channel_setup.h" | 5 #include "chrome/browser/extensions/app_notify_channel_setup.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/browser/prefs/pref_service.h" | 8 #include "chrome/browser/prefs/pref_service.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
11 #include "chrome/common/pref_names.h" | 11 #include "chrome/common/pref_names.h" |
12 #include "content/browser/browser_thread.h" | 12 #include "content/browser/browser_thread.h" |
| 13 #include "content/common/net/url_fetcher.h" |
13 #include "net/base/escape.h" | 14 #include "net/base/escape.h" |
14 #include "net/url_request/url_request_status.h" | 15 #include "net/url_request/url_request_status.h" |
15 | 16 |
16 AppNotifyChannelSetup::AppNotifyChannelSetup( | 17 AppNotifyChannelSetup::AppNotifyChannelSetup( |
17 Profile* profile, | 18 Profile* profile, |
18 const std::string& client_id, | 19 const std::string& client_id, |
19 const GURL& requestor_url, | 20 const GURL& requestor_url, |
20 int return_route_id, | 21 int return_route_id, |
21 int callback_id, | 22 int callback_id, |
22 base::WeakPtr<AppNotifyChannelSetup::Delegate> delegate) | 23 base::WeakPtr<AppNotifyChannelSetup::Delegate> delegate) |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 100 |
100 void AppNotifyChannelSetup::ReportResult( | 101 void AppNotifyChannelSetup::ReportResult( |
101 const std::string& channel_id, | 102 const std::string& channel_id, |
102 const std::string& error) { | 103 const std::string& error) { |
103 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 104 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
104 if (delegate_.get()) | 105 if (delegate_.get()) |
105 delegate_->AppNotifyChannelSetupComplete( | 106 delegate_->AppNotifyChannelSetupComplete( |
106 channel_id, error, return_route_id_, callback_id_); | 107 channel_id, error, return_route_id_, callback_id_); |
107 Release(); // Matches AddRef in Start. | 108 Release(); // Matches AddRef in Start. |
108 } | 109 } |
OLD | NEW |