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

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

Issue 306083002: Fixing problem with minimizing of applications to incorrect locations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing problem with settings application Created 6 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/browser_shortcut_launcher_item_controll er.h" 5 #include "chrome/browser/ui/ash/launcher/browser_shortcut_launcher_item_controll er.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/shelf/shelf.h" 9 #include "ash/shelf/shelf.h"
10 #include "ash/shelf/shelf_model.h" 10 #include "ash/shelf/shelf_model.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 96
97 if (browser_status != browser_item.status) { 97 if (browser_status != browser_item.status) {
98 browser_item.status = browser_status; 98 browser_item.status = browser_status;
99 model->Set(browser_index, browser_item); 99 model->Set(browser_index, browser_item);
100 } 100 }
101 } 101 }
102 102
103 void BrowserShortcutLauncherItemController::SetShelfIDForBrowserWindowContents( 103 void BrowserShortcutLauncherItemController::SetShelfIDForBrowserWindowContents(
104 Browser* browser, 104 Browser* browser,
105 content::WebContents* web_contents) { 105 content::WebContents* web_contents) {
106 if (!IsBrowserRepresentedInBrowserList(browser)) 106 // We need to call SetShelfIDForWindow for V1 applications since they are
107 // content which might change and as such change the application type.
108 if (!browser ||
109 !launcher_controller()->IsBrowserFromActiveUser(browser) ||
110 browser->host_desktop_type() != chrome::HOST_DESKTOP_TYPE_ASH ||
111 chrome::IsTrustedPopupWindowWithScheme(browser, content::kChromeUIScheme))
107 return; 112 return;
113
108 ash::SetShelfIDForWindow( 114 ash::SetShelfIDForWindow(
109 launcher_controller()->GetShelfIDForWebContents(web_contents), 115 launcher_controller()->GetShelfIDForWebContents(web_contents),
110 browser->window()->GetNativeWindow()); 116 browser->window()->GetNativeWindow());
111 } 117 }
112 118
113 bool BrowserShortcutLauncherItemController::IsOpen() const { 119 bool BrowserShortcutLauncherItemController::IsOpen() const {
114 const BrowserList* ash_browser_list = 120 const BrowserList* ash_browser_list =
115 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH); 121 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH);
116 for (BrowserList::const_iterator it = ash_browser_list->begin(); 122 for (BrowserList::const_iterator it = ash_browser_list->begin();
117 it != ash_browser_list->end(); ++it) { 123 it != ash_browser_list->end(); ++it) {
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 web_app::GetExtensionIdFromApplicationName(browser->app_name())) > 0) 348 web_app::GetExtensionIdFromApplicationName(browser->app_name())) > 0)
343 return false; 349 return false;
344 350
345 // Stand-alone chrome:// windows (e.g. settings) have their own icon. 351 // Stand-alone chrome:// windows (e.g. settings) have their own icon.
346 if (chrome::IsTrustedPopupWindowWithScheme(browser, content::kChromeUIScheme)) 352 if (chrome::IsTrustedPopupWindowWithScheme(browser, content::kChromeUIScheme))
347 return false; 353 return false;
348 354
349 // Tabbed browser and other popup windows are all represented. 355 // Tabbed browser and other popup windows are all represented.
350 return true; 356 return true;
351 } 357 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698