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

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

Issue 2747983002: arc: Fix crash on deferred app launch. (Closed)
Patch Set: Created 3 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/app_shortcut_launcher_item_controller.h " 5 #include "chrome/browser/ui/ash/launcher/app_shortcut_launcher_item_controller.h "
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "ash/wm/window_util.h" 9 #include "ash/wm/window_util.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 Browser* browser = chrome::FindBrowserWithWebContents(content[i]); 181 Browser* browser = chrome::FindBrowserWithWebContents(content[i]);
182 if (!browser || !IsBrowserFromActiveUser(browser)) 182 if (!browser || !IsBrowserFromActiveUser(browser))
183 continue; 183 continue;
184 TabStripModel* tab_strip = browser->tab_strip_model(); 184 TabStripModel* tab_strip = browser->tab_strip_model();
185 int index = tab_strip->GetIndexOfWebContents(content[i]); 185 int index = tab_strip->GetIndexOfWebContents(content[i]);
186 DCHECK(index != TabStripModel::kNoTab); 186 DCHECK(index != TabStripModel::kNoTab);
187 tab_strip->CloseWebContentsAt(index, TabStripModel::CLOSE_NONE); 187 tab_strip->CloseWebContentsAt(index, TabStripModel::CLOSE_NONE);
188 } 188 }
189 } 189 }
190 190
191 bool AppShortcutLauncherItemController::IsShortcut() const {
192 return true;
msw 2017/03/14 01:24:59 What does it mean if LauncherItemController::IsSho
khmel 2017/03/14 15:25:44 Hi, I don't clear understand your idea. The reason
msw 2017/03/14 17:19:32 My idea is to update and check ShelfItem struct va
khmel 2017/03/14 20:19:56 Done as per offline discussion.
193 }
194
191 std::vector<content::WebContents*> 195 std::vector<content::WebContents*>
192 AppShortcutLauncherItemController::GetRunningApplications() { 196 AppShortcutLauncherItemController::GetRunningApplications() {
193 std::vector<content::WebContents*> items; 197 std::vector<content::WebContents*> items;
194 198
195 URLPattern refocus_pattern(URLPattern::SCHEME_ALL); 199 URLPattern refocus_pattern(URLPattern::SCHEME_ALL);
196 refocus_pattern.SetMatchAllURLs(true); 200 refocus_pattern.SetMatchAllURLs(true);
197 201
198 if (!refocus_url_.is_empty()) { 202 if (!refocus_url_.is_empty()) {
199 refocus_pattern.SetMatchAllURLs(false); 203 refocus_pattern.SetMatchAllURLs(false);
200 refocus_pattern.Parse(refocus_url_.spec()); 204 refocus_pattern.Parse(refocus_url_.spec());
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 363
360 bool AppShortcutLauncherItemController::AllowNextLaunchAttempt() { 364 bool AppShortcutLauncherItemController::AllowNextLaunchAttempt() {
361 if (last_launch_attempt_.is_null() || 365 if (last_launch_attempt_.is_null() ||
362 last_launch_attempt_ + base::TimeDelta::FromMilliseconds( 366 last_launch_attempt_ + base::TimeDelta::FromMilliseconds(
363 kClickSuppressionInMS) < base::Time::Now()) { 367 kClickSuppressionInMS) < base::Time::Now()) {
364 last_launch_attempt_ = base::Time::Now(); 368 last_launch_attempt_ = base::Time::Now();
365 return true; 369 return true;
366 } 370 }
367 return false; 371 return false;
368 } 372 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698