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/app_list/app_list_view_delegate.h" | 5 #include "chrome/browser/ui/app_list/app_list_view_delegate.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "apps/custom_launcher_page_contents.h" | 9 #include "apps/custom_launcher_page_contents.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 std::string extension_id = it->host(); | 368 std::string extension_id = it->host(); |
369 apps::CustomLauncherPageContents* page_contents = | 369 apps::CustomLauncherPageContents* page_contents = |
370 new apps::CustomLauncherPageContents( | 370 new apps::CustomLauncherPageContents( |
371 scoped_ptr<extensions::AppDelegate>( | 371 scoped_ptr<extensions::AppDelegate>( |
372 new ChromeAppDelegate(scoped_ptr<ScopedKeepAlive>())), | 372 new ChromeAppDelegate(scoped_ptr<ScopedKeepAlive>())), |
373 extension_id); | 373 extension_id); |
374 page_contents->Initialize(profile_, *it); | 374 page_contents->Initialize(profile_, *it); |
375 custom_page_contents_.push_back(page_contents); | 375 custom_page_contents_.push_back(page_contents); |
376 } | 376 } |
377 | 377 |
| 378 std::string first_launcher_page_app_id = custom_launcher_page_urls[0].host(); |
| 379 const extensions::Extension* extension = |
| 380 extensions::ExtensionRegistry::Get(profile_) |
| 381 ->GetExtensionById(first_launcher_page_app_id, |
| 382 extensions::ExtensionRegistry::EVERYTHING); |
| 383 model_->set_custom_launcher_page_name(extension->name()); |
378 // Only the first custom launcher page gets events dispatched to it. | 384 // Only the first custom launcher page gets events dispatched to it. |
379 launcher_page_event_dispatcher_.reset( | 385 launcher_page_event_dispatcher_.reset( |
380 new app_list::LauncherPageEventDispatcher( | 386 new app_list::LauncherPageEventDispatcher(profile_, |
381 profile_, custom_launcher_page_urls[0].host())); | 387 first_launcher_page_app_id)); |
382 } | 388 } |
383 | 389 |
384 void AppListViewDelegate::OnHotwordStateChanged(bool started) { | 390 void AppListViewDelegate::OnHotwordStateChanged(bool started) { |
385 if (started) { | 391 if (started) { |
386 if (speech_ui_->state() == app_list::SPEECH_RECOGNITION_READY) { | 392 if (speech_ui_->state() == app_list::SPEECH_RECOGNITION_READY) { |
387 OnSpeechRecognitionStateChanged( | 393 OnSpeechRecognitionStateChanged( |
388 app_list::SPEECH_RECOGNITION_HOTWORD_LISTENING); | 394 app_list::SPEECH_RECOGNITION_HOTWORD_LISTENING); |
389 } | 395 } |
390 } else { | 396 } else { |
391 if (speech_ui_->state() == app_list::SPEECH_RECOGNITION_HOTWORD_LISTENING) | 397 if (speech_ui_->state() == app_list::SPEECH_RECOGNITION_HOTWORD_LISTENING) |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
820 | 826 |
821 // SigninManagerFactory is not a leaky singleton (unlike this class), and | 827 // SigninManagerFactory is not a leaky singleton (unlike this class), and |
822 // its destructor will check that it has no remaining observers. | 828 // its destructor will check that it has no remaining observers. |
823 scoped_observer_.RemoveAll(); | 829 scoped_observer_.RemoveAll(); |
824 SigninManagerFactory::GetInstance()->RemoveObserver(this); | 830 SigninManagerFactory::GetInstance()->RemoveObserver(this); |
825 break; | 831 break; |
826 default: | 832 default: |
827 NOTREACHED(); | 833 NOTREACHED(); |
828 } | 834 } |
829 } | 835 } |
OLD | NEW |