| 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/ntp/new_tab_page_sync_handler.h" | 5 #include "chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 26 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
| 27 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 27 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
| 28 #include "chrome/common/pref_names.h" | 28 #include "chrome/common/pref_names.h" |
| 29 #include "content/public/browser/render_view_host.h" | 29 #include "content/public/browser/render_view_host.h" |
| 30 #include "content/public/browser/web_ui.h" | 30 #include "content/public/browser/web_ui.h" |
| 31 #include "grit/generated_resources.h" | 31 #include "grit/generated_resources.h" |
| 32 #include "net/cookies/cookie_monster.h" | 32 #include "net/cookies/cookie_monster.h" |
| 33 #include "net/url_request/url_request_context.h" | 33 #include "net/url_request/url_request_context.h" |
| 34 #include "ui/base/l10n/l10n_util.h" | 34 #include "ui/base/l10n/l10n_util.h" |
| 35 | 35 |
| 36 // Default URL for the sync web interface. | |
| 37 // | |
| 38 // TODO(idana): when we figure out how we are going to allow third parties to | |
| 39 // plug in their own sync engine, we should allow this value to be | |
| 40 // configurable. | |
| 41 static const char kSyncDefaultViewOnlineUrl[] = "http://docs.google.com"; | |
| 42 | |
| 43 NewTabPageSyncHandler::NewTabPageSyncHandler() : sync_service_(NULL), | 36 NewTabPageSyncHandler::NewTabPageSyncHandler() : sync_service_(NULL), |
| 44 waiting_for_initial_page_load_(true) { | 37 waiting_for_initial_page_load_(true) { |
| 45 } | 38 } |
| 46 | 39 |
| 47 NewTabPageSyncHandler::~NewTabPageSyncHandler() { | 40 NewTabPageSyncHandler::~NewTabPageSyncHandler() { |
| 48 if (sync_service_) | 41 if (sync_service_) |
| 49 sync_service_->RemoveObserver(this); | 42 sync_service_->RemoveObserver(this); |
| 50 } | 43 } |
| 51 | 44 |
| 52 // static | 45 // static |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 if (linkurl.empty()) { | 195 if (linkurl.empty()) { |
| 203 value.SetBoolean("linkurlisset", false); | 196 value.SetBoolean("linkurlisset", false); |
| 204 } else { | 197 } else { |
| 205 value.SetBoolean("linkurlisset", true); | 198 value.SetBoolean("linkurlisset", true); |
| 206 value.SetString("linkurl", linkurl); | 199 value.SetString("linkurl", linkurl); |
| 207 } | 200 } |
| 208 } | 201 } |
| 209 } | 202 } |
| 210 web_ui()->CallJavascriptFunction("ntp.syncMessageChanged", value); | 203 web_ui()->CallJavascriptFunction("ntp.syncMessageChanged", value); |
| 211 } | 204 } |
| OLD | NEW |