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/views/ash/launcher/chrome_launcher_controller.h" | 5 #include "chrome/browser/ui/views/ash/launcher/chrome_launcher_controller.h" |
6 | 6 |
7 #include "ash/launcher/launcher_model.h" | 7 #include "ash/launcher/launcher_model.h" |
8 #include "ash/launcher/launcher_types.h" | 8 #include "ash/launcher/launcher_types.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "chrome/browser/defaults.h" | 14 #include "chrome/browser/defaults.h" |
15 #include "chrome/browser/extensions/extension_service.h" | 15 #include "chrome/browser/extensions/extension_service.h" |
16 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 16 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
17 #include "chrome/browser/prefs/pref_service.h" | 17 #include "chrome/browser/prefs/pref_service.h" |
18 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 18 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
20 #include "chrome/browser/profiles/profile_manager.h" | 20 #include "chrome/browser/profiles/profile_manager.h" |
21 #include "chrome/browser/ui/browser.h" | 21 #include "chrome/browser/ui/browser.h" |
22 #include "chrome/browser/ui/browser_list.h" | 22 #include "chrome/browser/ui/browser_finder.h" |
23 #include "chrome/browser/ui/browser_window.h" | 23 #include "chrome/browser/ui/browser_window.h" |
24 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 24 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
25 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 25 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
26 #include "chrome/browser/ui/views/ash/extension_utils.h" | 26 #include "chrome/browser/ui/views/ash/extension_utils.h" |
27 #include "chrome/browser/ui/views/ash/launcher/browser_launcher_item_controller.
h" | 27 #include "chrome/browser/ui/views/ash/launcher/browser_launcher_item_controller.
h" |
28 #include "chrome/browser/ui/views/ash/launcher/launcher_app_icon_loader.h" | 28 #include "chrome/browser/ui/views/ash/launcher/launcher_app_icon_loader.h" |
29 #include "chrome/browser/ui/views/ash/launcher/launcher_context_menu.h" | 29 #include "chrome/browser/ui/views/ash/launcher/launcher_context_menu.h" |
30 #include "chrome/browser/web_applications/web_app.h" | 30 #include "chrome/browser/web_applications/web_app.h" |
31 #include "chrome/common/chrome_notification_types.h" | 31 #include "chrome/common/chrome_notification_types.h" |
32 #include "chrome/common/extensions/extension.h" | 32 #include "chrome/common/extensions/extension.h" |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 value = kShelfAutoHideBehaviorAlways; | 405 value = kShelfAutoHideBehaviorAlways; |
406 break; | 406 break; |
407 case ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER: | 407 case ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER: |
408 value = kShelfAutoHideBehaviorNever; | 408 value = kShelfAutoHideBehaviorNever; |
409 break; | 409 break; |
410 } | 410 } |
411 profile_->GetPrefs()->SetString(prefs::kShelfAutoHideBehavior, value); | 411 profile_->GetPrefs()->SetString(prefs::kShelfAutoHideBehavior, value); |
412 } | 412 } |
413 | 413 |
414 void ChromeLauncherController::CreateNewTab() { | 414 void ChromeLauncherController::CreateNewTab() { |
415 Browser *last_browser = BrowserList::FindTabbedBrowser( | 415 Browser *last_browser = browser::FindTabbedBrowser( |
416 GetProfileForNewWindows(), true); | 416 GetProfileForNewWindows(), true); |
417 | 417 |
418 if (!last_browser) { | 418 if (!last_browser) { |
419 CreateNewWindow(); | 419 CreateNewWindow(); |
420 return; | 420 return; |
421 } | 421 } |
422 | 422 |
423 last_browser->NewTab(); | 423 last_browser->NewTab(); |
424 aura::Window* window = last_browser->window()->GetNativeHandle(); | 424 aura::Window* window = last_browser->window()->GetNativeHandle(); |
425 window->Show(); | 425 window->Show(); |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 } else { | 670 } else { |
671 Item pending_item; | 671 Item pending_item; |
672 pending_item.item_type = TYPE_APP; | 672 pending_item.item_type = TYPE_APP; |
673 pending_item.app_id = app_id; | 673 pending_item.app_id = app_id; |
674 pending_pinned_apps_.push_back(pending_item); | 674 pending_pinned_apps_.push_back(pending_item); |
675 } | 675 } |
676 } | 676 } |
677 } | 677 } |
678 } | 678 } |
679 } | 679 } |
OLD | NEW |