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

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, 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
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 23 matching lines...) Expand all
34 #include "chrome/browser/ui/browser_finder.h" 34 #include "chrome/browser/ui/browser_finder.h"
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/app_launch_manifest_handler.h"
44 #include "chrome/common/extensions/extension.h" 45 #include "chrome/common/extensions/extension.h"
45 #include "chrome/common/extensions/extension_resource.h" 46 #include "chrome/common/extensions/extension_resource.h"
46 #include "chrome/common/pref_names.h" 47 #include "chrome/common/pref_names.h"
47 #include "chrome/common/url_constants.h" 48 #include "chrome/common/url_constants.h"
48 #include "content/public/browser/navigation_entry.h" 49 #include "content/public/browser/navigation_entry.h"
49 #include "content/public/browser/notification_service.h" 50 #include "content/public/browser/notification_service.h"
50 #include "content/public/browser/web_contents.h" 51 #include "content/public/browser/web_contents.h"
51 #include "extensions/common/url_pattern.h" 52 #include "extensions/common/url_pattern.h"
52 #include "grit/theme_resources.h" 53 #include "grit/theme_resources.h"
53 #include "ui/aura/root_window.h" 54 #include "ui/aura/root_window.h"
(...skipping 11 matching lines...) Expand all
65 public: 66 public:
66 AppShortcutLauncherItemController( 67 AppShortcutLauncherItemController(
67 const std::string& app_id, 68 const std::string& app_id,
68 ChromeLauncherControllerPerBrowser* controller) 69 ChromeLauncherControllerPerBrowser* controller)
69 : LauncherItemController(TYPE_SHORTCUT, app_id, controller) { 70 : LauncherItemController(TYPE_SHORTCUT, app_id, controller) {
70 // Google Drive should just refocus to it's main app UI. 71 // Google Drive should just refocus to it's main app UI.
71 // TODO(davemoore): Generalize this for other applications. 72 // TODO(davemoore): Generalize this for other applications.
72 if (app_id == "apdfllckaahabafndbhieahigkjlhalf") { 73 if (app_id == "apdfllckaahabafndbhieahigkjlhalf") {
73 const Extension* extension = 74 const Extension* extension =
74 launcher_controller()->GetExtensionForAppID(app_id); 75 launcher_controller()->GetExtensionForAppID(app_id);
75 refocus_url_ = GURL(extension->launch_web_url() + "*"); 76 refocus_url_ =
77 GURL(extensions::AppLaunchInfo::GetLaunchWebUrl(extension) + "*");
76 } 78 }
77 } 79 }
78 80
79 virtual ~AppShortcutLauncherItemController() {} 81 virtual ~AppShortcutLauncherItemController() {}
80 82
81 // LauncherItemController overrides: 83 // LauncherItemController overrides:
82 virtual string16 GetTitle() OVERRIDE { 84 virtual string16 GetTitle() OVERRIDE {
83 return GetAppTitle(); 85 return GetAppTitle();
84 } 86 }
85 87
(...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after
1311 void ChromeLauncherControllerPerBrowser::SetAppIconLoaderForTest( 1313 void ChromeLauncherControllerPerBrowser::SetAppIconLoaderForTest(
1312 extensions::AppIconLoader* loader) { 1314 extensions::AppIconLoader* loader) {
1313 app_icon_loader_.reset(loader); 1315 app_icon_loader_.reset(loader);
1314 } 1316 }
1315 1317
1316 const std::string& 1318 const std::string&
1317 ChromeLauncherControllerPerBrowser::GetAppIdFromLauncherIdForTest( 1319 ChromeLauncherControllerPerBrowser::GetAppIdFromLauncherIdForTest(
1318 ash::LauncherID id) { 1320 ash::LauncherID id) {
1319 return id_to_item_controller_map_[id]->app_id(); 1321 return id_to_item_controller_map_[id]->app_id();
1320 } 1322 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698