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

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

Issue 12316077: Move the parsing of app.launch related keys out of Extension class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 9 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
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_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/shell.h" 10 #include "ash/shell.h"
(...skipping 24 matching lines...) Expand all
35 #include "chrome/browser/ui/browser_tabstrip.h" 35 #include "chrome/browser/ui/browser_tabstrip.h"
36 #include "chrome/browser/ui/browser_window.h" 36 #include "chrome/browser/ui/browser_window.h"
37 #include "chrome/browser/ui/extensions/application_launch.h" 37 #include "chrome/browser/ui/extensions/application_launch.h"
38 #include "chrome/browser/ui/extensions/extension_enable_flow.h" 38 #include "chrome/browser/ui/extensions/extension_enable_flow.h"
39 #include "chrome/browser/ui/host_desktop.h" 39 #include "chrome/browser/ui/host_desktop.h"
40 #include "chrome/browser/ui/tabs/tab_strip_model.h" 40 #include "chrome/browser/ui/tabs/tab_strip_model.h"
41 #include "chrome/browser/web_applications/web_app.h" 41 #include "chrome/browser/web_applications/web_app.h"
42 #include "chrome/common/chrome_notification_types.h" 42 #include "chrome/common/chrome_notification_types.h"
43 #include "chrome/common/chrome_switches.h" 43 #include "chrome/common/chrome_switches.h"
44 #include "chrome/common/extensions/api/icons/icons_handler.h" 44 #include "chrome/common/extensions/api/icons/icons_handler.h"
45 #include "chrome/common/extensions/app_launcher_info.h"
45 #include "chrome/common/extensions/extension.h" 46 #include "chrome/common/extensions/extension.h"
46 #include "chrome/common/extensions/extension_resource.h" 47 #include "chrome/common/extensions/extension_resource.h"
47 #include "chrome/common/pref_names.h" 48 #include "chrome/common/pref_names.h"
48 #include "chrome/common/url_constants.h" 49 #include "chrome/common/url_constants.h"
49 #include "content/public/browser/navigation_entry.h" 50 #include "content/public/browser/navigation_entry.h"
50 #include "content/public/browser/notification_service.h" 51 #include "content/public/browser/notification_service.h"
51 #include "content/public/browser/web_contents.h" 52 #include "content/public/browser/web_contents.h"
52 #include "extensions/common/url_pattern.h" 53 #include "extensions/common/url_pattern.h"
53 #include "grit/theme_resources.h" 54 #include "grit/theme_resources.h"
54 #include "ui/aura/root_window.h" 55 #include "ui/aura/root_window.h"
(...skipping 11 matching lines...) Expand all
66 public: 67 public:
67 AppShortcutLauncherItemController( 68 AppShortcutLauncherItemController(
68 const std::string& app_id, 69 const std::string& app_id,
69 ChromeLauncherControllerPerBrowser* controller) 70 ChromeLauncherControllerPerBrowser* controller)
70 : LauncherItemController(TYPE_SHORTCUT, app_id, controller) { 71 : LauncherItemController(TYPE_SHORTCUT, app_id, controller) {
71 // Google Drive should just refocus to it's main app UI. 72 // Google Drive should just refocus to it's main app UI.
72 // TODO(davemoore): Generalize this for other applications. 73 // TODO(davemoore): Generalize this for other applications.
73 if (app_id == "apdfllckaahabafndbhieahigkjlhalf") { 74 if (app_id == "apdfllckaahabafndbhieahigkjlhalf") {
74 const Extension* extension = 75 const Extension* extension =
75 launcher_controller()->GetExtensionForAppID(app_id); 76 launcher_controller()->GetExtensionForAppID(app_id);
76 refocus_url_ = GURL(extension->launch_web_url() + "*"); 77 refocus_url_ =
78 GURL(extensions::AppLauncherInfo::GetLaunchWebURL(extension) + "*");
77 } 79 }
78 } 80 }
79 81
80 virtual ~AppShortcutLauncherItemController() {} 82 virtual ~AppShortcutLauncherItemController() {}
81 83
82 // LauncherItemController overrides: 84 // LauncherItemController overrides:
83 virtual string16 GetTitle() OVERRIDE { 85 virtual string16 GetTitle() OVERRIDE {
84 return GetAppTitle(); 86 return GetAppTitle();
85 } 87 }
86 88
(...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after
1339 void ChromeLauncherControllerPerBrowser::SetAppIconLoaderForTest( 1341 void ChromeLauncherControllerPerBrowser::SetAppIconLoaderForTest(
1340 extensions::AppIconLoader* loader) { 1342 extensions::AppIconLoader* loader) {
1341 app_icon_loader_.reset(loader); 1343 app_icon_loader_.reset(loader);
1342 } 1344 }
1343 1345
1344 const std::string& 1346 const std::string&
1345 ChromeLauncherControllerPerBrowser::GetAppIdFromLauncherIdForTest( 1347 ChromeLauncherControllerPerBrowser::GetAppIdFromLauncherIdForTest(
1346 ash::LauncherID id) { 1348 ash::LauncherID id) {
1347 return id_to_item_controller_map_[id]->app_id(); 1349 return id_to_item_controller_map_[id]->app_id();
1348 } 1350 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.cc ('k') | chrome/browser/ui/browser_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698