Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(380)

Side by Side Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.cc

Issue 12077055: Made launcher hidden when kicking off chrome in app mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/ash/launcher/chrome_launcher_controller_per_app.h" 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/launcher/launcher_model.h" 9 #include "ash/launcher/launcher_model.h"
10 #include "ash/launcher/launcher_util.h" 10 #include "ash/launcher/launcher_util.h"
11 #include "ash/shell.h" 11 #include "ash/shell.h"
12 #include "ash/wm/window_util.h" 12 #include "ash/wm/window_util.h"
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/string_number_conversions.h" 14 #include "base/string_number_conversions.h"
15 #include "base/values.h" 15 #include "base/values.h"
16 #include "chrome/browser/app_mode/app_mode_utils.h"
16 #include "chrome/browser/defaults.h" 17 #include "chrome/browser/defaults.h"
17 #include "chrome/browser/extensions/extension_service.h" 18 #include "chrome/browser/extensions/extension_service.h"
18 #include "chrome/browser/extensions/extension_system.h" 19 #include "chrome/browser/extensions/extension_system.h"
19 #include "chrome/browser/favicon/favicon_tab_helper.h" 20 #include "chrome/browser/favicon/favicon_tab_helper.h"
20 #include "chrome/browser/prefs/incognito_mode_prefs.h" 21 #include "chrome/browser/prefs/incognito_mode_prefs.h"
21 #include "chrome/browser/prefs/pref_service.h" 22 #include "chrome/browser/prefs/pref_service.h"
22 #include "chrome/browser/prefs/scoped_user_pref_update.h" 23 #include "chrome/browser/prefs/scoped_user_pref_update.h"
23 #include "chrome/browser/profiles/profile.h" 24 #include "chrome/browser/profiles/profile.h"
24 #include "chrome/browser/profiles/profile_manager.h" 25 #include "chrome/browser/profiles/profile_manager.h"
25 #include "chrome/browser/ui/ash/app_icon_loader_impl.h" 26 #include "chrome/browser/ui/ash/app_icon_loader_impl.h"
(...skipping 12 matching lines...) Expand all
38 #include "chrome/browser/ui/browser_commands.h" 39 #include "chrome/browser/ui/browser_commands.h"
39 #include "chrome/browser/ui/browser_finder.h" 40 #include "chrome/browser/ui/browser_finder.h"
40 #include "chrome/browser/ui/browser_list.h" 41 #include "chrome/browser/ui/browser_list.h"
41 #include "chrome/browser/ui/browser_tabstrip.h" 42 #include "chrome/browser/ui/browser_tabstrip.h"
42 #include "chrome/browser/ui/browser_window.h" 43 #include "chrome/browser/ui/browser_window.h"
43 #include "chrome/browser/ui/extensions/application_launch.h" 44 #include "chrome/browser/ui/extensions/application_launch.h"
44 #include "chrome/browser/ui/extensions/extension_enable_flow.h" 45 #include "chrome/browser/ui/extensions/extension_enable_flow.h"
45 #include "chrome/browser/ui/tabs/tab_strip_model.h" 46 #include "chrome/browser/ui/tabs/tab_strip_model.h"
46 #include "chrome/browser/web_applications/web_app.h" 47 #include "chrome/browser/web_applications/web_app.h"
47 #include "chrome/common/chrome_notification_types.h" 48 #include "chrome/common/chrome_notification_types.h"
49 #include "chrome/common/chrome_switches.h"
48 #include "chrome/common/extensions/extension.h" 50 #include "chrome/common/extensions/extension.h"
49 #include "chrome/common/extensions/extension_resource.h" 51 #include "chrome/common/extensions/extension_resource.h"
50 #include "chrome/common/pref_names.h" 52 #include "chrome/common/pref_names.h"
51 #include "chrome/common/url_constants.h" 53 #include "chrome/common/url_constants.h"
52 #include "content/public/browser/navigation_entry.h" 54 #include "content/public/browser/navigation_entry.h"
53 #include "content/public/browser/notification_service.h" 55 #include "content/public/browser/notification_service.h"
54 #include "content/public/browser/web_contents.h" 56 #include "content/public/browser/web_contents.h"
55 #include "extensions/common/url_pattern.h" 57 #include "extensions/common/url_pattern.h"
56 #include "grit/ash_resources.h" 58 #include "grit/ash_resources.h"
57 #include "grit/chromium_strings.h" 59 #include "grit/chromium_strings.h"
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 return model_; 626 return model_;
625 } 627 }
626 628
627 Profile* ChromeLauncherControllerPerApp::profile() { 629 Profile* ChromeLauncherControllerPerApp::profile() {
628 return profile_; 630 return profile_;
629 } 631 }
630 632
631 ash::ShelfAutoHideBehavior 633 ash::ShelfAutoHideBehavior
632 ChromeLauncherControllerPerApp::GetShelfAutoHideBehavior( 634 ChromeLauncherControllerPerApp::GetShelfAutoHideBehavior(
633 aura::RootWindow* root_window) const { 635 aura::RootWindow* root_window) const {
636 // Don't show the shelf in app mode.
637 if (chrome::IsRunningInAppMode())
638 return ash::SHELF_AUTO_HIDE_ALWAYS_HIDDEN;
639
634 // See comment in |kShelfAlignment| as to why we consider two prefs. 640 // See comment in |kShelfAlignment| as to why we consider two prefs.
635 const std::string behavior_value( 641 const std::string behavior_value(
636 GetPrefForRootWindow(profile_->GetPrefs(), 642 GetPrefForRootWindow(profile_->GetPrefs(),
637 root_window, 643 root_window,
638 prefs::kShelfAutoHideBehaviorLocal, 644 prefs::kShelfAutoHideBehaviorLocal,
639 prefs::kShelfAutoHideBehavior)); 645 prefs::kShelfAutoHideBehavior));
640 646
641 // Note: To maintain sync compatibility with old images of chrome/chromeos 647 // Note: To maintain sync compatibility with old images of chrome/chromeos
642 // the set of values that may be encountered includes the now-extinct 648 // the set of values that may be encountered includes the now-extinct
643 // "Default" as well as "Never" and "Always", "Default" should now 649 // "Default" as well as "Never" and "Always", "Default" should now
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 ash::ShelfAutoHideBehavior behavior, 1201 ash::ShelfAutoHideBehavior behavior,
1196 aura::RootWindow* root_window) { 1202 aura::RootWindow* root_window) {
1197 const char* value = NULL; 1203 const char* value = NULL;
1198 switch (behavior) { 1204 switch (behavior) {
1199 case ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS: 1205 case ash::SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS:
1200 value = ash::kShelfAutoHideBehaviorAlways; 1206 value = ash::kShelfAutoHideBehaviorAlways;
1201 break; 1207 break;
1202 case ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER: 1208 case ash::SHELF_AUTO_HIDE_BEHAVIOR_NEVER:
1203 value = ash::kShelfAutoHideBehaviorNever; 1209 value = ash::kShelfAutoHideBehaviorNever;
1204 break; 1210 break;
1211 case ash::SHELF_AUTO_HIDE_ALWAYS_HIDDEN:
1212 // This one should not be a valid preference option for now. We only want
1213 // to completely hide it when we run app mode.
1214 NOTREACHED();
1215 return;
1205 } 1216 }
1206 1217
1207 UpdatePerDisplayPref( 1218 UpdatePerDisplayPref(
1208 profile_->GetPrefs(), root_window, prefs::kShelfAutoHideBehavior, value); 1219 profile_->GetPrefs(), root_window, prefs::kShelfAutoHideBehavior, value);
1209 1220
1210 if (root_window == ash::Shell::GetPrimaryRootWindow()) { 1221 if (root_window == ash::Shell::GetPrimaryRootWindow()) {
1211 // See comment in |kShelfAlignment| about why we have two prefs here. 1222 // See comment in |kShelfAlignment| about why we have two prefs here.
1212 profile_->GetPrefs()->SetString(prefs::kShelfAutoHideBehaviorLocal, value); 1223 profile_->GetPrefs()->SetString(prefs::kShelfAutoHideBehaviorLocal, value);
1213 profile_->GetPrefs()->SetString(prefs::kShelfAutoHideBehavior, value); 1224 profile_->GetPrefs()->SetString(prefs::kShelfAutoHideBehavior, value);
1214 } 1225 }
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1329 WebContents* web_contents = 1340 WebContents* web_contents =
1330 tab_strip->GetWebContentsAt(tab_strip->active_index()); 1341 tab_strip->GetWebContentsAt(tab_strip->active_index());
1331 gfx::Image app_icon = GetAppListIcon(web_contents); 1342 gfx::Image app_icon = GetAppListIcon(web_contents);
1332 items->push_back(new ChromeLauncherAppMenuItemBrowser( 1343 items->push_back(new ChromeLauncherAppMenuItemBrowser(
1333 web_contents->GetTitle(), 1344 web_contents->GetTitle(),
1334 app_icon.IsEmpty() ? NULL : &app_icon, 1345 app_icon.IsEmpty() ? NULL : &app_icon,
1335 browser)); 1346 browser));
1336 } 1347 }
1337 return items; 1348 return items;
1338 } 1349 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698