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