| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/app_list/start_page_service.h" | 5 #include "chrome/browser/ui/app_list/start_page_service.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 #include "content/public/browser/notification_observer.h" | 40 #include "content/public/browser/notification_observer.h" |
| 41 #include "content/public/browser/notification_registrar.h" | 41 #include "content/public/browser/notification_registrar.h" |
| 42 #include "content/public/browser/notification_service.h" | 42 #include "content/public/browser/notification_service.h" |
| 43 #include "content/public/browser/notification_source.h" | 43 #include "content/public/browser/notification_source.h" |
| 44 #include "content/public/browser/render_view_host.h" | 44 #include "content/public/browser/render_view_host.h" |
| 45 #include "content/public/browser/render_widget_host.h" | 45 #include "content/public/browser/render_widget_host.h" |
| 46 #include "content/public/browser/render_widget_host_view.h" | 46 #include "content/public/browser/render_widget_host_view.h" |
| 47 #include "content/public/browser/speech_recognition_session_preamble.h" | 47 #include "content/public/browser/speech_recognition_session_preamble.h" |
| 48 #include "content/public/browser/web_contents.h" | 48 #include "content/public/browser/web_contents.h" |
| 49 #include "content/public/browser/web_contents_delegate.h" | 49 #include "content/public/browser/web_contents_delegate.h" |
| 50 #include "content/public/browser/web_contents_source.h" |
| 50 #include "content/public/common/content_switches.h" | 51 #include "content/public/common/content_switches.h" |
| 51 #include "extensions/browser/extension_system_provider.h" | 52 #include "extensions/browser/extension_system_provider.h" |
| 52 #include "extensions/browser/extensions_browser_client.h" | 53 #include "extensions/browser/extensions_browser_client.h" |
| 53 #include "extensions/common/extension.h" | 54 #include "extensions/common/extension.h" |
| 54 #include "net/base/load_flags.h" | 55 #include "net/base/load_flags.h" |
| 55 #include "net/base/network_change_notifier.h" | 56 #include "net/base/network_change_notifier.h" |
| 56 #include "net/url_request/url_fetcher.h" | 57 #include "net/url_request/url_fetcher.h" |
| 57 #include "ui/app_list/app_list_switches.h" | 58 #include "ui/app_list/app_list_switches.h" |
| 58 | 59 |
| 59 #if defined(OS_CHROMEOS) | 60 #if defined(OS_CHROMEOS) |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 for (const auto& cb : pending_webui_callbacks_) | 605 for (const auto& cb : pending_webui_callbacks_) |
| 605 cb.Run(); | 606 cb.Run(); |
| 606 pending_webui_callbacks_.clear(); | 607 pending_webui_callbacks_.clear(); |
| 607 | 608 |
| 608 FetchDoodleJson(); | 609 FetchDoodleJson(); |
| 609 } | 610 } |
| 610 | 611 |
| 611 void StartPageService::LoadContents() { | 612 void StartPageService::LoadContents() { |
| 612 contents_.reset(content::WebContents::Create( | 613 contents_.reset(content::WebContents::Create( |
| 613 content::WebContents::CreateParams(profile_))); | 614 content::WebContents::CreateParams(profile_))); |
| 615 WebContentsSource::CreateForWebContentsAndLocation(contents_.get(), |
| 616 FROM_HERE); |
| 614 contents_delegate_.reset(new StartPageWebContentsDelegate(profile_)); | 617 contents_delegate_.reset(new StartPageWebContentsDelegate(profile_)); |
| 615 contents_->SetDelegate(contents_delegate_.get()); | 618 contents_->SetDelegate(contents_delegate_.get()); |
| 616 | 619 |
| 617 // The ZoomController needs to be created before the web contents is observed | 620 // The ZoomController needs to be created before the web contents is observed |
| 618 // by this object. Otherwise it will react to DidNavigateMainFrame after this | 621 // by this object. Otherwise it will react to DidNavigateMainFrame after this |
| 619 // object does, resetting the zoom mode in the process. | 622 // object does, resetting the zoom mode in the process. |
| 620 ui_zoom::ZoomController::CreateForWebContents(contents_.get()); | 623 ui_zoom::ZoomController::CreateForWebContents(contents_.get()); |
| 621 Observe(contents_.get()); | 624 Observe(contents_.get()); |
| 622 | 625 |
| 623 LoadStartPageURL(); | 626 LoadStartPageURL(); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 | 695 |
| 693 // Check for a new doodle. | 696 // Check for a new doodle. |
| 694 content::BrowserThread::PostDelayedTask( | 697 content::BrowserThread::PostDelayedTask( |
| 695 content::BrowserThread::UI, FROM_HERE, | 698 content::BrowserThread::UI, FROM_HERE, |
| 696 base::Bind(&StartPageService::FetchDoodleJson, | 699 base::Bind(&StartPageService::FetchDoodleJson, |
| 697 weak_factory_.GetWeakPtr()), | 700 weak_factory_.GetWeakPtr()), |
| 698 recheck_delay); | 701 recheck_delay); |
| 699 } | 702 } |
| 700 | 703 |
| 701 } // namespace app_list | 704 } // namespace app_list |
| OLD | NEW |