| 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/ash/launcher/chrome_launcher_controller_per_browser.
h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_browser.
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/root_window_controller.h" | 10 #include "ash/root_window_controller.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #include "chrome/browser/ui/browser_finder.h" | 36 #include "chrome/browser/ui/browser_finder.h" |
| 37 #include "chrome/browser/ui/browser_tabstrip.h" | 37 #include "chrome/browser/ui/browser_tabstrip.h" |
| 38 #include "chrome/browser/ui/browser_window.h" | 38 #include "chrome/browser/ui/browser_window.h" |
| 39 #include "chrome/browser/ui/extensions/application_launch.h" | 39 #include "chrome/browser/ui/extensions/application_launch.h" |
| 40 #include "chrome/browser/ui/extensions/extension_enable_flow.h" | 40 #include "chrome/browser/ui/extensions/extension_enable_flow.h" |
| 41 #include "chrome/browser/ui/host_desktop.h" | 41 #include "chrome/browser/ui/host_desktop.h" |
| 42 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 42 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 43 #include "chrome/browser/web_applications/web_app.h" | 43 #include "chrome/browser/web_applications/web_app.h" |
| 44 #include "chrome/common/chrome_notification_types.h" | 44 #include "chrome/common/chrome_notification_types.h" |
| 45 #include "chrome/common/chrome_switches.h" | 45 #include "chrome/common/chrome_switches.h" |
| 46 #include "chrome/common/extensions/app_launcher_info.h" |
| 46 #include "chrome/common/extensions/extension.h" | 47 #include "chrome/common/extensions/extension.h" |
| 47 #include "chrome/common/extensions/manifest_handlers/icons_handler.h" | 48 #include "chrome/common/extensions/manifest_handlers/icons_handler.h" |
| 48 #include "chrome/common/pref_names.h" | 49 #include "chrome/common/pref_names.h" |
| 49 #include "chrome/common/url_constants.h" | 50 #include "chrome/common/url_constants.h" |
| 50 #include "content/public/browser/navigation_entry.h" | 51 #include "content/public/browser/navigation_entry.h" |
| 51 #include "content/public/browser/notification_service.h" | 52 #include "content/public/browser/notification_service.h" |
| 52 #include "content/public/browser/web_contents.h" | 53 #include "content/public/browser/web_contents.h" |
| 53 #include "extensions/common/url_pattern.h" | 54 #include "extensions/common/url_pattern.h" |
| 54 #include "grit/theme_resources.h" | 55 #include "grit/theme_resources.h" |
| 55 #include "ui/aura/root_window.h" | 56 #include "ui/aura/root_window.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 67 public: | 68 public: |
| 68 AppShortcutLauncherItemController( | 69 AppShortcutLauncherItemController( |
| 69 const std::string& app_id, | 70 const std::string& app_id, |
| 70 ChromeLauncherControllerPerBrowser* controller) | 71 ChromeLauncherControllerPerBrowser* controller) |
| 71 : LauncherItemController(TYPE_SHORTCUT, app_id, controller) { | 72 : LauncherItemController(TYPE_SHORTCUT, app_id, controller) { |
| 72 // Google Drive should just refocus to it's main app UI. | 73 // Google Drive should just refocus to it's main app UI. |
| 73 // TODO(davemoore): Generalize this for other applications. | 74 // TODO(davemoore): Generalize this for other applications. |
| 74 if (app_id == "apdfllckaahabafndbhieahigkjlhalf") { | 75 if (app_id == "apdfllckaahabafndbhieahigkjlhalf") { |
| 75 const Extension* extension = | 76 const Extension* extension = |
| 76 launcher_controller()->GetExtensionForAppID(app_id); | 77 launcher_controller()->GetExtensionForAppID(app_id); |
| 77 refocus_url_ = GURL(extension->launch_web_url() + "*"); | 78 refocus_url_ = |
| 79 GURL(extensions::AppLauncherInfo::GetLaunchWebURL(extension) + "*"); |
| 78 } | 80 } |
| 79 } | 81 } |
| 80 | 82 |
| 81 virtual ~AppShortcutLauncherItemController() {} | 83 virtual ~AppShortcutLauncherItemController() {} |
| 82 | 84 |
| 83 // LauncherItemController overrides: | 85 // LauncherItemController overrides: |
| 84 virtual string16 GetTitle() OVERRIDE { | 86 virtual string16 GetTitle() OVERRIDE { |
| 85 return GetAppTitle(); | 87 return GetAppTitle(); |
| 86 } | 88 } |
| 87 | 89 |
| (...skipping 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1366 void ChromeLauncherControllerPerBrowser::SetAppIconLoaderForTest( | 1368 void ChromeLauncherControllerPerBrowser::SetAppIconLoaderForTest( |
| 1367 extensions::AppIconLoader* loader) { | 1369 extensions::AppIconLoader* loader) { |
| 1368 app_icon_loader_.reset(loader); | 1370 app_icon_loader_.reset(loader); |
| 1369 } | 1371 } |
| 1370 | 1372 |
| 1371 const std::string& | 1373 const std::string& |
| 1372 ChromeLauncherControllerPerBrowser::GetAppIdFromLauncherIdForTest( | 1374 ChromeLauncherControllerPerBrowser::GetAppIdFromLauncherIdForTest( |
| 1373 ash::LauncherID id) { | 1375 ash::LauncherID id) { |
| 1374 return id_to_item_controller_map_[id]->app_id(); | 1376 return id_to_item_controller_map_[id]->app_id(); |
| 1375 } | 1377 } |
| OLD | NEW |