| 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 22 matching lines...) Expand all Loading... |
| 33 #include "chrome/common/url_constants.h" | 33 #include "chrome/common/url_constants.h" |
| 34 #include "components/search_engines/template_url_prepopulate_data.h" | 34 #include "components/search_engines/template_url_prepopulate_data.h" |
| 35 #include "components/search_engines/template_url_service.h" | 35 #include "components/search_engines/template_url_service.h" |
| 36 #include "components/ui/zoom/zoom_controller.h" | 36 #include "components/ui/zoom/zoom_controller.h" |
| 37 #include "content/public/browser/browser_thread.h" | 37 #include "content/public/browser/browser_thread.h" |
| 38 #include "content/public/browser/notification_details.h" | 38 #include "content/public/browser/notification_details.h" |
| 39 #include "content/public/browser/notification_observer.h" | 39 #include "content/public/browser/notification_observer.h" |
| 40 #include "content/public/browser/notification_registrar.h" | 40 #include "content/public/browser/notification_registrar.h" |
| 41 #include "content/public/browser/notification_service.h" | 41 #include "content/public/browser/notification_service.h" |
| 42 #include "content/public/browser/notification_source.h" | 42 #include "content/public/browser/notification_source.h" |
| 43 #include "content/public/browser/render_view_host.h" |
| 44 #include "content/public/browser/render_widget_host_view.h" |
| 43 #include "content/public/browser/speech_recognition_session_preamble.h" | 45 #include "content/public/browser/speech_recognition_session_preamble.h" |
| 44 #include "content/public/browser/web_contents.h" | 46 #include "content/public/browser/web_contents.h" |
| 45 #include "content/public/browser/web_contents_delegate.h" | 47 #include "content/public/browser/web_contents_delegate.h" |
| 46 #include "extensions/browser/extension_system_provider.h" | 48 #include "extensions/browser/extension_system_provider.h" |
| 47 #include "extensions/browser/extensions_browser_client.h" | 49 #include "extensions/browser/extensions_browser_client.h" |
| 48 #include "extensions/common/extension.h" | 50 #include "extensions/common/extension.h" |
| 49 #include "net/base/load_flags.h" | 51 #include "net/base/load_flags.h" |
| 50 #include "net/base/network_change_notifier.h" | 52 #include "net/base/network_change_notifier.h" |
| 51 #include "net/url_request/url_fetcher.h" | 53 #include "net/url_request/url_fetcher.h" |
| 52 #include "ui/app_list/app_list_switches.h" | 54 #include "ui/app_list/app_list_switches.h" |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 // by this object. Otherwise it will react to DidNavigateMainFrame after this | 577 // by this object. Otherwise it will react to DidNavigateMainFrame after this |
| 576 // object does, resetting the zoom mode in the process. | 578 // object does, resetting the zoom mode in the process. |
| 577 ui_zoom::ZoomController::CreateForWebContents(contents_.get()); | 579 ui_zoom::ZoomController::CreateForWebContents(contents_.get()); |
| 578 Observe(contents_.get()); | 580 Observe(contents_.get()); |
| 579 | 581 |
| 580 contents_->GetController().LoadURL( | 582 contents_->GetController().LoadURL( |
| 581 GURL(chrome::kChromeUIAppListStartPageURL), | 583 GURL(chrome::kChromeUIAppListStartPageURL), |
| 582 content::Referrer(), | 584 content::Referrer(), |
| 583 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, | 585 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, |
| 584 std::string()); | 586 std::string()); |
| 587 contents_->GetRenderViewHost()->GetView()->SetBackgroundColor( |
| 588 SK_ColorTRANSPARENT); |
| 585 } | 589 } |
| 586 | 590 |
| 587 void StartPageService::UnloadContents() { | 591 void StartPageService::UnloadContents() { |
| 588 contents_.reset(); | 592 contents_.reset(); |
| 589 webui_finished_loading_ = false; | 593 webui_finished_loading_ = false; |
| 590 } | 594 } |
| 591 | 595 |
| 592 void StartPageService::FetchDoodleJson() { | 596 void StartPageService::FetchDoodleJson() { |
| 593 GURL::Replacements replacements; | 597 GURL::Replacements replacements; |
| 594 replacements.SetPathStr(kDoodleJsonPath); | 598 replacements.SetPathStr(kDoodleJsonPath); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 | 644 |
| 641 // Check for a new doodle. | 645 // Check for a new doodle. |
| 642 content::BrowserThread::PostDelayedTask( | 646 content::BrowserThread::PostDelayedTask( |
| 643 content::BrowserThread::UI, FROM_HERE, | 647 content::BrowserThread::UI, FROM_HERE, |
| 644 base::Bind(&StartPageService::FetchDoodleJson, | 648 base::Bind(&StartPageService::FetchDoodleJson, |
| 645 weak_factory_.GetWeakPtr()), | 649 weak_factory_.GetWeakPtr()), |
| 646 recheck_delay); | 650 recheck_delay); |
| 647 } | 651 } |
| 648 | 652 |
| 649 } // namespace app_list | 653 } // namespace app_list |
| OLD | NEW |